Date: Thu, 28 Nov 2024 13:30:10 GMT From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 5f5b47e37416 - stable/14 - amd64 efi rt: handle #BP Message-ID: <202411281330.4ASDUALV010302@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5f5b47e37416df46b52e0d43b94d9c2f37d15397 commit 5f5b47e37416df46b52e0d43b94d9c2f37d15397 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2024-11-21 04:57:58 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2024-11-28 12:53:17 +0000 amd64 efi rt: handle #BP PR: 282860 (cherry picked from commit e6ec41fa86d88f80bd663e55455a6844619a9b24) --- sys/amd64/amd64/trap.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index f5ea035b3e3c..d7e365f6874e 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -600,6 +600,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_pflags2 & TDP2_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".
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202411281330.4ASDUALV010302>