The branch stable/14 has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5f5b47e37416df46b52e0d43b94d9c2f37d15397

commit 5f5b47e37416df46b52e0d43b94d9c2f37d15397
Author:     Konstantin Belousov <k...@freebsd.org>
AuthorDate: 2024-11-21 04:57:58 +0000
Commit:     Konstantin Belousov <k...@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".

Reply via email to