From nobody Fri Oct 2 01:15:49 2026 Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18C13481FBC for ; Thu, 6 Aug 2026 15:55:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786031738; cv=none; b=ayhhN1o/5hp2M5Cq/0UXggKRWfCU4jgWq1foA5XxSJnT8Knf0ISH9Xsfoj2PxNfw9JpJzHjTdx8FfzvU4lGkTNeiY3+YMyRO+m6eq6+DeLdcjgSayAmO0X96asNdkzJGI8mzeP8SagZIW+VR4l/PpFdq2JltVZ28dH8WdkEgbu4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786031738; c=relaxed/simple; bh=HkHzhTqwYtGx5/Z1q6FgoxUTEby33L21CXb07MbH7SE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uDQKQgm7aLuho3FbY/quG3KbIV2gM6h5jLiB42RGyfUA+ZCRaNDtdcqFubxZwY9kwg4ihsGwcUsLg4imePwvC6CQUAG+3lpnFkkYc0kpsoHEq7BYtTU2QDyOhoKZxn/IhLfsnSHchgKssVwClhdVdTqC3n0+ttcaBk8ds/XHxZc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=OhJhKuks; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="OhJhKuks" Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 8119940E016E; Thu, 6 Aug 2026 15:55:22 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id jIK4CctyEayx; Thu, 6 Aug 2026 15:55:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1786031711; bh=sBIG4ge3oPjg58X/FIPTeRywPsPMoHPySAxdx/6OxiI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OhJhKuksk5O+F8X4MyVfuHv1NtnGFODeD1eiEah3aLKloAshm3FVpjH6ZGZcZU7DB p1sj9BBoq5GBaky3/NBdZ9t52DJrtbpKdk3dkkrI8KU6x2VFsaA+IkNleDEmV5QcMQ 9sPnJTNSAoYMyRSFwmiNobp/MVyaSTfW1yme+3NnyhuPHtcPP0Wgh5ALkalZwWNGj4 O1D5+xF2aKpmn+FdzqgPk5QQ4VHB++jfHB8zIUmacaqNSRivbn63cVWkldtT1F3RSC b/7YiTyZpPw97iByVoX8uq9ngx5El4v9iJDqOXV4Q1UhfyQi/nTaps5w6RC4WQDzLK 7UpbblW6TfP8GWiCi6wblfOIVdUXhqglp++R8e+2ei8dh1FD3CLCmV2HLWfDOhPRWO n48erVFEBCF8U5HPanSQ+kbM2vE0ozn3LabJns10yfU2W3is+71eTY6qq8vHN0Nw1y nVaLEN3Zk+LIc7vmTpj3owMw7afzk40N0zsj5VoMajMuacIYc2dd+I7Ji4TS5fYbI/ 7GUm7v8SYwB13JTobvsy4qFjfrpFogeOrgmHUtUe0K4ji3wJ1EuxEJQ1qr45LtxXtU NgsAhTtUlFXny2Q1fh/t3DIAkGAIRRFVm0gVj/43T0GdXymzv1LQggkeY9LaZ0dkif Qg6qzdBkps9Cr/MJil+aqM8k= Received: from stx.tnic (unknown [IPv6:2600:1700:38ca:c00::b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id E65C340E014C; Thu, 6 Aug 2026 15:55:01 +0000 (UTC) Date: Thu, 6 Aug 2026 08:54:57 -0700 From: Borislav Petkov To: Peter Zijlstra , Rik van Riel Cc: Dave Hansen , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: [PATCH] x86/CPU: Add a tlbi= cmdline switch Message-ID: <20260806155457.GBanSuUZ4XUtxA4Ie8@fat_crate.local> References: <20260729204341.3eb0b5ea@fangorn> <20260730014412.GEamqsbL46iteL25as@fat_crate.local> <20260730103227.GC751831@noisy.programming.kicks-ass.net> <20260730162318.GAamt6ds0siEVGwWlw@fat_crate.local> <20260730173104.GB776954@noisy.programming.kicks-ass.net> <20260730182439.GCamuW53V0HJHXNRqF@fat_crate.local> <20260731084656.GF776954@noisy.programming.kicks-ass.net> <20260731183248.GCamzqUC_8xp5yPZqB@fat_crate.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260731183248.GCamzqUC_8xp5yPZqB@fat_crate.local> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Ok, here's what I have. I've tagged it for stable so that it goes everywhere and we have the capability of disabling TLBI. I'm thinking of queueing it next week. Thx. Suggested-by: Borislav Petkov --- From: Rik van Riel Date: Wed, 29 Jul 2026 20:43:41 -0400 With the recently found INVLPGB / TLBSYNC issue, there has been some interest in disabling INVLPGB-based TLB flushing, in order to rule out that CPU issue as a cause of userspace crashes. Add a kernel command line option to control the TLB flushing behavior. If the need arises, we will add a "tlbi=3Dbroadcast" for the case when TLB invalidation broadcasts need to be explicitly selected, but this is not needed now yet. [ bp: Rewrite commit message, move to cpu/common.c, add documentation. ] Fixes: 767ae437a32d ("x86/mm: Add INVLPGB feature and Kconfig entry") Suggested-by: Borislav Petkov Signed-off-by: Rik van Riel Signed-off-by: Borislav Petkov (AMD) Cc: Link: https://patch.msgid.link/20260729204341.3eb0b5ea@fangorn --- Documentation/admin-guide/kernel-parameters.txt | 4 ++++ arch/x86/kernel/cpu/common.c | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentatio= n/admin-guide/kernel-parameters.txt index 87bb1fb31696..6f7a50d2af61 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -7568,6 +7568,10 @@ Kernel parameters See Documentation/admin-guide/mm/transhuge.rst for more details. =20 + tlbi=3D [X86-64] + Format: {ipi} + ipi: switch to IPI-based TLB flushing + topology=3D [S390,EARLY] Format: {off | on} Specify if the kernel should make use of the cpu diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index e84ddf6bb10d..30134d189dae 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -2675,3 +2675,13 @@ void __init arch_cpu_finalize_init(void) */ mem_encrypt_init(); } + +/* Control TLB flushing methods */ +static int __init tlbi_setup(char *str) +{ + if (!strcmp(str, "ipi")) + setup_clear_cpu_cap(X86_FEATURE_INVLPGB); + + return 1; +} +__setup("tlbi=3D", tlbi_setup); --=20 2.53.0 --=20 Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette