Bug 241988 - CPU mitigation sysctls (e.g. hw.mds_disable) have wrong sense
Summary: CPU mitigation sysctls (e.g. hw.mds_disable) have wrong sense
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-15 19:50 UTC by Ed Maste
Modified: 2019-12-16 17:38 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2019-11-15 19:50:53 UTC
sysctls should have positive sense.

hw.mds_disable is really something like hw.mds_mitigation_enable:

% sysctl -d hw.mds_disable
hw.mds_disable: Microarchitectural Data Sampling Mitigation (0 - off, 1 - on VERW, 2 - on SW, 3 - on AUTO

it's even more confusing in light of the corresponding status sysctl:

% sysctl hw.mds_disable_state
hw.mds_disable_state: inactive
Comment 1 Ed Maste freebsd_committer freebsd_triage 2019-11-15 20:00:36 UTC
also hw.ibrs_disable and hw.spec_store_bypass_disable
Comment 2 Ed Maste freebsd_committer freebsd_triage 2019-11-15 20:18:31 UTC
In https://reviews.freebsd.org/D22374 scottl suggests:
> My suggestion is to move ssb, mds, tsx, and probably others from _hw to
> something like _hw.x86.mitigations. Then rename each with a name that's not
> enable or disable. We would still have compat OIDs, and I think that the values
> could remain the same. That's work for a future time, though.