All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@kernel.org>
To: X86 <x86@kernel.org>
Cc: David Kaplan <david.kaplan@amd.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"Borislav Petkov (AMD)" <bp@alien8.de>
Subject: [PATCH] x86/cpu: Mark CPUs with BTB context tagging as not affected by VMSCAPE
Date: Thu,  3 Dec 2026 09:21:11 -0800	[thread overview]
Message-ID: <20261203172111.737288-1-bp@kernel.org> (raw)

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


                 reply	other threads:[~2026-12-03 17:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261203172111.737288-1-bp@kernel.org \
    --to=bp@kernel.org \
    --cc=bp@alien8.de \
    --cc=david.kaplan@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.