AMD Adding STIBP "Always-On Preferred Mode" To Linux
Initially during the Linux 4.20 kernel merge window with the STIBP addition for cross-hyperthread Spectre V2 mitigation it was turned on by default for all processes. But that turned out to have a sizable performance hit so the behavior was changed to only turn it on for processes under SECCOMP or when requested via the PRCTL interface. However, AMD is landing a patch that for select CPUs will have an always-on mode as evidently that's preferred for some AMD processors.
Tom Lendacky of AMD explained on the proposed patch, "Different AMD processors may have different implementations of STIBP. When STIBP is conditionally enabled, some implementations would benefit from having STIBP always on instead of toggling the STIBP bit through MSR writes. This preference is advertised through a CPUID feature bit. When conditional STIBP support is requested at boot and the CPU advertises STIBP always-on mode as preferred, switch to STIBP "on" support."
Presumably with the AMD CPUs preferring the always-on STIBP, their performance impact would be less than what we've seen on the Intel side. But the patch doesn't include any performance figures. I'll try some AMD STIBP tests soon to see if any of my hardware has this always-on preferred mode bit set.
The patch for now is just floating on the kernel mailing list but given the timing will perhaps be ready for the upcoming Linux 4.21 merge window.
Tom Lendacky of AMD explained on the proposed patch, "Different AMD processors may have different implementations of STIBP. When STIBP is conditionally enabled, some implementations would benefit from having STIBP always on instead of toggling the STIBP bit through MSR writes. This preference is advertised through a CPUID feature bit. When conditional STIBP support is requested at boot and the CPU advertises STIBP always-on mode as preferred, switch to STIBP "on" support."
Presumably with the AMD CPUs preferring the always-on STIBP, their performance impact would be less than what we've seen on the Intel side. But the patch doesn't include any performance figures. I'll try some AMD STIBP tests soon to see if any of my hardware has this always-on preferred mode bit set.
The patch for now is just floating on the kernel mailing list but given the timing will perhaps be ready for the upcoming Linux 4.21 merge window.
9 Comments