diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -606,6 +606,16 @@ if (kdb_trap(type, dr6, frame)) return; #endif + /* + * Most likely, EFI RT hitting INT3. + */ + if ((td->td_pflags & (TDP_NOFAULTING | + TDP_RESETSPUR)) == (TDP_NOFAULTING | + TDP_RESETSPUR) && + td->td_pcb->pcb_onfault != NULL) { + frame->tf_rip = (long)curpcb->pcb_onfault; + return; + } break; case T_NMI: