Print this page
9685 KPTI %cr3 handling needs fixes
*** 364,381 ****
xc_call(0, 0, 0, CPUSET2BV(cpuset), (xc_func_t)kdi_cpu_deactivate);
kdi_nmemranges = 0;
}
/*
! * We receive all breakpoints and single step traps. Some of them,
! * including those from userland and those induced by DTrace providers,
! * are intended for the kernel, and must be processed there. We adopt
! * this ours-until-proven-otherwise position due to the painful
! * consequences of sending the kernel an unexpected breakpoint or
! * single step. Unless someone can prove to us that the kernel is
! * prepared to handle the trap, we'll assume there's a problem and will
! * give the user a chance to debug it.
*/
int
kdi_trap_pass(kdi_cpusave_t *cpusave)
{
greg_t tt = cpusave->krs_gregs[KDIREG_TRAPNO];
--- 364,383 ----
xc_call(0, 0, 0, CPUSET2BV(cpuset), (xc_func_t)kdi_cpu_deactivate);
kdi_nmemranges = 0;
}
/*
! * We receive all breakpoints and single step traps. Some of them, including
! * those from userland and those induced by DTrace providers, are intended for
! * the kernel, and must be processed there. We adopt this
! * ours-until-proven-otherwise position due to the painful consequences of
! * sending the kernel an unexpected breakpoint or single step. Unless someone
! * can prove to us that the kernel is prepared to handle the trap, we'll assume
! * there's a problem and will give the user a chance to debug it.
! *
! * If we return 2, then the calling code should restore the trap-time %cr3: that
! * is, it really is a kernel-originated trap.
*/
int
kdi_trap_pass(kdi_cpusave_t *cpusave)
{
greg_t tt = cpusave->krs_gregs[KDIREG_TRAPNO];
*** 388,398 ****
if (tt != T_BPTFLT && tt != T_SGLSTP)
return (0);
if (tt == T_BPTFLT && kdi_dtrace_get_state() ==
KDI_DTSTATE_DTRACE_ACTIVE)
! return (1);
/*
* See the comments in the kernel's T_SGLSTP handler for why we need to
* do this.
*/
--- 390,400 ----
if (tt != T_BPTFLT && tt != T_SGLSTP)
return (0);
if (tt == T_BPTFLT && kdi_dtrace_get_state() ==
KDI_DTSTATE_DTRACE_ACTIVE)
! return (2);
/*
* See the comments in the kernel's T_SGLSTP handler for why we need to
* do this.
*/