The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] x86/cpufeatures: make clearcpuid=invlpgb work
@ 2026-07-29 17:06 Rik van Riel
  2026-07-29 18:33 ` Borislav Petkov
  0 siblings, 1 reply; 2+ messages in thread
From: Rik van Riel @ 2026-07-29 17:06 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Ingo Molnar, Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
	linux-kernel, Nikunj A Dadhania, Babu Moger, 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 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@surriel.com>
---
 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



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

* Re: [PATCH] x86/cpufeatures: make clearcpuid=invlpgb work
  2026-07-29 17:06 [PATCH] x86/cpufeatures: make clearcpuid=invlpgb work Rik van Riel
@ 2026-07-29 18:33 ` Borislav Petkov
  0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2026-07-29 18:33 UTC (permalink / raw)
  To: Rik van Riel
  Cc: Thomas Gleixner, Ingo Molnar, Dave Hansen, x86, H. Peter Anvin,
	linux-kernel, Nikunj A Dadhania, Babu Moger, kernel-team

On Wed, Jul 29, 2026 at 01:06:46PM -0400, Rik van Riel wrote:
> 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.

Yeah, except we discourage people from using clearcpuid= because that's
a hack.

Let's define a separate cmdline option now, pls, considering this is a valid
use case. And because writing it is looong and error prone and the feature
name is actually TLBI, we could do simply

tlbi=off

and everyone's happy.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

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

end of thread, other threads:[~2026-07-29 18:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-29 17:06 [PATCH] x86/cpufeatures: make clearcpuid=invlpgb work Rik van Riel
2026-07-29 18:33 ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox