This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Patch] Kprobes: bugfix of kprobe-booster: reenable kprobe-booster
- From: Satoshi Oshima <soshima at redhat dot com>
- To: Andrew Morton <akpm at osdl dot org>
- Cc: linux-kernel at vger dot kernel dot org, systemtap at sources dot redhat dot com, Ananth N Mavinakayanahalli <mananth at in dot ibm dot com>, Jim Keniston <jkenisto at us dot ibm dot com>, Prasanna S Panchamukhi <prasanna at in dot ibm dot com>, "Keshavamurthy, Anil S" <anil dot s dot keshavamurthy at intel dot com>, "Hideo AOKI at redhat" <haoki at redhat dot com>, sugita <sugita at sdl dot hitachi dot co dot jp>, Masami Hiramatsu <hiramatu at sdl dot hitachi dot co dot jp>
- Date: Fri, 19 May 2006 16:13:02 -0400
- Subject: [Patch] Kprobes: bugfix of kprobe-booster: reenable kprobe-booster
Hi Andrew,
I found a bug of kprobes in i386.
Kprobe-booster doesn't work if CONFIG_PREEMPT is not set.
Because pre_preempt_count is always 0.
Boostability have been disabled when removing '#ifdef
CONFIG_PREEMPT' I think.
This bug doesn't cause a kernel panic.
Regards,
Satoshi Oshima
Signed-off-by: Satoshi Oshima <soshima@redhat.com>
diff -Narup linux-2.6.17-rc3-mm1.orig/arch/i386/kernel/kprobes.c kprobes-i386-bugfix/arch/i386/kernel/kprobes.c
--- linux-2.6.17-rc3-mm1.orig/arch/i386/kernel/kprobes.c 2006-05-04 12:34:46.000000000 -0400
+++ kprobes-i386-bugfix/arch/i386/kernel/kprobes.c 2006-05-12 15:41:23.000000000 -0400
@@ -257,7 +257,11 @@ static int __kprobes kprobe_handler(stru
int ret = 0;
kprobe_opcode_t *addr;
struct kprobe_ctlblk *kcb;
+#ifdef CONFIG_PREEMPT
unsigned pre_preempt_count = preempt_count();
+#else
+ unsigned pre_preempt_count = 1;
+#endif
addr = (kprobe_opcode_t *)(regs->eip - sizeof(kprobe_opcode_t));