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: [RFC][PATCH] Kprobes robust fault handling for i386


prasanna wrote:

> [...]  IIUC you are planning on setjmp/longjmp() in systemtap
> generated handlers themselves ?

That was one idea, yeah.

> This can be achieved even without the robust fault handling code.

Except I can't find any general setjmp/longjmp implementation in the
kernel.

> [...]
> 	if ((setjmp(systemtap_jmp_buffer)) != 0) {
> 		<cleanup code>
> 	}
> 	copy_from_user_inatomic(.....);

(The systemtap-emitted setjmp would likely be in the probe prologue
boilerplate, not associated with copy_from_user so closely.)

> [...]
> systemtap_faulthandler(....)
> 	regs->eip = (unsigned long) systemtap_fault_trampoline;
> 	return 1; /*kprobe handler need not do anything else */

"instruction_register(regs)" instead "regs->eip" for portability,
right?

> [...]
> systemtap_fault_trampoline(void)
> 	longjmp(systemtap_jmp_buffer);
> 	return;

That sounds simple enough (assuming the availability of longjmp).


- FChE


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