Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 227230
b: refs/heads/master
c: 5a8b589
h: refs/heads/master
v: v3
  • Loading branch information
Martin Schwidefsky authored and Martin Schwidefsky committed Jan 5, 2011
1 parent 7839b09 commit 0e6c93e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fc0a1fea6b81095b6c0e01ec3407d04c8341974c
refs/heads/master: 5a8b589f8a35b2c69d1819e3365825e4385a844c
5 changes: 0 additions & 5 deletions trunk/arch/s390/include/asm/kprobes.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ struct arch_specific_insn {
int reg;
};

struct ins_replace_args {
kprobe_opcode_t *ptr;
kprobe_opcode_t old;
kprobe_opcode_t new;
};
struct prev_kprobe {
struct kprobe *kp;
unsigned long status;
Expand Down
16 changes: 9 additions & 7 deletions trunk/arch/s390/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,26 +157,29 @@ void __kprobes get_instruction_type(struct arch_specific_insn *ainsn)
}
}

struct ins_replace_args {
kprobe_opcode_t *ptr;
kprobe_opcode_t opcode;
};

static int __kprobes swap_instruction(void *aref)
{
struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
unsigned long status = kcb->kprobe_status;
struct ins_replace_args *args = aref;
int rc;

kcb->kprobe_status = KPROBE_SWAP_INST;
rc = probe_kernel_write(args->ptr, &args->new, sizeof(args->new));
probe_kernel_write(args->ptr, &args->opcode, sizeof(args->opcode));
kcb->kprobe_status = status;
return rc;
return 0;
}

void __kprobes arch_arm_kprobe(struct kprobe *p)
{
struct ins_replace_args args;

args.ptr = p->addr;
args.old = p->opcode;
args.new = BREAKPOINT_INSTRUCTION;
args.opcode = BREAKPOINT_INSTRUCTION;
stop_machine(swap_instruction, &args, NULL);
}

Expand All @@ -185,8 +188,7 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
struct ins_replace_args args;

args.ptr = p->addr;
args.old = BREAKPOINT_INSTRUCTION;
args.new = p->opcode;
args.opcode = p->opcode;
stop_machine(swap_instruction, &args, NULL);
}

Expand Down

0 comments on commit 0e6c93e

Please sign in to comment.