Page MenuHomeFreeBSD

hwpmc: don't validate capabilities in allocation method
ClosedPublic

Authored by mhorne on Aug 2 2021, 9:09 PM.
Tags
None
Referenced Files
F147300628: D31388.id93550.diff
Mon, Mar 9, 7:18 PM
F147219044: D31388.id93550.diff
Mon, Mar 9, 5:25 AM
Unknown Object (File)
Sat, Mar 7, 12:15 PM
Unknown Object (File)
Mon, Feb 23, 8:13 PM
Unknown Object (File)
Thu, Feb 19, 10:39 AM
Unknown Object (File)
Wed, Feb 18, 8:19 PM
Unknown Object (File)
Tue, Feb 17, 11:29 PM
Unknown Object (File)
Tue, Feb 17, 2:12 PM
Subscribers

Details

Summary

These checks were inconsistently applied across the various hwpmc
classes. The condition is already checked by the generic code in
hwpmc_mod.c, so remove them.

Test Plan

Tinderboxed.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 40999
Build 37888: arc lint + arc unit

Event Timeline

mhorne requested review of this revision.Aug 2 2021, 9:09 PM

Some existing cases returned EPERM for the != caps cases?

Some existing cases returned EPERM for the != caps cases?

Yes exactly.

Although, I just noticed the generic allocation code in hwpmc_mod.c checks the capabilities before any of these class-specific checks, so they are more or less useless. I will update this review to just remove them altogether.

The relevant line is here: https://cgit.freebsd.org/src/tree/sys/dev/hwpmc/hwpmc_mod.c#n3935

Switch to just removing the existing redundant capability checks.

mhorne retitled this revision from hwpmc: consistently validate capabilities in pcd_allocate_pmc() to hwpmc: don't validate capabilities in allocation method.Aug 11 2021, 4:43 PM
mhorne edited the summary of this revision. (Show Details)
This revision was not accepted when it landed; it landed in state Needs Review.Aug 30 2021, 7:16 PM
This revision was automatically updated to reflect the committed changes.