hwpmc: prevent IBS fetch from getting stuck

Both fetch and op IBS sampling have the same problem where we need to
rewrite the control MSR to ensure sampling continues at the correct
rate.  I also like this because it resets the counter reducing the
chances that we collect a sample inside the NMI handler.

Reported by:	Aalok Agarwal
Reviewed by:	mhorne
Sponsored by:	Netflix
Fixes:	e51ef8ae49 ("hwpmc: Initial support for AMD IBS")
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2130
This commit is contained in:
Ali Mashtizadeh
2026-04-07 16:33:03 -07:00
committed by Mitchell Horne
parent 7a1aaca06c
commit f86ba3eec5
+2
View File
@@ -342,6 +342,8 @@ pmc_ibs_process_fetch(struct pmc *pm, struct trapframe *tf, uint64_t config)
}
pmc_process_interrupt_mp(PMC_HR, pm, tf, &mpd);
wrmsr(IBS_FETCH_CTL, pm->pm_md.pm_ibs.ibs_ctl | IBS_FETCH_CTL_ENABLE);
}
static void