amd64 efi rt: handle #BP

PR:	282860
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D47694
This commit is contained in:
Konstantin Belousov 2024-11-21 06:57:58 +02:00
parent a03957a706
commit e6ec41fa86

View File

@ -598,6 +598,18 @@ trap(struct trapframe *frame)
* FALLTHROUGH (TRCTRAP kernel mode, kernel address)
*/
case T_BPTFLT:
/*
* Most likely, EFI RT hitting INT3. This
* check prevents kdb from handling
* breakpoints set on the BIOS text, if such
* option is ever needed.
*/
if ((td->td_pflags & TDP_EFIRT) != 0 &&
curpcb->pcb_onfault != NULL) {
frame->tf_rip = (long)curpcb->pcb_onfault;
return;
}
/*
* If KDB is enabled, let it handle the debugger trap.
* Otherwise, debugger traps "can't happen".