diff options
author | Kim Phillips <kim.phillips@amd.com> | 2022-02-28 11:23:15 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-03-11 10:15:11 +0100 |
commit | d3cb3a6927222268a10b2f12dfb8c9444f7cc39e (patch) | |
tree | 096630b4b61cc13042223d61b32ffeef501afac7 | |
parent | 995629e1d8e6751936c6e2b738f70b392b0461de (diff) | |
download | linux-stable-d3cb3a6927222268a10b2f12dfb8c9444f7cc39e.tar.gz linux-stable-d3cb3a6927222268a10b2f12dfb8c9444f7cc39e.tar.bz2 linux-stable-d3cb3a6927222268a10b2f12dfb8c9444f7cc39e.zip |
x86/speculation: Use generic retpoline by default on AMD
commit 244d00b5dd4755f8df892c86cab35fb2cfd4f14b upstream.
AMD retpoline may be susceptible to speculation. The speculation
execution window for an incorrect indirect branch prediction using
LFENCE/JMP sequence may potentially be large enough to allow
exploitation using Spectre V2.
By default, don't use retpoline,lfence on AMD. Instead, use the
generic retpoline.
Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | arch/x86/kernel/cpu/bugs.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index cd660aceb7c6..70ab182e30fb 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -898,14 +898,6 @@ static enum spectre_v2_mitigation __init spectre_v2_select_retpoline(void) return SPECTRE_V2_NONE; } - if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) { - if (!boot_cpu_has(X86_FEATURE_LFENCE_RDTSC)) { - pr_err("LFENCE not serializing, switching to generic retpoline\n"); - return SPECTRE_V2_RETPOLINE; - } - return SPECTRE_V2_LFENCE; - } - return SPECTRE_V2_RETPOLINE; } |