Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Mar 2026 05:56:25 +0000
From:      Colin Percival <cperciva@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: f350063a251c - main - clapic_handle_intr: KASSERT isrc != NULL
Message-ID:  <69c76d89.40098.14c72c7b@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by cperciva:

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

commit f350063a251c9da0c5ce437eb4c44a2d716b673e
Author:     Colin Percival <cperciva@FreeBSD.org>
AuthorDate: 2026-03-14 01:03:44 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2026-03-28 05:52:44 +0000

    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
---
 sys/x86/x86/local_apic.c | 3 +++
 1 file changed, 3 insertions(+)

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);
 }
 


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69c76d89.40098.14c72c7b>