git: 87bba0ac1178 - stable/15 - amd64 FRED: enable interrupts after user EXTINTs and NMIs

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

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

commit 87bba0ac11788cb3a7ee48dee64e01e57b6f39f7
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-10-30 13:01:15 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-11-03 09:01:20 +0000

    amd64 FRED: enable interrupts after user EXTINTs and NMIs
    
    (cherry picked from commit 91d9fbb6e1537009c35ec0c1c37ca09b28c0b31d)
---
 sys/amd64/amd64/trap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index ae5199c309e2..60a5cdd5abee 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -1635,20 +1635,20 @@ trap_fred_u(struct trapframe_fred *frame)
 	switch (type) {
 	case TF_FRED_EVINFO2_TYPE_EXTINT:
 		trap_fred_extint(frame, vec);
+		enable_intr();
 		break;
 	case TF_FRED_EVINFO2_TYPE_NMI:
 		frame->tf_idt.tf_trapno = T_NMI;
 		nmi_handle_intr(&frame->tf_idt);
 		fred_out_of_nmi();
+		enable_intr();
 #ifdef HWPMC_HOOKS
 		if ((td->td_pflags & TDP_CALLCHAIN) != 0) {
 			int (*ph)(struct thread *, int, void *);
 
 			ph = atomic_load_ptr(&pmc_hook);
-			if (ph != NULL) {
-				enable_intr();
+			if (ph != NULL)
 				ph(td, PMC_FN_USER_CALLCHAIN, &frame->tf_idt);
-			}
 		}
 #endif
 		break;