Bug 241988

Summary: CPU mitigation sysctls (e.g. hw.mds_disable) have wrong sense
Product: Base System Reporter: Ed Maste <emaste>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Only Me CC: vangyzen
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   

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.