Page MenuHomeFreeBSD

hwpmc_amd: improve assertions in amd_pcpu_fini()
Needs ReviewPublic

Authored by mhorne on Aug 1 2023, 4:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 13, 3:54 AM
Unknown Object (File)
Mon, Oct 13, 3:54 AM
Unknown Object (File)
Sun, Oct 12, 4:07 PM
Unknown Object (File)
Thu, Oct 9, 12:59 AM
Unknown Object (File)
Thu, Oct 2, 4:32 AM
Unknown Object (File)
Tue, Sep 30, 2:25 AM
Unknown Object (File)
Aug 14 2025, 10:51 PM
Unknown Object (File)
Jun 28 2025, 7:27 AM
Subscribers

Details

Reviewers
jkoshy
gnn
Group Reviewers
pmc
Summary

We don't need to stop the counters here, as the comment already implies.
We can rely on the stop method being called for every active PMC before
finalization and assert this.

Test Plan

Unload hwpmc module with a mixed set of system and process-mode counters running.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 52936
Build 49827: arc lint + arc unit

Event Timeline

mhorne requested review of this revision.Aug 1 2023, 4:24 PM
sys/dev/hwpmc/hwpmc_amd.c
774

We might want to check the actual number of PMCs on the CPU too?

E.g. this loop assumes that AMD CPUs always have PMCs implemented at indices 0..5, but older CPUs only have 4 (per memory).

778

Add symbolic constants here for the '6', '12', and '16'?