aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2026-03-14 01:03:44 +0000
committerColin Percival <cperciva@FreeBSD.org>2026-03-28 05:52:44 +0000
commitf350063a251c9da0c5ce437eb4c44a2d716b673e (patch)
treeca1105d6544ad35d2d5dcfd36c6cda488df40ce9
parent72bb61bac72eabb2e9de16206a68cde523eb59ba (diff)
clapic_handle_intr: KASSERT isrc != NULL
If an interrupt arrives at a CPU which isn't expecting that particular vector, intr_lookup_source will return an isrc of NULL and we'll panic when intr_execute_handlers increments *isrc->is_count. Place a KASSERT a few nanoseconds earlier in order to leave some more breadcrumbs for the next person to trip over this behaviour. Tested on: EC2 r8i.96xlarge MFC after: 3 weeks Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D55851
-rw-r--r--sys/x86/x86/local_apic.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c
index 8a8fb8ef41f6..888fd266d364 100644
--- a/sys/x86/x86/local_apic.c
+++ b/sys/x86/x86/local_apic.c
@@ -1445,6 +1445,9 @@ lapic_handle_intr(int vector, struct trapframe *frame)
isrc = intr_lookup_source(apic_idt_to_irq(PCPU_GET(apic_id),
vector));
+ KASSERT(isrc != NULL,
+ ("lapic_handle_intr: vector %d unrecognized at lapic %u",
+ vector, PCPU_GET(apic_id)));
intr_execute_handlers(isrc, frame);
}