All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] add tlbi=off to disable INVLPGB
@ 2026-07-30  0:43 Rik van Riel
  2026-07-30  1:44 ` Borislav Petkov
  0 siblings, 1 reply; 11+ messages in thread
From: Rik van Riel @ 2026-07-30  0:43 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Dave Hansen, Andy Lutomirski, Peter Zijlstra, Thomas Gleixner,
	Ingo Molnar, x86, linux-kernel, kernel-team

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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-08-06 15:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-30  0:43 [PATCH] add tlbi=off to disable INVLPGB Rik van Riel
2026-07-30  1:44 ` 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
2026-07-31 18:32             ` Borislav Petkov
2026-08-06 15:54               ` [PATCH] x86/CPU: Add a tlbi= cmdline switch 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.