git: d855bc608f20 - stable/15 - trap_fred_handle_k_exc(): handle #AC in kernel

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Tue, 03 Nov 2026 09:02:04 UTC
The branch stable/15 has been updated by kib:

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

commit d855bc608f20c2674573ab19afd215fdccd0f387
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-10-27 08:58:44 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-11-03 09:01:13 +0000

    trap_fred_handle_k_exc(): handle #AC in kernel
    
    (cherry picked from commit e86a612d77ab34ecd96cce5fd0732999ffdd7fc0)
---
 sys/amd64/amd64/trap.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index d9c078428399..9652ef6b6f22 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -1811,6 +1811,10 @@ trap_fred_handle_k_exc(struct thread *td, struct trapframe_fred *frame,
 	case IDT_MF:
 		break;
 	case IDT_AC:
+		if (curpcb->pcb_onfault != NULL) {
+			frame->tf_idt.tf_rip = (long)curpcb->pcb_onfault;
+			return;
+		}
 		break;
 	case IDT_MC:
 		mca_intr();