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)
Wed, Nov 13, 6:07 PM
Unknown Object (File)
Tue, Nov 5, 7:37 AM
Unknown Object (File)
Wed, Oct 16, 2:05 AM
Unknown Object (File)
Oct 15 2024, 11:13 AM
Unknown Object (File)
Oct 14 2024, 4:51 AM
Unknown Object (File)
Oct 12 2024, 10:11 PM
Unknown Object (File)
Oct 12 2024, 2:51 PM
Unknown Object (File)
Oct 11 2024, 6:54 AM
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