Page MenuHomeFreeBSD

hwpmc: refuse MOD_UNLOAD while PMC owners exist
Needs ReviewPublic

Authored by afscoelho_gmail.com on Sat, Oct 10, 1:20 AM.
Tags
None
Referenced Files
F175410130: D60561.id189316.diff
Sat, Oct 10, 4:15 PM
F175409546: D60561.diff
Sat, Oct 10, 4:08 PM
F175406029: D60561.diff
Sat, Oct 10, 3:29 PM
F175379718: D60561.id.diff
Sat, Oct 10, 10:26 AM
F175357507: D60561.id189316.diff
Sat, Oct 10, 6:32 AM
F175356678: D60561.diff
Sat, Oct 10, 6:22 AM
F175343250: D60561.id189316.diff
Sat, Oct 10, 3:46 AM
F175343078: D60561.diff
Sat, Oct 10, 3:44 AM
Subscribers

Details

Reviewers
mhorne
gnn
ali_mashtizadeh.com
Group Reviewers
pmc
Summary

Unloading hwpmc while processes own PMCs frees state they still use.
Return EBUSY instead. Use a try-lock on pmc_sx, since MOD_UNLOAD runs
with kld_sx held. MOD_SHUTDOWN still always cleans up.

Test Plan

Built amd64 GENERIC + hwpmc.ko, GENERIC without HWPMC_HOOKS, and arm64.
Ran tests/sys/pmc on AMD Zen 6 (LBR v2).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77934
Build 74817: arc lint + arc unit