aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/asm-powerpc/kprobes.h2
-rw-r--r--include/asm-x86_64/kprobes.h2
-rw-r--r--kernel/kprobes.c2
3 files changed, 6 insertions, 0 deletions
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h
index 0654f79b06df..7c98e547c6d8 100644
--- a/include/asm-powerpc/kprobes.h
+++ b/include/asm-powerpc/kprobes.h
@@ -30,6 +30,8 @@
30#include <linux/ptrace.h> 30#include <linux/ptrace.h>
31#include <linux/percpu.h> 31#include <linux/percpu.h>
32 32
33#define __ARCH_WANT_KPROBES_INSN_SLOT
34
33struct pt_regs; 35struct pt_regs;
34 36
35typedef unsigned int kprobe_opcode_t; 37typedef unsigned int kprobe_opcode_t;
diff --git a/include/asm-x86_64/kprobes.h b/include/asm-x86_64/kprobes.h
index 4dd7a7e148d4..9e2532adf42c 100644
--- a/include/asm-x86_64/kprobes.h
+++ b/include/asm-x86_64/kprobes.h
@@ -27,6 +27,8 @@
27#include <linux/ptrace.h> 27#include <linux/ptrace.h>
28#include <linux/percpu.h> 28#include <linux/percpu.h>
29 29
30#define __ARCH_WANT_KPROBES_INSN_SLOT
31
30struct pt_regs; 32struct pt_regs;
31 33
32typedef u8 kprobe_opcode_t; 34typedef u8 kprobe_opcode_t;
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 3bb71e63a37e..3897630d2335 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -52,6 +52,7 @@ static DEFINE_SPINLOCK(kprobe_lock); /* Protects kprobe_table */
52DEFINE_SPINLOCK(kretprobe_lock); /* Protects kretprobe_inst_table */ 52DEFINE_SPINLOCK(kretprobe_lock); /* Protects kretprobe_inst_table */
53static DEFINE_PER_CPU(struct kprobe *, kprobe_instance) = NULL; 53static DEFINE_PER_CPU(struct kprobe *, kprobe_instance) = NULL;
54 54
55#ifdef __ARCH_WANT_KPROBES_INSN_SLOT
55/* 56/*
56 * kprobe->ainsn.insn points to the copy of the instruction to be 57 * kprobe->ainsn.insn points to the copy of the instruction to be
57 * single-stepped. x86_64, POWER4 and above have no-exec support and 58 * single-stepped. x86_64, POWER4 and above have no-exec support and
@@ -151,6 +152,7 @@ void __kprobes free_insn_slot(kprobe_opcode_t *slot)
151 } 152 }
152 } 153 }
153} 154}
155#endif
154 156
155/* We have preemption disabled.. so it is safe to use __ versions */ 157/* We have preemption disabled.. so it is safe to use __ versions */
156static inline void set_kprobe_instance(struct kprobe *kp) 158static inline void set_kprobe_instance(struct kprobe *kp)