> > > + 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.
Soemthing like this:
if (!(regs->xcs & 3))
goto kernel_trap;
[...]
kernel_trap:
if (kprobe_running() && kprobe_fault_handler(regs, trapnr))
return;
--=-UkzkmpwPZ3tahG697mpi
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQA9Yu0Adjkty3ft5+cRAlKhAKDeY7nJ28T4fODsp9Hd4JHMRAGyCgCgt7Fo
jxlHSUHGxFC/PPBfk0cSk7s=
=oyti
-----END PGP SIGNATURE-----
--=-UkzkmpwPZ3tahG697mpi--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/