[PATCH] x86/cpufeatures: make clearcpuid=invlpgb work

From: Rik van Riel

Date: Wed Jul 29 2026 - 13:23:13 EST


With the recently found INVLPGB / TLBSYNC issue, there has
been some interest in disabling invlpgb TLB flushing, in
order to rule out that issue wihle tracking down some
userspace crash.

The top search result shows "clearcpuid=invlpgb"

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

clearcpuid: unknown CPU flag: invlpgb

Adding "invlpgb" to the comment after X86_FEATURE_INVLPGB
causes mkcapflags.sh to pick up invlpgb, and add it to
x86_cap_flags.

With that change, clearcpuid=invlpgb works:

clearcpuid: force-disabling CPU feature flag: invlpgb

Signed-off-by: Rik van Riel <riel@xxxxxxxxxxx>
---
arch/x86/include/asm/cpufeatures.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
index 1b4a48bff18f..62fa2b0236af 100644
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -332,7 +332,7 @@
#define X86_FEATURE_CLZERO (13*32+ 0) /* "clzero" CLZERO instruction */
#define X86_FEATURE_IRPERF (13*32+ 1) /* "irperf" Instructions Retired Count */
#define X86_FEATURE_XSAVEERPTR (13*32+ 2) /* "xsaveerptr" Always save/restore FP error pointers */
-#define X86_FEATURE_INVLPGB (13*32+ 3) /* INVLPGB and TLBSYNC instructions supported */
+#define X86_FEATURE_INVLPGB (13*32+ 3) /* "invplgb" INVLPGB and TLBSYNC instructions supported */
#define X86_FEATURE_RDPRU (13*32+ 4) /* "rdpru" Read processor register at user level */
#define X86_FEATURE_WBNOINVD (13*32+ 9) /* "wbnoinvd" WBNOINVD instruction */
#define X86_FEATURE_AMD_IBPB (13*32+12) /* Indirect Branch Prediction Barrier */
--
2.54.0