mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
hwpmc: initialize arm64 counter/interrupt state
Performance counters and overflow interrupts are assumed to be disabled by default, but this is not guaranteed. Ensure we disable both during per-cpu initialization, before enabling the PMU. Otherwise, some systems (such as the Ampere eMAG) would experience an interrupt storm upon loading the hwpmc module. Reviewed by: br MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32854
This commit is contained in:
parent
477aeb3dd4
commit
b826cc3caf
1 changed files with 10 additions and 0 deletions
|
|
@ -483,6 +483,16 @@ arm64_pcpu_init(struct pmc_mdep *md, int cpu)
|
|||
pc->pc_hwpmcs[i + first_ri] = phw;
|
||||
}
|
||||
|
||||
/*
|
||||
* Disable all counters and overflow interrupts. Upon reset they are in
|
||||
* an undefined state.
|
||||
*
|
||||
* Don't issue an isb here, just wait for the one in arm64_pmcr_write()
|
||||
* to make the writes visible.
|
||||
*/
|
||||
WRITE_SPECIALREG(pmcntenclr_el0, 0xffffffff);
|
||||
WRITE_SPECIALREG(pmintenclr_el1, 0xffffffff);
|
||||
|
||||
/* Enable unit */
|
||||
pmcr = arm64_pmcr_read();
|
||||
pmcr |= PMCR_E;
|
||||
|
|
|
|||
Loading…
Reference in a new issue