lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251223110730.121239-1-lukas.bulwahn@redhat.com>
Date: Tue, 23 Dec 2025 12:07:30 +0100
From: Lukas Bulwahn <lbulwahn@...hat.com>
To: Catalin Marinas <catalin.marinas@....com>,
	Will Deacon <will@...nel.org>,
	linux-arm-kernel@...ts.infradead.org
Cc: Mark Rutland <mark.rutland@....com>,
	Arnd Bergmann <arnd@...db.de>,
	Vegard Nossum <vegard.nossum@...cle.com>,
	Kees Cook <kees@...nel.org>,
	kernel-janitors@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Lukas Bulwahn <lukas.bulwahn@...hat.com>
Subject: [PATCH] arm64: Kconfig: deprecate redundant ARM64_USE_LSE_ATOMICS

From: Lukas Bulwahn <lukas.bulwahn@...hat.com>

Currently, the config options ARM64_USE_LSE_ATOMICS and ARM64_LSE_ATOMICS
are equivalent, i.e., ARM64_LSE_ATOMICS is true if and only if
ARM64_USE_LSE_ATOMICS is true.

Prior to commit 395af861377d ("arm64: Move the LSE gas support detection to
Kconfig")---included in v5.6-rc1---only the config option ARM64_LSE_ATOMICS
was defined, and the check for gas support was done in the Makefile. This
mentioned commit then introduces the config option ARM64_USE_LSE_ATOMICS to
be the promptable option, and changes the semantics of ARM64_LSE_ATOMICS to
check for the gas support.

Note that there is then some minor refactoring in commit 2decad92f473
("arm64: mte: Ensure TIF_MTE_ASYNC_FAULT is set atomically"), putting this
gas support check into its own config option AS_HAS_LSE_ATOMICS, but the
logic remains the same. Since every binutils version defined suitable for
kernel compilation then eventually included the required support, the
config option AS_HAS_LSE_ATOMICS and the dependency was dropped with
commit 2555d4c68720 ("arm64: drop binutils version checks"). This then
makes ARM64_USE_LSE_ATOMICS and ARM64_LSE_ATOMICS equivalent. Hence, one
of the two config options can be dropped now.

Considerations for the decision which config option to drop:

  - ARM64_USE_LSE_ATOMICS is promptable by the user since its introduction
    in 2020. So there might be some Kconfig fragments that define this
    config option and expect that this then implies ARM64_LSE_ATOMICS to be
    set. However, within the kernel tree, there is no existing config file
    referring to that option. So, it is unlikely to be widely used.
  - ARM64_LSE_ATOMICS is used in nine places within the arm64 directory in
    the current kernel tree.
  - ARM64_USE_LSE_ATOMICS is the only config option that contains the infix
    string _USE_ to enable support and use of an arm64 architectural
    feature. However, there is not a very stringent and consistent naming
    convention for Kconfig options throughout the kernel tree anyway.
  - The use of the transitional attribute allows to simplify transitioning
    to a different Kconfig symbol name, but also adds some intermediate
    definition to be removed later eventually.

After thoughtful consideration, keep ARM_LSE_ATOMICS and remove
ARM64_USE_LSE_ATOMICS in a two-step approach, first deprecate
ARM64_USE_LSE_ATOMICS with the transitional attribute here and then plan
to completely remove it in two or three years with a further dedicated
commit then.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@...hat.com>
---
CC-ing Vegard and Kees to check that the use of the transitional attribute
is done as it is intended.
 
Note I have set myself a reminder in my personal calendar for three years
in the future from now to remove the transitional Kconfig definition,
assuming by then all users that maintain their Kconfig fragments with
ARM64_USE_LSE_ATOMICS included have transitioned (if such users exist at
all).

 arch/arm64/Kconfig | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 3fb4603c0e16..e113555ef6cd 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1875,11 +1875,8 @@ config ARM64_PAN
 	  instruction if the cpu does not implement the feature.
 
 config ARM64_LSE_ATOMICS
-	bool
-	default ARM64_USE_LSE_ATOMICS
-
-config ARM64_USE_LSE_ATOMICS
 	bool "Atomic instructions"
+	default ARM64_USE_LSE_ATOMICS
 	default y
 	help
 	  As part of the Large System Extensions, ARMv8.1 introduces new
@@ -1890,6 +1887,13 @@ config ARM64_USE_LSE_ATOMICS
 	  atomic routines. This incurs a small overhead on CPUs that do
 	  not support these instructions.
 
+config ARM64_USE_LSE_ATOMICS
+	bool
+	transitional
+	help
+	  Transitional config for ARM64_USE_LSE_ATOMICS to ARM64_LSE_ATOMICS
+	  migration.
+
 endmenu # "ARMv8.1 architectural features"
 
 menu "ARMv8.2 architectural features"
-- 
2.52.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ