The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Rik van Riel <riel@surriel.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	kernel-team@meta.com
Subject: [PATCH] add tlbi=off to disable INVLPGB
Date: Wed, 29 Jul 2026 20:43:41 -0400	[thread overview]
Message-ID: <20260729204341.3eb0b5ea@fangorn> (raw)

With the recently found INVLPGB / TLBSYNC issue, there has been some
interest in disabling invlpgb TLB flushing, in order to rule out
that CPU issue as a cause of userspace crashes.

The top search result shows "clearcpuid=invlpgb"

However, invlpgb is not actually in x86_cap_flags, so booting with
clearcpuid=invlpgb results in an error message:

  clearcpuid: unknown CPU flag: invlpgb

Add a kernel commandline option to turn off AMD TLBI, to make it
easier to rule out INVLPGB as a cause of userspace crashes.

Verified by booting a Bergamo system with tlbi=off and checking
that the INVLPGB bit is clear in boot_cpu_data.x86_capability

Signed-off-by: Rik van Riel <riel@surriel.com>
Suggested-by: Borislav Petkov <bp@alien8.de>
---
 arch/x86/mm/init_64.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index d57f29ca23a5..412ad9cd5fe2 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -130,6 +130,19 @@ static int __init nonx32_setup(char *str)
 }
 __setup("noexec32=", nonx32_setup);
 
+/*
+ * tlbi=off
+ *
+ * Control AMD TLBI feature (INVLPGB TLB flushing)
+ */
+static int __init tlbi_setup(char *str)
+{
+	if (!strcmp(str, "off"))
+		setup_clear_cpu_cap(X86_FEATURE_INVLPGB);
+	return 1;
+}
+__setup("tlbi=", tlbi_setup);
+
 static void sync_global_pgds_l5(unsigned long start, unsigned long end)
 {
 	unsigned long addr;
-- 
2.53.0-Meta


             reply	other threads:[~2026-07-30  0:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30  0:43 Rik van Riel [this message]
2026-07-30  1:44 ` [PATCH] add tlbi=off to disable INVLPGB Borislav Petkov
2026-07-30 10:32   ` Peter Zijlstra
2026-07-30 16:23     ` Borislav Petkov
2026-07-30 17:31       ` Peter Zijlstra
2026-07-30 18:24         ` Borislav Petkov
2026-07-31  8:46           ` Peter Zijlstra
2026-07-31  9:14             ` David Laight
2026-07-31 11:47             ` Rik van Riel

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=20260729204341.3eb0b5ea@fangorn \
    --to=riel@surriel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox