HomeFreeBSD

x86: AMD Zen2: Zenbleed chicken bit mitigation

Description

x86: AMD Zen2: Zenbleed chicken bit mitigation

Applies only to bare-metal Zen2 processors. The system currently
automatically applies it to all of them.

Tunable/sysctl 'machdep.mitigations.zenbleed.enable' can be used to
forcibly enable or disable the mitigation at boot or run-time. Possible
values are:

0: Mitigation disabled
1: Mitigation enabled
2: Run the automatic determination.

Currently, value 2 is the default and has identical effect as value 1.
This might change in the future if we choose to take into account
microcode revisions in the automatic determination process.

The tunable/sysctl value is simply ignored on non-applicable CPU models,
which is useful to apply the same configuration on a set of machines
that do not all have Zen2 processors. Trying to set it to any integer
value not listed above is silently equivalent to setting it to value 2
(automatic determination).

The current mitigation state can be queried through sysctl
'machdep.mitigations.zenbleed.state', which returns "Not applicable",
"Mitigation enabled" or "Mitigation disabled". Note that this state is
not guaranteed to be accurate in case of intervening modifications of
the corresponding chicken bit directly via cpuctl(4) (this includes the
cpucontrol(8) utility). Resetting the desired policy through
'machdep.mitigations.zenbleed.enable' (possibly to its current value)
will reset the hardware state and ensure that the reported state is
again coherent with it.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41817

Details

Provenance
olceAuthored on Sep 11 2023, 2:18 PM
emasteCommitted on Oct 2 2023, 7:29 PM
Reviewer
kib
Differential Revision
D41817: x86: AMD Zen2: Zenbleed chicken bit mitigation
Parents
rGc6cc06d465a9: lib/libc/tests/string: expand memcmp test to bcmp, timingsafe_{b,mem}cmp
Branches
Unknown
Tags
Unknown