Re: [PATCH] (re-xmit): kprobes for i386

Rusty Russell
2002-08-21T04:33:43Z

In message <1029893377.24300.162.camel@ldb> you write:
>
> --=-UkzkmpwPZ3tahG697mpi
> Content-Type: text/plain
> Content-Transfer-Encoding: 7bit
>
> > > > + if (kprobe_running() && kprobe_fault_handler(regs, trapnr))
> > > > + return;
> > > > if (!(regs->xcs & 3))
> > > > goto kernel_trap;
> > > The kprobe check should be after the kernel_trap label.
> >
> > No. The entire *point* of being able to register a kprobe fault
> > handler is to be able to handle any kernel faults yourself if you want
> > to.
> It seems you have misunderstood my point.
> My idea is that since kprobes are only used for kernel mode address, we
> should move the kprobe check in the code that executes after we check
> that the fault is happening in kernel mode.

Ah, I see. That's true at the moment, but there's an (future)
extension that covers userspace traps as well, which is why it was
done this way.

Hope that clarifies,
Rusty.