This is the mail archive of the
systemtap@sources.redhat.com
mailing list for the systemtap project.
Re: [RFC PATCH 2/4] kprobes: ia64 specific preempt changes
- From: Ananth N Mavinakayanahalli <ananth at in dot ibm dot com>
- To: systemtap at sources dot redhat dot com
- Date: Fri, 29 Jul 2005 14:32:24 -0400
- Subject: Re: [RFC PATCH 2/4] kprobes: ia64 specific preempt changes
- References: <20050729182840.GA1692@in.ibm.com> <20050729183045.GB1692@in.ibm.com>
- Reply-to: ananth at in dot ibm dot com
Preempt changes for IA64 - compile tested only.
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
arch/ia64/kernel/kprobes.c | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
Index: linux-2.6.13-rc3/arch/ia64/kernel/kprobes.c
===================================================================
--- linux-2.6.13-rc3.orig/arch/ia64/kernel/kprobes.c 2005-07-27 13:11:04.000000000 -0400
+++ linux-2.6.13-rc3/arch/ia64/kernel/kprobes.c 2005-07-27 13:36:29.000000000 -0400
@@ -379,7 +379,6 @@ int __kprobes trampoline_probe_handler(s
regs->cr_iip = orig_ret_address;
unlock_kprobes();
- preempt_enable_no_resched();
/*
* By returning a non-zero value, we are telling
@@ -593,8 +592,6 @@ static int __kprobes pre_kprobes_handler
struct pt_regs *regs = args->regs;
kprobe_opcode_t *addr = (kprobe_opcode_t *)instruction_pointer(regs);
- preempt_disable();
-
/* Handle recursion cases */
if (kprobe_running()) {
p = get_kprobe(addr);
@@ -663,6 +660,11 @@ static int __kprobes pre_kprobes_handler
ss_probe:
prepare_ss(p, regs);
kprobe_status = KPROBE_HIT_SS;
+ /*
+ * This preempt_disable() matches the preempt_enable_no_resched()
+ * in post_kprobes_handler()
+ */
+ preempt_disable();
return 1;
no_kprobe:
@@ -717,22 +719,26 @@ int __kprobes kprobe_exceptions_notify(s
unsigned long val, void *data)
{
struct die_args *args = (struct die_args *)data;
+ int ret = NOTIFY_DONE;
+
+ preempt_disable();
switch(val) {
case DIE_BREAK:
if (pre_kprobes_handler(args))
- return NOTIFY_STOP;
+ ret = NOTIFY_STOP;
break;
case DIE_SS:
if (post_kprobes_handler(args->regs))
- return NOTIFY_STOP;
+ ret = NOTIFY_STOP;
break;
case DIE_PAGE_FAULT:
if (kprobes_fault_handler(args->regs, args->trapnr))
- return NOTIFY_STOP;
+ ret = NOTIFY_STOP;
default:
break;
}
- return NOTIFY_DONE;
+ preempt_enable();
+ return ret;
}
int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)