Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 May 2026 20:35:25 +0000
From:      Andrew Gallatin <gallatin@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: b97ee5e9ce7b - main - hwpmc: Avoid panic on AMD cpus where IBS is not available
Message-ID:  <6a14b28d.1dbf1.3ad6d51a@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by gallatin:

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

commit b97ee5e9ce7b5598be596ef51872c1136b20cf88
Author:     Andrew Gallatin <gallatin@FreeBSD.org>
AuthorDate: 2026-05-25 20:33:52 +0000
Commit:     Andrew Gallatin <gallatin@FreeBSD.org>
CommitDate: 2026-05-25 20:33:52 +0000

    hwpmc: Avoid panic on AMD cpus where IBS is not available
    
    The recent IBS work intruduced a bug on older CPUs where the
    IBS handler will be called on NMIs even when IBS is not initialized.
    Work around this in the IBS handler by checking to see if ibs_pcpu
    is NULL before accessing it.
---
 sys/dev/hwpmc/hwpmc_ibs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/dev/hwpmc/hwpmc_ibs.c b/sys/dev/hwpmc/hwpmc_ibs.c
index 8cfe7b2df145..ae14f2ccb14c 100644
--- a/sys/dev/hwpmc/hwpmc_ibs.c
+++ b/sys/dev/hwpmc/hwpmc_ibs.c
@@ -510,6 +510,9 @@ pmc_ibs_intr(struct trapframe *tf)
 	int retval, cpu;
 	uint64_t config;
 
+	if (ibs_pcpu == NULL)
+		return (0);
+
 	cpu = curcpu;
 	KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
 	    ("[ibs,%d] out of range CPU %d", __LINE__, cpu));


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a14b28d.1dbf1.3ad6d51a>