diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-01-05 06:47:21 -0500 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2011-01-05 06:47:24 -0500 |
commit | 371db06b017c518da2d69ae278c5978ebcd1041a (patch) | |
tree | 02a1974a2e2a16d9625c1616c7004537a13d2245 /arch/s390 | |
parent | b9599798f953084774da926caa8bafd7e244948e (diff) |
[S390] kprobes: insn slots
The s390 architecture can execute code on kmalloc/vmalloc memory.
No need for the __ARCH_WANT_KPROBES_INSN_SLOT detour.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/include/asm/kprobes.h | 3 | ||||
-rw-r--r-- | arch/s390/kernel/kprobes.c | 8 |
2 files changed, 1 insertions, 10 deletions
diff --git a/arch/s390/include/asm/kprobes.h b/arch/s390/include/asm/kprobes.h index 787c6a870329..02a822e8ef75 100644 --- a/arch/s390/include/asm/kprobes.h +++ b/arch/s390/include/asm/kprobes.h | |||
@@ -31,7 +31,6 @@ | |||
31 | #include <linux/ptrace.h> | 31 | #include <linux/ptrace.h> |
32 | #include <linux/percpu.h> | 32 | #include <linux/percpu.h> |
33 | 33 | ||
34 | #define __ARCH_WANT_KPROBES_INSN_SLOT | ||
35 | struct pt_regs; | 34 | struct pt_regs; |
36 | struct kprobe; | 35 | struct kprobe; |
37 | 36 | ||
@@ -58,7 +57,7 @@ typedef u16 kprobe_opcode_t; | |||
58 | /* Architecture specific copy of original instruction */ | 57 | /* Architecture specific copy of original instruction */ |
59 | struct arch_specific_insn { | 58 | struct arch_specific_insn { |
60 | /* copy of original instruction */ | 59 | /* copy of original instruction */ |
61 | kprobe_opcode_t *insn; | 60 | kprobe_opcode_t insn[MAX_INSN_SIZE]; |
62 | }; | 61 | }; |
63 | 62 | ||
64 | struct prev_kprobe { | 63 | struct prev_kprobe { |
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c index f68eaaaa8062..61f0b6c3618c 100644 --- a/arch/s390/kernel/kprobes.c +++ b/arch/s390/kernel/kprobes.c | |||
@@ -126,10 +126,6 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) | |||
126 | if (is_prohibited_opcode((kprobe_opcode_t *) p->addr)) | 126 | if (is_prohibited_opcode((kprobe_opcode_t *) p->addr)) |
127 | return -EINVAL; | 127 | return -EINVAL; |
128 | 128 | ||
129 | /* Use the get_insn_slot() facility for correctness */ | ||
130 | if (!(p->ainsn.insn = get_insn_slot())) | ||
131 | return -ENOMEM; | ||
132 | |||
133 | p->opcode = *p->addr; | 129 | p->opcode = *p->addr; |
134 | memcpy(p->ainsn.insn, p->addr, ((p->opcode >> 14) + 3) & -2); | 130 | memcpy(p->ainsn.insn, p->addr, ((p->opcode >> 14) + 3) & -2); |
135 | 131 | ||
@@ -173,10 +169,6 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p) | |||
173 | 169 | ||
174 | void __kprobes arch_remove_kprobe(struct kprobe *p) | 170 | void __kprobes arch_remove_kprobe(struct kprobe *p) |
175 | { | 171 | { |
176 | if (p->ainsn.insn) { | ||
177 | free_insn_slot(p->ainsn.insn, 0); | ||
178 | p->ainsn.insn = NULL; | ||
179 | } | ||
180 | } | 172 | } |
181 | 173 | ||
182 | static void __kprobes enable_singlestep(struct kprobe_ctlblk *kcb, | 174 | static void __kprobes enable_singlestep(struct kprobe_ctlblk *kcb, |