diff options
author | Keshavamurthy Anil S <anil.s.keshavamurthy@intel.com> | 2006-01-09 23:52:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-10 11:01:40 -0500 |
commit | f709b122343fb9a010b6cf2d5559641f1820f7c9 (patch) | |
tree | 5019515d4debd995570ffd35b6311fdd26456306 /arch | |
parent | 49a2a1b83ba6fa40c41968d6a28ba16e7ed0c3f7 (diff) |
[PATCH] kprobes-changed-from-using-spinlock-to-mutex fix
Based on some feedback from Oleg Nesterov, I have made few changes to
previously posted patch.
Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/kprobes.c | 3 | ||||
-rw-r--r-- | arch/x86_64/kernel/kprobes.c | 4 |
2 files changed, 2 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c index 331e169e8629..2cd32dd6898b 100644 --- a/arch/powerpc/kernel/kprobes.c +++ b/arch/powerpc/kernel/kprobes.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <asm/kdebug.h> | 35 | #include <asm/kdebug.h> |
36 | #include <asm/sstep.h> | 36 | #include <asm/sstep.h> |
37 | 37 | ||
38 | static DECLARE_MUTEX(kprobe_mutex); | ||
39 | DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; | 38 | DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; |
40 | DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); | 39 | DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); |
41 | 40 | ||
@@ -54,9 +53,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) | |||
54 | 53 | ||
55 | /* insn must be on a special executable page on ppc64 */ | 54 | /* insn must be on a special executable page on ppc64 */ |
56 | if (!ret) { | 55 | if (!ret) { |
57 | down(&kprobe_mutex); | ||
58 | p->ainsn.insn = get_insn_slot(); | 56 | p->ainsn.insn = get_insn_slot(); |
59 | up(&kprobe_mutex); | ||
60 | if (!p->ainsn.insn) | 57 | if (!p->ainsn.insn) |
61 | ret = -ENOMEM; | 58 | ret = -ENOMEM; |
62 | } | 59 | } |
diff --git a/arch/x86_64/kernel/kprobes.c b/arch/x86_64/kernel/kprobes.c index 8b8943bfb89e..128e18190f99 100644 --- a/arch/x86_64/kernel/kprobes.c +++ b/arch/x86_64/kernel/kprobes.c | |||
@@ -43,7 +43,7 @@ | |||
43 | #include <asm/kdebug.h> | 43 | #include <asm/kdebug.h> |
44 | 44 | ||
45 | void jprobe_return_end(void); | 45 | void jprobe_return_end(void); |
46 | void __kprobes arch_copy_kprobe(struct kprobe *p); | 46 | static void __kprobes arch_copy_kprobe(struct kprobe *p); |
47 | 47 | ||
48 | DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; | 48 | DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; |
49 | DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); | 49 | DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); |
@@ -180,7 +180,7 @@ static inline s32 *is_riprel(u8 *insn) | |||
180 | return NULL; | 180 | return NULL; |
181 | } | 181 | } |
182 | 182 | ||
183 | void __kprobes arch_copy_kprobe(struct kprobe *p) | 183 | static void __kprobes arch_copy_kprobe(struct kprobe *p) |
184 | { | 184 | { |
185 | s32 *ripdisp; | 185 | s32 *ripdisp; |
186 | memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE); | 186 | memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE); |