This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: kprobe fault handling
- From: Keshavamurthy Anil S <anil dot s dot keshavamurthy at intel dot com>
- To: Prasanna S Panchamukhi <prasanna at in dot ibm dot com>
- Cc: Richard J Moore <richardj_moore at uk dot ibm dot com>, suparna at in dot ibm dot com, Martin Hunt <hunt at redhat dot com>, Jim Keniston <jkenisto at us dot ibm dot com>, SystemTAP <systemtap at sources dot redhat dot com>
- Date: Thu, 9 Feb 2006 08:32:39 -0800
- Subject: Re: kprobe fault handling
- References: <20060208043831.GA9313@in.ibm.com> <OFD9B8CED9.AB543156-ON8025710F.003BD103-8025710F.003EFA68@uk.ibm.com> <20060209072338.GA2902@in.ibm.com>
- Reply-to: Keshavamurthy Anil S <anil dot s dot keshavamurthy at intel dot com>
>
> arch/i386/kernel/kprobes.c | 32 +++++++++++++++++++++++++++++---
> 1 files changed, 29 insertions(+), 3 deletions(-)
>
> if (kcb->kprobe_status & KPROBE_HIT_SS) {
> + /*
> + * We are here because the instruction being single
> stepped
> + * caused a page fault. We reset the current kprobe
> and the
> + * eip points back to the probe address and allow the
> page
> + * fault handler.
> + */
> resume_execution(cur, regs, kcb);
resume_execution() tries to fixup the relative IP address and/or
tries to fixup branch address as if we were successfull in single stepping.
I think we just need to point eip back to probed address here.
Also as Bibo pointed out, not sure how do_page_faulut() function can fix up the
page we are trying to single step as the current eip in the regs points to
probed address.
>
> reset_current_kprobe();
Need to handle KPROBE_REENTER case here, i.e
if(kcb->kprobe_status & KPROBE_REENTER) {
restore_previous_kprobe();
} else {
reset_current_kprobe();
}
> preempt_enable_no_resched();
-anil