Browse Source

[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>
Martin Schwidefsky 14 years ago
parent
commit
371db06b01
2 changed files with 1 additions and 10 deletions
  1. 1 2
      arch/s390/include/asm/kprobes.h
  2. 0 8
      arch/s390/kernel/kprobes.c

+ 1 - 2
arch/s390/include/asm/kprobes.h

@@ -31,7 +31,6 @@
 #include <linux/ptrace.h>
 #include <linux/ptrace.h>
 #include <linux/percpu.h>
 #include <linux/percpu.h>
 
 
-#define  __ARCH_WANT_KPROBES_INSN_SLOT
 struct pt_regs;
 struct pt_regs;
 struct kprobe;
 struct kprobe;
 
 
@@ -58,7 +57,7 @@ typedef u16 kprobe_opcode_t;
 /* Architecture specific copy of original instruction */
 /* Architecture specific copy of original instruction */
 struct arch_specific_insn {
 struct arch_specific_insn {
 	/* copy of original instruction */
 	/* copy of original instruction */
-	kprobe_opcode_t *insn;
+	kprobe_opcode_t insn[MAX_INSN_SIZE];
 };
 };
 
 
 struct prev_kprobe {
 struct prev_kprobe {

+ 0 - 8
arch/s390/kernel/kprobes.c

@@ -126,10 +126,6 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
 	if (is_prohibited_opcode((kprobe_opcode_t *) p->addr))
 	if (is_prohibited_opcode((kprobe_opcode_t *) p->addr))
 		return -EINVAL;
 		return -EINVAL;
 
 
-	/* Use the get_insn_slot() facility for correctness */
-	if (!(p->ainsn.insn = get_insn_slot()))
-		return -ENOMEM;
-
 	p->opcode = *p->addr;
 	p->opcode = *p->addr;
 	memcpy(p->ainsn.insn, p->addr, ((p->opcode >> 14) + 3) & -2);
 	memcpy(p->ainsn.insn, p->addr, ((p->opcode >> 14) + 3) & -2);
 
 
@@ -173,10 +169,6 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
 
 
 void __kprobes arch_remove_kprobe(struct kprobe *p)
 void __kprobes arch_remove_kprobe(struct kprobe *p)
 {
 {
-	if (p->ainsn.insn) {
-		free_insn_slot(p->ainsn.insn, 0);
-		p->ainsn.insn = NULL;
-	}
 }
 }
 
 
 static void __kprobes enable_singlestep(struct kprobe_ctlblk *kcb,
 static void __kprobes enable_singlestep(struct kprobe_ctlblk *kcb,