git: bf074ee97407 - main - amd64 FRED: fix handling of ATPIC IRQ range when no atpic is configured

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Thu, 29 Oct 2026 05:49:57 UTC
The branch main has been updated by kib:

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

commit bf074ee97407f24c200613470b3b7a24ce5a5242
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-10-29 02:05:47 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-10-29 05:48:49 +0000

    amd64 FRED: fix handling of ATPIC IRQ range when no atpic is configured
    
    Do not fall back to lapic_handle_intr().  Ignore the interrupt from the
    range same as it is done by apic_vector.S:spuriousint.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
---
 sys/amd64/amd64/trap.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index 50508352fa04..c8df3c5a55c0 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -1392,14 +1392,14 @@ trap_fred_extint(struct trapframe_fred *frame, u_int vec)
 			}
 			break;
 		}
-#ifdef DEV_ISA
-#ifdef DEV_ATPIC
 		if (vec >= IDT_IO_INTS && vec < IDT_IO_INTS + NUM_ISA_IRQS) {
+#if defined(DEV_ISA) && defined(DEV_ATPIC)
 			atpic_handle_intr(vec - IDT_IO_INTS, &frame->tf_idt);
+#else
+			/* spuriousint() */
+#endif
 			break;
 		}
-#endif
-#endif
 		/* apic ioint */
 		lapic_handle_intr(vec, &frame->tf_idt);
 		break;