[PATCH] add tlbi=off to disable INVLPGB

From: Rik van Riel

Date: Wed Jul 29 2026 - 20:47:33 EST


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@xxxxxxxxxxx>
Suggested-by: Borislav Petkov <bp@xxxxxxxxx>
---
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