diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2013-09-13 07:59:26 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-10-24 11:16:49 -0400 |
commit | a882b3b0676fa42ab29c492e56749ab00ca95c0d (patch) | |
tree | 16d6a6c02078f51c019953dfa1288977ac6c0ce5 /arch/s390/kernel/kprobes.c | |
parent | 0f20822a69148f53bbafbe6ee3d43e8eff0bad27 (diff) |
s390/kprobes: use insn_length helper function
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/kprobes.c')
-rw-r--r-- | arch/s390/kernel/kprobes.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c index 9f99ad7fc212..c52fdf290301 100644 --- a/arch/s390/kernel/kprobes.c +++ b/arch/s390/kernel/kprobes.c | |||
@@ -26,11 +26,12 @@ | |||
26 | #include <linux/stop_machine.h> | 26 | #include <linux/stop_machine.h> |
27 | #include <linux/kdebug.h> | 27 | #include <linux/kdebug.h> |
28 | #include <linux/uaccess.h> | 28 | #include <linux/uaccess.h> |
29 | #include <asm/cacheflush.h> | ||
30 | #include <asm/sections.h> | ||
31 | #include <linux/module.h> | 29 | #include <linux/module.h> |
32 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
33 | #include <linux/hardirq.h> | 31 | #include <linux/hardirq.h> |
32 | #include <asm/cacheflush.h> | ||
33 | #include <asm/sections.h> | ||
34 | #include <asm/dis.h> | ||
34 | 35 | ||
35 | DEFINE_PER_CPU(struct kprobe *, current_kprobe); | 36 | DEFINE_PER_CPU(struct kprobe *, current_kprobe); |
36 | DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); | 37 | DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); |
@@ -208,7 +209,7 @@ static void __kprobes copy_instruction(struct kprobe *p) | |||
208 | s64 disp, new_disp; | 209 | s64 disp, new_disp; |
209 | u64 addr, new_addr; | 210 | u64 addr, new_addr; |
210 | 211 | ||
211 | memcpy(p->ainsn.insn, p->addr, ((p->opcode >> 14) + 3) & -2); | 212 | memcpy(p->ainsn.insn, p->addr, insn_length(p->opcode >> 8)); |
212 | if (!is_insn_relative_long(p->ainsn.insn)) | 213 | if (!is_insn_relative_long(p->ainsn.insn)) |
213 | return; | 214 | return; |
214 | /* | 215 | /* |
@@ -608,7 +609,7 @@ static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs) | |||
608 | ip += (unsigned long) p->addr - (unsigned long) p->ainsn.insn; | 609 | ip += (unsigned long) p->addr - (unsigned long) p->ainsn.insn; |
609 | 610 | ||
610 | if (fixup & FIXUP_BRANCH_NOT_TAKEN) { | 611 | if (fixup & FIXUP_BRANCH_NOT_TAKEN) { |
611 | int ilen = ((p->ainsn.insn[0] >> 14) + 3) & -2; | 612 | int ilen = insn_length(p->ainsn.insn[0] >> 8); |
612 | if (ip - (unsigned long) p->ainsn.insn == ilen) | 613 | if (ip - (unsigned long) p->ainsn.insn == ilen) |
613 | ip = (unsigned long) p->addr + ilen; | 614 | ip = (unsigned long) p->addr + ilen; |
614 | } | 615 | } |