* [PATCH] x86/cpu: Mark CPUs with BTB context tagging as not affected by VMSCAPE
@ 2026-12-03 17:21 Borislav Petkov
0 siblings, 0 replies; only message in thread
From: Borislav Petkov @ 2026-12-03 17:21 UTC (permalink / raw)
To: X86; +Cc: David Kaplan, LKML, Borislav Petkov (AMD)
From: "Borislav Petkov (AMD)" <bp@alien8.de>
CPUs like Zen6 which tag guest/host BTB contexts are not affected by
VMSCAPE - guest BTB entries are never used by host code (including
host user-space VMMs).
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
---
arch/x86/kernel/cpu/common.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 2533131621fe..a82ca23f6f19 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1617,9 +1617,12 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
/*
* Set the bug only on bare-metal. A nested hypervisor should already be
* deploying IBPB to isolate itself from nested guests.
+ *
+ * A CPU with BTB context tagging is not affected either.
*/
if (cpu_matches(cpu_vuln_blacklist, VMSCAPE) &&
- !boot_cpu_has(X86_FEATURE_HYPERVISOR))
+ !boot_cpu_has(X86_FEATURE_HYPERVISOR) &&
+ !boot_cpu_has(X86_FEATURE_BTB_CTX_ISOLATION))
setup_force_cpu_bug(X86_BUG_VMSCAPE);
if (cpu_matches(cpu_vuln_whitelist, NO_MELTDOWN))
--
2.53.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-03 17:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 17:21 [PATCH] x86/cpu: Mark CPUs with BTB context tagging as not affected by VMSCAPE Borislav Petkov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.