diff options
author | 2024-09-23 20:49:34 +0200 | |
---|---|---|
committer | 2024-10-10 10:34:29 +0200 | |
commit | 3ea87dfa31a7b0bb0ff1675e67b9e54883013074 (patch) | |
tree | 5e2d4b48d1427405de974b93921ce54fa428eb56 /arch/x86/kernel/cpu/common.c | |
parent | x86/cpufeatures: Define X86_FEATURE_AMD_IBPB_RET (diff) | |
download | wireguard-linux-3ea87dfa31a7b0bb0ff1675e67b9e54883013074.tar.xz wireguard-linux-3ea87dfa31a7b0bb0ff1675e67b9e54883013074.zip |
x86/cpufeatures: Add a IBPB_NO_RET BUG flag
Set this flag if the CPU has an IBPB implementation that does not
invalidate return target predictions. Zen generations < 4 do not flush
the RSB when executing an IBPB and this bug flag denotes that.
[ bp: Massage. ]
Signed-off-by: Johannes Wikner <kwikner@ethz.ch>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: <stable@kernel.org>
Diffstat (limited to 'arch/x86/kernel/cpu/common.c')
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 07a34d723505..f1040cb64841 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1443,6 +1443,9 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c) boot_cpu_has(X86_FEATURE_HYPERVISOR))) setup_force_cpu_bug(X86_BUG_BHI); + if (cpu_has(c, X86_FEATURE_AMD_IBPB) && !cpu_has(c, X86_FEATURE_AMD_IBPB_RET)) + setup_force_cpu_bug(X86_BUG_IBPB_NO_RET); + if (cpu_matches(cpu_vuln_whitelist, NO_MELTDOWN)) return; |