The RETPOLINE_AMD feature is set by default for AMD hardware. This feature expects LFENCE to be serializing in order to perform the proper speculation control. If LFENCE cannot be determined to be serializing (for example, when running under a hypervisor that does not allow writing to the MSR that makes LFENCE serializing) the feature needs to be disabled. The kernel will then fall back to using the generic retpoline support.
The following patches are included in this series: - Add a function to clear the RETPOLINE_AMD feature and update the variable used for sysfs output. - If LFENCE can not be determined to be serializing call the new function to clear the RETPOLINE_AMD feature. This patch series is based on tip:x86/pti. --- Tom Lendacky (2): x86/retpoline: Add a function to clear the RETPOLINE_AMD feature x86/cpu/AMD: Clear RETPOLINE_AMD if LFENCE is not serializing arch/x86/include/asm/nospec-branch.h | 1 + arch/x86/kernel/cpu/amd.c | 4 ++++ arch/x86/kernel/cpu/bugs.c | 10 ++++++++++ 3 files changed, 15 insertions(+) -- Tom Lendacky