From nobody Fri Dec 26 03:29:51 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 97FDC405FF; Wed, 10 Jan 2024 10:09:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="W54yrdbi"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="LkG2atyT" Date: Wed, 10 Jan 2024 10:09:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1704881396; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3TIgW4R6YAM5Po2GV3pibFu2xpbNoKGCJeRWB/9sD/E=; b=W54yrdbiyvXoYWmUVGcN1faSFY4UWEe7oJBP1U1lJeeQ0IqeCOeummWASOEm+AnsZW3KGc wSpkWsJao+XQ8YrSXWIu6LwNZTzRIUaFltY61t/fXZJR96KgFNCOwge9dwE3bkh5nGBgFz NX1YWZwcnGSds3qg3kKnkogaWM87m6/k6Jwr5DsP6M2d2QtimPOv5AzTHoDGhIzAYQqzTw JairGqpiL0cu5kAE/fPAfRLhYuNr44kQHa35OdDNlkxOHdrgMw3hu36yMxMuNbsQkaPQA7 LKD/YQohK2zAVSpKLGWigHc+sD+jK2Zu2ZcvcPXQM53svR8sVSrSjpBDRy5cgg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1704881396; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3TIgW4R6YAM5Po2GV3pibFu2xpbNoKGCJeRWB/9sD/E=; b=LkG2atyTxqPl6qeJh0GBNlIBKlp03/QRh1zomBmldzdEYIFLrxVf5JBYaEj4BfZkq8ddJG 8aZx+NLspSkP+UCw== From: "tip-bot2 for Breno Leitao" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/bugs] x86/bugs: Rename CONFIG_GDS_FORCE_MITIGATION => CONFIG_MITIGATION_GDS_FORCE Cc: Josh Poimboeuf , Breno Leitao , Ingo Molnar , Linus Torvalds , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231121160740.1249350-2-leitao@debian.org> References: <20231121160740.1249350-2-leitao@debian.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170488139531.398.13211930159092959781.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/bugs branch of tip: Commit-ID: be83e809ca67bca98fde97ad6b9344237963220b Gitweb: https://git.kernel.org/tip/be83e809ca67bca98fde97ad6b9344237= 963220b Author: Breno Leitao AuthorDate: Tue, 21 Nov 2023 08:07:28 -08:00 Committer: Ingo Molnar CommitterDate: Wed, 10 Jan 2024 10:43:14 +01:00 x86/bugs: Rename CONFIG_GDS_FORCE_MITIGATION =3D> CONFIG_MITIGATION_GDS_FOR= CE So the CPU mitigations Kconfig entries - there's 10 meanwhile - are named in a historically idiosyncratic and hence rather inconsistent fashion and have become hard to relate with each other over the years: https://lore.kernel.org/lkml/20231011044252.42bplzjsam3qsasz@treble/ When they were introduced we never expected that we'd eventually have about a dozen of them, and that more organization would be useful, especially for Linux distributions that want to enable them in an informed fashion, and want to make sure all mitigations are configured as expected. For example, the current CONFIG_SPECULATION_MITIGATIONS namespace is only halfway populated, where some mitigations have entries in Kconfig, and they could be modified, while others mitigations do not have Kconfig entrie= s, and can not be controlled at build time. Fine-grained control over these Kconfig entries can help in a number of way= s: 1) Users can choose and pick only mitigations that are important for their workloads. 2) Users and developers can choose to disable mitigations that mangle the assembly code generation, making it hard to read. 3) Separate Kconfigs for just source code readability, so that we see *which* butt-ugly piece of crap code is for what reason... In most cases, if a mitigation is disabled at compilation time, it can still be enabled at runtime using kernel command line arguments. This is the first patch of an initial series that renames various mitigation related Kconfig options, unifying them under a single CONFIG_MITIGATION_* namespace: CONFIG_GDS_FORCE_MITIGATION =3D> CONFIG_MITIGATION_GDS_FORCE CONFIG_CPU_IBPB_ENTRY =3D> CONFIG_MITIGATION_IBPB_ENTRY CONFIG_CALL_DEPTH_TRACKING =3D> CONFIG_MITIGATION_CALL_DEPTH_TRACKING CONFIG_PAGE_TABLE_ISOLATION =3D> CONFIG_MITIGATION_PAGE_TABLE_ISOLATION CONFIG_RETPOLINE =3D> CONFIG_MITIGATION_RETPOLINE CONFIG_SLS =3D> CONFIG_MITIGATION_SLS CONFIG_CPU_UNRET_ENTRY =3D> CONFIG_MITIGATION_UNRET_ENTRY CONFIG_CPU_IBRS_ENTRY =3D> CONFIG_MITIGATION_IBRS_ENTRY CONFIG_CPU_SRSO =3D> CONFIG_MITIGATION_SRSO CONFIG_RETHUNK =3D> CONFIG_MITIGATION_RETHUNK Implement step 1/10 of the namespace unification of CPU mitigations related Kconfig options and rename CONFIG_GDS_FORCE_MITIGATION to CONFIG_MITIGATION_GDS_FORCE. [ mingo: Rewrote changelog for clarity. ] Suggested-by: Josh Poimboeuf Signed-off-by: Breno Leitao Signed-off-by: Ingo Molnar Acked-by: Josh Poimboeuf Cc: Linus Torvalds Link: https://lore.kernel.org/r/20231121160740.1249350-2-leitao@debian.org --- arch/x86/Kconfig | 2 +- arch/x86/kernel/cpu/bugs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 53f2e77..1dba33a 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -2587,7 +2587,7 @@ config SLS against straight line speculation. The kernel image might be slightly larger. =20 -config GDS_FORCE_MITIGATION +config MITIGATION_GDS_FORCE bool "Force GDS Mitigation" depends on CPU_SUP_INTEL default n diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index bb0ab84..3c7e27b 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -671,7 +671,7 @@ enum gds_mitigations { GDS_MITIGATION_HYPERVISOR, }; =20 -#if IS_ENABLED(CONFIG_GDS_FORCE_MITIGATION) +#if IS_ENABLED(CONFIG_MITIGATION_GDS_FORCE) static enum gds_mitigations gds_mitigation __ro_after_init =3D GDS_MITIGAT= ION_FORCE; #else static enum gds_mitigations gds_mitigation __ro_after_init =3D GDS_MITIGAT= ION_FULL;