Page MenuHomeFreeBSD

hwpmc: initialize arm64 counter/interrupt state
ClosedPublic

Authored by mhorne on Nov 5 2021, 4:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 26, 10:38 AM
Unknown Object (File)
Fri, Apr 26, 10:38 AM
Unknown Object (File)
Fri, Apr 26, 10:38 AM
Unknown Object (File)
Fri, Apr 26, 10:38 AM
Unknown Object (File)
Fri, Apr 26, 10:07 AM
Unknown Object (File)
Mar 19 2024, 7:23 AM
Unknown Object (File)
Mar 4 2024, 4:46 AM
Unknown Object (File)
Feb 22 2024, 9:58 PM
Subscribers

Details

Summary

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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mhorne requested review of this revision.Nov 5 2021, 4:58 PM
sys/dev/hwpmc/hwpmc_arm64.c
490

Is this really don't use arm64_pmcr_write because it issues isb or something like that? (I was confused when I first saw this, thinking "but we don't call arm64_pmcr_write")

sys/dev/hwpmc/hwpmc_arm64.c
490

The isb will be to make the register write visible, so in this case we should mention in the comment that we rely on the arm64_pmcr_write call below to issue the isb.

sys/dev/hwpmc/hwpmc_arm64.c
490

No, it is "don't issue an isb here, as the call to arm64_pmc_write() below will do it regardless". I will clarify this in the comment.

sys/dev/hwpmc/hwpmc_arm64.c
490

Oh I see, I was looking only at the newly added lines.

Improve the comment about when we issue an isb instruction.

This revision is now accepted and ready to land.Nov 5 2021, 5:14 PM