This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: kprobe fault handling


On Tue, 2006-02-07 at 09:31 -0800, Jim Keniston wrote:
[...]
> > > And that's it. kprobe_fault_handler returns 0.  No call to
> > > fixup_exceptions()!  So do_page_fault() will have to do the fixups, but
> > > first it will print nasty might_sleep warnings and maybe actually sleep!
> 
> You have the right idea of running fixup_exceptions() in the fault
> handler, to prevent do_page_fault() from attempting its demand-paging
> stuff.  I just think it's OK to have the user's fault handler, rather
> than kprobe_fault_handler, run fixup_exceptions.

I think if the user's fault handler does not handle the page fault,
kprobes should attempt to do so. Returning without handling the page
fault could leave the system in a bad state. So your proposal would mean
it is necessary to specify a fault handler for any kprobe that might
attempt user-space access or otherwise trigger a page fault, otherwise
the system could crash.

Any more importantly, fixup_exception() and all the exception table code
are currently not exported so cannot be called from a module.

Martin



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]