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.
This commit is contained in:
Andrew Gallatin committed 2026-05-25 16:33:52 -04:00
1 parent 6e7c10c79d
commit b97ee5e9ce
1 file changed
+3
+3
View File
@@ -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));