Skip to contentSkip to conversation

Make gcc-8.1 and binutils-2.30 the minimum version

PATCH In review Arnd Bergmann 7 participants 18 messages Apr 7, 2025 – May 16, 2025

Subsystems (14)
Documentation x86 Kbuild Crypto API +10 more subsystems
lore
Share & tools
lore
#0 lore raw

cover Make gcc-8.1 and binutils-2.30 the minimum version

From: Arnd Bergmann <[email protected]>

x86 already requires gcc-8.1 since linux-6.15-rc1, which led me to actually go through all version checks and make this is the minimum for all architectures.

Most of the actual resulting changes are actually for raising the binutils version, which eliminates version checks on x86 and arm64.

Arnd Bergmann (4):
kbuild: require gcc-8 and binutils-2.30
raid6: skip avx512 checks
x86: remove checks for binutils-2.30 and earlier
arm64: drop binutils version checks

Cc "H. Peter Anvin" <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Brian Gerst <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Herbert Xu <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Masahiro Yamada <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Nicolas Schier <[email protected]>
Cc Takashi Iwai <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Uros Bizjak <[email protected]>
Cc Will Deacon <[email protected]>
 Documentation/admin-guide/README.rst          |  2 +-
 Documentation/kbuild/makefiles.rst            |  4 +-
 Documentation/process/changes.rst             |  4 +-
 .../translations/it_IT/process/changes.rst    |  4 +-
 .../translations/zh_CN/admin-guide/README.rst |  2 +-
 arch/arm64/Kconfig                            | 37 +--------------
 arch/arm64/Makefile                           | 21 +--------
 arch/arm64/include/asm/rwonce.h               |  4 --
 arch/arm64/kvm/Kconfig                        |  1 -
 arch/arm64/lib/xor-neon.c                     |  2 +-
 arch/um/Makefile                              |  4 +-
 arch/x86/Kconfig.assembler                    | 29 ------------
 arch/x86/crypto/Kconfig                       |  2 +-
 arch/x86/crypto/Makefile                      | 12 +++--
 arch/x86/crypto/aes-ctr-avx-x86_64.S          |  2 -
 arch/x86/crypto/aes-xts-avx-x86_64.S          |  2 -
 arch/x86/crypto/aesni-intel_glue.c            | 21 +--------
 arch/x86/crypto/aria-aesni-avx-asm_64.S       | 10 -----
 arch/x86/crypto/aria-aesni-avx2-asm_64.S      | 10 +----
 arch/x86/crypto/aria_aesni_avx2_glue.c        |  4 +-
 arch/x86/crypto/aria_aesni_avx_glue.c         |  4 +-
 arch/x86/crypto/blake2s-core.S                |  4 --
 arch/x86/crypto/blake2s-glue.c                |  6 +--
 arch/x86/crypto/chacha_glue.c                 |  6 +--
 arch/x86/crypto/poly1305-x86_64-cryptogams.pl |  8 ----
 arch/x86/crypto/poly1305_glue.c               |  4 +-
 arch/x86/crypto/sha1_ssse3_glue.c             | 10 -----
 arch/x86/crypto/sha256_ssse3_glue.c           | 10 -----
 include/linux/unroll.h                        |  4 +-
 kernel/gcov/gcc_4_7.c                         |  4 --
 lib/raid6/algos.c                             |  6 ---
 lib/raid6/avx512.c                            |  4 --
 lib/raid6/recov_avx512.c                      |  6 ---
 lib/raid6/test/Makefile                       |  3 --
 lib/test_fortify/Makefile                     |  5 +--
 scripts/Makefile.compiler                     |  2 +-
 scripts/gcc-plugins/gcc-common.h              | 45 -------------------
 scripts/min-tool-version.sh                   |  6 +--
 38 files changed, 36 insertions(+), 278 deletions(-)
Signature · 1 line
2.39.5
#1 lore raw

PATCH 1/4 kbuild: require gcc-8 and binutils-2.30

From: Arnd Bergmann <[email protected]>

Commit a3e8fe814ad1 ("x86/build: Raise the minimum GCC version to 8.1") raised the minimum compiler version as enforced by Kbuild to gcc-8.1 and clang-15 for x86.

This is actually the same gcc version that has been discussed as the minimum for all architectures several times in the past, with little objection. A previous concern was the kernel for SLE15-SP7 needing to be built with gcc-7. As this ended up still using linux-6.4 and there is no plan for an SP8, this is no longer a problem.

Change it for all architectures and adjust the documentation accordingly. A few version checks can be removed in the process. The binutils version 2.30 is the lowest version used in combination with gcc-8 on common distros, so use that as the corresponding minimum.

---
 Documentation/admin-guide/README.rst          |  2 +-
 Documentation/kbuild/makefiles.rst            |  4 +-
 Documentation/process/changes.rst             |  4 +-
 .../translations/it_IT/process/changes.rst    |  4 +-
 .../translations/zh_CN/admin-guide/README.rst |  2 +-
 arch/um/Makefile                              |  4 +-
 include/linux/unroll.h                        |  4 +-
 kernel/gcov/gcc_4_7.c                         |  4 --
 lib/test_fortify/Makefile                     |  5 +--
 scripts/Makefile.compiler                     |  2 +-
 scripts/gcc-plugins/gcc-common.h              | 45 -------------------
 scripts/min-tool-version.sh                   |  6 +--
 12 files changed, 14 insertions(+), 72 deletions(-)
Documentation/admin-guide/README.rst +1 -1
index 70b02f30013a..05301f03b717 100644
@@ -259,7 +259,7 @@ Configuring the kernel
 Compiling the kernel
 --------------------
 
- - Make sure you have at least gcc 5.1 available.
+ - Make sure you have at least gcc 8.1 available.
    For more information, refer to :ref:`Documentation/process/changes.rst <changes>`.
 
  - Do a ``make`` to create a compressed kernel image. It is also possible to do
Documentation/kbuild/makefiles.rst +2 -2
index 3b9a8bc671e2..38cc656fac20 100644
@@ -625,10 +625,10 @@ gcc-min-version
 
   Example::
 
-    cflags-$(call gcc-min-version, 70100) := -foo
+    cflags-$(call gcc-min-version, 110100) := -foo
 
   In this example, cflags-y will be assigned the value -foo if $(CC) is gcc and
-  $(CONFIG_GCC_VERSION) is >= 7.1.
+  $(CONFIG_GCC_VERSION) is >= 11.1.
 
 clang-min-version
   clang-min-version tests if the value of $(CONFIG_CLANG_VERSION) is greater
Documentation/process/changes.rst +2 -2
index d564362773b5..41b1431f5a6b 100644
@@ -29,13 +29,13 @@ you probably needn't concern yourself with pcmciautils.
 ====================== ===============  ========================================
         Program        Minimal version       Command to check the version
 ====================== ===============  ========================================
-GNU C                  5.1              gcc --version
+GNU C                  8.1              gcc --version
 Clang/LLVM (optional)  13.0.1           clang --version
 Rust (optional)        1.78.0           rustc --version
 bindgen (optional)     0.65.1           bindgen --version
 GNU make               4.0              make --version
 bash                   4.2              bash --version
-binutils               2.25             ld -v
+binutils               2.30             ld -v
 flex                   2.5.35           flex --version
 bison                  2.0              bison --version
 pahole                 1.16             pahole --version
Documentation/translations/it_IT/process/changes.rst +2 -2
index c7d05e2fff15..2e203fbd1785 100644
@@ -32,13 +32,13 @@ PC Card, per esempio, probabilmente non dovreste preoccuparvi di pcmciautils.
 ====================== =================  ========================================
         Programma       Versione minima       Comando per verificare la versione
 ====================== =================  ========================================
-GNU C                  5.1                gcc --version
+GNU C                  8.1                gcc --version
 Clang/LLVM (optional)  13.0.0             clang --version
 Rust (opzionale)       1.78.0             rustc --version
 bindgen (opzionale)    0.65.1             bindgen --version
 GNU make               4.0                make --version
 bash                   4.2                bash --version
-binutils               2.25               ld -v
+binutils               2.30               ld -v
 flex                   2.5.35             flex --version
 bison                  2.0                bison --version
 pahole                 1.16               pahole --version
Documentation/translations/zh_CN/admin-guide/README.rst +1 -1
index 1bdafdc4c8e2..82e628b77efd 100644
@@ -224,7 +224,7 @@ Linux内核6.x版本 <http://kernel.org/>
 编译内核
 ---------
 
- - 确保您至少有gcc 5.1可用。
+ - 确保您至少有gcc 8.1可用。
    有关更多信息,请参阅 :ref:`Documentation/process/changes.rst <changes>` 。
 
  - 执行 ``make`` 来创建压缩内核映像。如果您安装了lilo以适配内核makefile,
arch/um/Makefile +1 -3
index 1d36a613aad8..599c167890ff 100644
@@ -118,9 +118,7 @@ archprepare:
 	$(Q)$(MAKE) $(build)=$(HOST_DIR)/um include/generated/user_constants.h
 
 LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
-ifdef CONFIG_LD_SCRIPT_DYN
-LINK-$(call gcc-min-version, 60100)$(CONFIG_CC_IS_CLANG) += -no-pie
-endif
+LINK-$(CONFIG_LD_SCRIPT_DYN) += -no-pie
 LINK-$(CONFIG_LD_SCRIPT_DYN_RPATH) += -Wl,-rpath,/lib
 
 CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \
include/linux/unroll.h +1 -3
index 863fb69f6a7e..186b71de740f 100644
@@ -11,10 +11,8 @@
 
 #ifdef CONFIG_CC_IS_CLANG
 #define __pick_unrolled(x, y)		_Pragma(#x)
-#elif CONFIG_GCC_VERSION >= 80000
-#define __pick_unrolled(x, y)		_Pragma(#y)
 #else
-#define __pick_unrolled(x, y)		/* not supported */
+#define __pick_unrolled(x, y)		_Pragma(#y)
 #endif
 
 /**
kernel/gcov/gcc_4_7.c +0 -4
index fd75b4a484d7..a08cc076f332 100644
@@ -22,10 +22,6 @@
 #define GCOV_COUNTERS			9
 #elif (__GNUC__ >= 10)
 #define GCOV_COUNTERS			8
-#elif (__GNUC__ >= 7)
-#define GCOV_COUNTERS			9
-#elif (__GNUC__ > 5) || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1)
-#define GCOV_COUNTERS			10
 #else
 #define GCOV_COUNTERS			9
 #endif
lib/test_fortify/Makefile +1 -4
index 1c3f82ad8bb2..399cae880e1d 100644
@@ -18,10 +18,7 @@ quiet_cmd_gen_fortify_log = CAT     $@
 $(obj)/test_fortify.log: $(addprefix $(obj)/, $(logs)) FORCE
 	$(call if_changed,gen_fortify_log)
 
-# GCC<=7 does not always produce *.d files.
-# Run the tests only for GCC>=8 or Clang.
-always-$(call gcc-min-version, 80000) += test_fortify.log
-always-$(CONFIG_CC_IS_CLANG)          += test_fortify.log
+always-y += test_fortify.log
 
 # Some architectures define __NO_FORTIFY if __SANITIZE_ADDRESS__ is undefined.
 # Pass CFLAGS_KASAN to avoid warnings.
scripts/Makefile.compiler +1 -1
index 8956587b8547..d74fad494b5b 100644
@@ -60,7 +60,7 @@ cc-option-yn = $(if $(call cc-option,$1),y,n)
 cc-disable-warning = $(if $(call cc-option,-W$(strip $1)),-Wno-$(strip $1))
 
 # gcc-min-version
-# Usage: cflags-$(call gcc-min-version, 70100) += -foo
+# Usage: cflags-$(call gcc-min-version, 110100) += -foo
 gcc-min-version = $(call test-ge, $(CONFIG_GCC_VERSION), $1)
 
 # clang-min-version
scripts/gcc-plugins/gcc-common.h +0 -45

111 lines not on this page · raw message

scripts/min-tool-version.sh +2 -4
index 787868183b84..0d223b4a9445 100755
@@ -14,15 +14,13 @@ fi
 
 case "$1" in
 binutils)
-	echo 2.25.0
+	echo 2.30.0
 	;;
 gcc)
 	if [ "$ARCH" = parisc64 ]; then
 		echo 12.0.0
-	elif [ "$SRCARCH" = x86 ]; then
-		echo 8.1.0
 	else
-		echo 5.1.0
+		echo 8.1.0
 	fi
 	;;
 llvm)
Signature · 1 line
2.39.5
#2 lore raw

Re: [PATCH 1/4] kbuild: require gcc-8 and binutils-2.30

Quoted 10 lines · Arnd Bergmann
Documentation/process/changes.rst +1 -1
index d564362773b5..41b1431f5a6b 100644
@@ -29,13 +29,13 @@ you probably needn't concern yourself with pcmciautils.
 ====================== ===============  ========================================
         Program        Minimal version       Command to check the version
 ====================== ===============  ========================================
-GNU C                  5.1              gcc --version
+GNU C                  8.1              gcc --version

Documentation/process/changes.rst you probably needn't concern yourself with pcmciautils. · line 41

Quoted 10 lines
Documentation/process/changes.rst +1 -1
 Clang/LLVM (optional)  13.0.1           clang --version
 Rust (optional)        1.78.0           rustc --version
 bindgen (optional)     0.65.1           bindgen --version
 GNU make               4.0              make --version
 bash                   4.2              bash --version
-binutils               2.25             ld -v
+binutils               2.30             ld -v
 flex                   2.5.35           flex --version
 bison                  2.0              bison --version
 pahole                 1.16             pahole --version

Later in this file, there's another mention of the binutils version that needs to be updated. (Or maybe removed since it's redundant with the table?)

Binutils
--------

Binutils 2.25 or newer is needed to build the kernel.

#3 lore raw

Re: [PATCH 1/4] kbuild: require gcc-8 and binutils-2.30

Quoted 6 lines · Eric Biggers

On Mon, Apr 07, 2025 at 11:41:13AM +0200, Arnd Bergmann wrote:

Later in this file, there's another mention of the binutils version that needs to be updated. (Or maybe removed since it's redundant with the table?)

Binutils 2.25 or newer is needed to build the kernel.

Thanks for noticing, I've fixed both the English and Italian documentation files now.

Arnd

#4 lore raw

PATCH 2/4 raid6: skip avx512 checks

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

It is no longer necessary to check for CONFIG_AS_AVX512, since the minimum assembler version is now from binutils-2.30 and this always supports it.

---
 lib/raid6/algos.c        | 6 ------
 lib/raid6/avx512.c       | 4 ----
 lib/raid6/recov_avx512.c | 6 ------
 lib/raid6/test/Makefile  | 3 ---
 4 files changed, 19 deletions(-)
lib/raid6/algos.c +0 -6
index cd2e88ee1f14..dfd3f800ac9b 100644
@@ -28,10 +28,8 @@ EXPORT_SYMBOL_GPL(raid6_call);
 
 const struct raid6_calls * const raid6_algos[] = {
 #if defined(__i386__) && !defined(__arch_um__)
-#ifdef CONFIG_AS_AVX512
 	&raid6_avx512x2,
 	&raid6_avx512x1,
-#endif
 	&raid6_avx2x2,
 	&raid6_avx2x1,
 	&raid6_sse2x2,
@@ -42,11 +40,9 @@ const struct raid6_calls * const raid6_algos[] = {
 	&raid6_mmxx1,
 #endif
 #if defined(__x86_64__) && !defined(__arch_um__)
-#ifdef CONFIG_AS_AVX512
 	&raid6_avx512x4,
 	&raid6_avx512x2,
 	&raid6_avx512x1,
-#endif
 	&raid6_avx2x4,
 	&raid6_avx2x2,
 	&raid6_avx2x1,
@@ -96,9 +92,7 @@ EXPORT_SYMBOL_GPL(raid6_datap_recov);
 
 const struct raid6_recov_calls *const raid6_recov_algos[] = {
 #ifdef CONFIG_X86
-#ifdef CONFIG_AS_AVX512
 	&raid6_recov_avx512,
-#endif
 	&raid6_recov_avx2,
 	&raid6_recov_ssse3,
 #endif
lib/raid6/avx512.c +0 -4
index 9c3e822e1adf..009bd0adeebf 100644
@@ -17,8 +17,6 @@
  *
  */
 
-#ifdef CONFIG_AS_AVX512
-
 #include <linux/raid/pq.h>
 #include "x86.h"
 
@@ -560,5 +558,3 @@ const struct raid6_calls raid6_avx512x4 = {
 	.priority = 2		/* Prefer AVX512 over priority 1 (SSE2 and others) */
 };
 #endif
-
-#endif /* CONFIG_AS_AVX512 */
lib/raid6/recov_avx512.c +0 -6
index fd9e15bf3f30..310c715db313 100644
@@ -6,8 +6,6 @@
  * Author: Megha Dey <[email protected]>
  */
 
-#ifdef CONFIG_AS_AVX512
-
 #include <linux/raid/pq.h>
 #include "x86.h"
 
@@ -377,7 +375,3 @@ const struct raid6_recov_calls raid6_recov_avx512 = {
 #endif
 	.priority = 3,
 };
-
-#else
-#warning "your version of binutils lacks AVX512 support"
-#endif
lib/raid6/test/Makefile +0 -3
index 2abe0076a636..8f2dd2210ba8 100644
@@ -54,9 +54,6 @@ endif
 ifeq ($(IS_X86),yes)
         OBJS   += mmx.o sse1.o sse2.o avx2.o recov_ssse3.o recov_avx2.o avx512.o recov_avx512.o
         CFLAGS += -DCONFIG_X86
-        CFLAGS += $(shell echo "vpmovm2b %k1, %zmm5" |          \
-                    gcc -c -x assembler - >/dev/null 2>&1 &&    \
-                    rm ./-.o && echo -DCONFIG_AS_AVX512=1)
 else ifeq ($(HAS_NEON),yes)
         OBJS   += neon.o neon1.o neon2.o neon4.o neon8.o recov_neon.o recov_neon_inner.o
         CFLAGS += -DCONFIG_KERNEL_MODE_NEON=1
Signature · 1 line
2.39.5
#5 lore raw

PATCH 3/4 x86: remove checks for binutils-2.30 and earlier

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Linux now requires binutils-2.30, so a lot of the compile time checks are unnecessary and can be removed.

Building with earlier assembler versions now causes a build failure on the crypto drivers.

---
 arch/x86/Kconfig.assembler                    | 29 -------------------
 arch/x86/crypto/Kconfig                       |  2 +-
 arch/x86/crypto/Makefile                      | 12 ++++----
 arch/x86/crypto/aes-ctr-avx-x86_64.S          |  2 --
 arch/x86/crypto/aes-xts-avx-x86_64.S          |  2 --
 arch/x86/crypto/aesni-intel_glue.c            | 21 ++------------
 arch/x86/crypto/aria-aesni-avx-asm_64.S       | 10 -------
 arch/x86/crypto/aria-aesni-avx2-asm_64.S      | 10 +------
 arch/x86/crypto/aria_aesni_avx2_glue.c        |  4 +--
 arch/x86/crypto/aria_aesni_avx_glue.c         |  4 +--
 arch/x86/crypto/blake2s-core.S                |  4 ---
 arch/x86/crypto/blake2s-glue.c                |  6 ++--
 arch/x86/crypto/chacha_glue.c                 |  6 ++--
 arch/x86/crypto/poly1305-x86_64-cryptogams.pl |  8 -----
 arch/x86/crypto/poly1305_glue.c               |  4 +--
 arch/x86/crypto/sha1_ssse3_glue.c             | 10 -------
 arch/x86/crypto/sha256_ssse3_glue.c           | 10 -------
 17 files changed, 17 insertions(+), 127 deletions(-)
arch/x86/Kconfig.assembler +0 -29
index 6d20a6ce0507..977a08b3746d 100644
@@ -1,40 +1,11 @@
 # SPDX-License-Identifier: GPL-2.0
 # Copyright (C) 2020 Jason A. Donenfeld <[email protected]>. All Rights Reserved.
 
-config AS_AVX512
-	def_bool $(as-instr,vpmovm2b %k1$(comma)%zmm5)
-	help
-	  Supported by binutils >= 2.25 and LLVM integrated assembler
-
-config AS_SHA1_NI
-	def_bool $(as-instr,sha1msg1 %xmm0$(comma)%xmm1)
-	help
-	  Supported by binutils >= 2.24 and LLVM integrated assembler
-
-config AS_SHA256_NI
-	def_bool $(as-instr,sha256msg1 %xmm0$(comma)%xmm1)
-	help
-	  Supported by binutils >= 2.24 and LLVM integrated assembler
 config AS_TPAUSE
 	def_bool $(as-instr,tpause %ecx)
 	help
 	  Supported by binutils >= 2.31.1 and LLVM integrated assembler >= V7
 
-config AS_GFNI
-	def_bool $(as-instr,vgf2p8mulb %xmm0$(comma)%xmm1$(comma)%xmm2)
-	help
-	  Supported by binutils >= 2.30 and LLVM integrated assembler
-
-config AS_VAES
-	def_bool $(as-instr,vaesenc %ymm0$(comma)%ymm1$(comma)%ymm2)
-	help
-	  Supported by binutils >= 2.30 and LLVM integrated assembler
-
-config AS_VPCLMULQDQ
-	def_bool $(as-instr,vpclmulqdq \$0x10$(comma)%ymm0$(comma)%ymm1$(comma)%ymm2)
-	help
-	  Supported by binutils >= 2.30 and LLVM integrated assembler
-
 config AS_WRUSS
 	def_bool $(as-instr64,wrussq %rax$(comma)(%rbx))
 	help
arch/x86/crypto/Kconfig +1 -1
index 3d948f10c94c..91954bd3d441 100644
@@ -332,7 +332,7 @@ config CRYPTO_ARIA_AESNI_AVX2_X86_64
 
 config CRYPTO_ARIA_GFNI_AVX512_X86_64
 	tristate "Ciphers: ARIA with modes: ECB, CTR (AVX512/GFNI)"
-	depends on X86 && 64BIT && AS_AVX512 && AS_GFNI
+	depends on X86 && 64BIT
 	select CRYPTO_SKCIPHER
 	select CRYPTO_SIMD
 	select CRYPTO_ALGAPI
arch/x86/crypto/Makefile +5 -7
index 5d19f41bde58..f9234af53353 100644
@@ -44,24 +44,22 @@ aegis128-aesni-y := aegis128-aesni-asm.o aegis128-aesni-glue.o
 
 obj-$(CONFIG_CRYPTO_CHACHA20_X86_64) += chacha-x86_64.o
 chacha-x86_64-y := chacha-avx2-x86_64.o chacha-ssse3-x86_64.o chacha_glue.o
-chacha-x86_64-$(CONFIG_AS_AVX512) += chacha-avx512vl-x86_64.o
+chacha-x86_64-y += chacha-avx512vl-x86_64.o
 
 obj-$(CONFIG_CRYPTO_AES_NI_INTEL) += aesni-intel.o
 aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o
 aesni-intel-$(CONFIG_64BIT) += aes-ctr-avx-x86_64.o \
 			       aes-gcm-aesni-x86_64.o \
 			       aes-xts-avx-x86_64.o
-ifeq ($(CONFIG_AS_VAES)$(CONFIG_AS_VPCLMULQDQ),yy)
 aesni-intel-$(CONFIG_64BIT) += aes-gcm-avx10-x86_64.o
-endif
 
 obj-$(CONFIG_CRYPTO_SHA1_SSSE3) += sha1-ssse3.o
-sha1-ssse3-y := sha1_avx2_x86_64_asm.o sha1_ssse3_asm.o sha1_ssse3_glue.o
-sha1-ssse3-$(CONFIG_AS_SHA1_NI) += sha1_ni_asm.o
+sha1-ssse3-y := sha1_avx2_x86_64_asm.o sha1_ssse3_asm.o sha1_ssse3_glue.o \
+		sha1_ni_asm.o
 
 obj-$(CONFIG_CRYPTO_SHA256_SSSE3) += sha256-ssse3.o
-sha256-ssse3-y := sha256-ssse3-asm.o sha256-avx-asm.o sha256-avx2-asm.o sha256_ssse3_glue.o
-sha256-ssse3-$(CONFIG_AS_SHA256_NI) += sha256_ni_asm.o
+sha256-ssse3-y := sha256-ssse3-asm.o sha256-avx-asm.o sha256-avx2-asm.o \
+		  sha256_ssse3_glue.o sha256_ni_asm.o
 
 obj-$(CONFIG_CRYPTO_SHA512_SSSE3) += sha512-ssse3.o
 sha512-ssse3-y := sha512-ssse3-asm.o sha512-avx-asm.o sha512-avx2-asm.o sha512_ssse3_glue.o
arch/x86/crypto/aes-ctr-avx-x86_64.S +0 -2
index 1685d8b24b2c..c7189f3f3669 100644
@@ -562,7 +562,6 @@ SYM_TYPED_FUNC_START(aes_xctr_crypt_aesni_avx)
 	_aes_ctr_crypt	1
 SYM_FUNC_END(aes_xctr_crypt_aesni_avx)
 
-#if defined(CONFIG_AS_VAES) && defined(CONFIG_AS_VPCLMULQDQ)
 .set	VL, 32
 .set	USE_AVX10, 0
 SYM_TYPED_FUNC_START(aes_ctr64_crypt_vaes_avx2)
@@ -589,4 +588,3 @@ SYM_FUNC_END(aes_ctr64_crypt_vaes_avx10_512)
 SYM_TYPED_FUNC_START(aes_xctr_crypt_vaes_avx10_512)
 	_aes_ctr_crypt	1
 SYM_FUNC_END(aes_xctr_crypt_vaes_avx10_512)
-#endif // CONFIG_AS_VAES && CONFIG_AS_VPCLMULQDQ
arch/x86/crypto/aes-xts-avx-x86_64.S +0 -2
index 93ba0ddbe009..617c17e69b9f 100644
@@ -861,7 +861,6 @@ SYM_TYPED_FUNC_START(aes_xts_decrypt_aesni_avx)
 	_aes_xts_crypt	0
 SYM_FUNC_END(aes_xts_decrypt_aesni_avx)
 
-#if defined(CONFIG_AS_VAES) && defined(CONFIG_AS_VPCLMULQDQ)
 .set	VL, 32
 .set	USE_AVX10, 0
 SYM_TYPED_FUNC_START(aes_xts_encrypt_vaes_avx2)
@@ -888,4 +887,3 @@ SYM_FUNC_END(aes_xts_encrypt_vaes_avx10_512)
 SYM_TYPED_FUNC_START(aes_xts_decrypt_vaes_avx10_512)
 	_aes_xts_crypt	0
 SYM_FUNC_END(aes_xts_decrypt_vaes_avx10_512)
-#endif /* CONFIG_AS_VAES && CONFIG_AS_VPCLMULQDQ */
arch/x86/crypto/aesni-intel_glue.c +2 -19
index bc655d794a95..684fbfb12345 100644
@@ -842,11 +842,9 @@ static struct simd_skcipher_alg *					       \
 simd_skcipher_algs_##suffix[ARRAY_SIZE(skcipher_algs_##suffix)]
 
 DEFINE_AVX_SKCIPHER_ALGS(aesni_avx, "aesni-avx", 500);
-#if defined(CONFIG_AS_VAES) && defined(CONFIG_AS_VPCLMULQDQ)
 DEFINE_AVX_SKCIPHER_ALGS(vaes_avx2, "vaes-avx2", 600);
 DEFINE_AVX_SKCIPHER_ALGS(vaes_avx10_256, "vaes-avx10_256", 700);
 DEFINE_AVX_SKCIPHER_ALGS(vaes_avx10_512, "vaes-avx10_512", 800);
-#endif
 
 /* The common part of the x86_64 AES-GCM key struct */
 struct aes_gcm_key {
@@ -927,17 +925,8 @@ struct aes_gcm_key_avx10 {
 #define FLAG_RFC4106	BIT(0)
 #define FLAG_ENC	BIT(1)
 #define FLAG_AVX	BIT(2)
-#if defined(CONFIG_AS_VAES) && defined(CONFIG_AS_VPCLMULQDQ)
-#  define FLAG_AVX10_256	BIT(3)
-#  define FLAG_AVX10_512	BIT(4)
-#else
-   /*
-    * This should cause all calls to the AVX10 assembly functions to be
-    * optimized out, avoiding the need to ifdef each call individually.
-    */
-#  define FLAG_AVX10_256	0
-#  define FLAG_AVX10_512	0
-#endif
+#define FLAG_AVX10_256	BIT(3)
+#define FLAG_AVX10_512	BIT(4)
 
 static inline struct aes_gcm_key *
 aes_gcm_key_get(struct crypto_aead *tfm, int flags)
@@ -1538,7 +1527,6 @@ DEFINE_GCM_ALGS(aesni_avx, FLAG_AVX,
 		"generic-gcm-aesni-avx", "rfc4106-gcm-aesni-avx",
 		AES_GCM_KEY_AESNI_SIZE, 500);
 
-#if defined(CONFIG_AS_VAES) && defined(CONFIG_AS_VPCLMULQDQ)
 /* aes_gcm_algs_vaes_avx10_256 */
 DEFINE_GCM_ALGS(vaes_avx10_256, FLAG_AVX10_256,
 		"generic-gcm-vaes-avx10_256", "rfc4106-gcm-vaes-avx10_256",
@@ -1548,7 +1536,6 @@ DEFINE_GCM_ALGS(vaes_avx10_256, FLAG_AVX10_256,
 DEFINE_GCM_ALGS(vaes_avx10_512, FLAG_AVX10_512,
 		"generic-gcm-vaes-avx10_512", "rfc4106-gcm-vaes-avx10_512",
 		AES_GCM_KEY_AVX10_SIZE, 800);
-#endif /* CONFIG_AS_VAES && CONFIG_AS_VPCLMULQDQ */
 
 static int __init register_avx_algs(void)
 {
@@ -1572,7 +1559,6 @@ static int __init register_avx_algs(void)
 	 * Similarly, the assembler support was added at about the same time.
 	 * For simplicity, just always check for VAES and VPCLMULQDQ together.
 	 */
-#if defined(CONFIG_AS_VAES) && defined(CONFIG_AS_VPCLMULQDQ)
 	if (!boot_cpu_has(X86_FEATURE_AVX2) ||
 	    !boot_cpu_has(X86_FEATURE_VAES) ||
 	    !boot_cpu_has(X86_FEATURE_VPCLMULQDQ) ||
@@ -1622,7 +1608,6 @@ static int __init register_avx_algs(void)
 					 aes_gcm_simdalgs_vaes_avx10_512);
 	if (err)
 		return err;
-#endif /* CONFIG_AS_VAES && CONFIG_AS_VPCLMULQDQ */
 	return 0;
 }
 
@@ -1636,7 +1621,6 @@ static void unregister_avx_algs(void)
 		simd_unregister_aeads(aes_gcm_algs_aesni_avx,
 				      ARRAY_SIZE(aes_gcm_algs_aesni_avx),
 				      aes_gcm_simdalgs_aesni_avx);
-#if defined(CONFIG_AS_VAES) && defined(CONFIG_AS_VPCLMULQDQ)
 	if (simd_skcipher_algs_vaes_avx2[0])
 		simd_unregister_skciphers(skcipher_algs_vaes_avx2,
 					  ARRAY_SIZE(skcipher_algs_vaes_avx2),
@@ -1657,7 +1641,6 @@ static void unregister_avx_algs(void)
 		simd_unregister_aeads(aes_gcm_algs_vaes_avx10_512,
 				      ARRAY_SIZE(aes_gcm_algs_vaes_avx10_512),
 				      aes_gcm_simdalgs_vaes_avx10_512);
-#endif
 }
 #else /* CONFIG_X86_64 */
 static struct aead_alg aes_gcm_algs_aesni[0];
arch/x86/crypto/aria-aesni-avx-asm_64.S +0 -10
index 9556dacd9841..932fb17308e7 100644
@@ -295,7 +295,6 @@
 	vpshufb t1, t0, t2;				\
 	vpxor t2, x7, x7;
 
-#ifdef CONFIG_AS_GFNI
 #define aria_sbox_8way_gfni(x0, x1, x2, x3,		\
 			    x4, x5, x6, x7,		\
 			    t0, t1, t2, t3,		\
@@ -318,8 +317,6 @@
 	vgf2p8affineinvqb $0, t2, x3, x3;		\
 	vgf2p8affineinvqb $0, t2, x7, x7
 
-#endif /* CONFIG_AS_GFNI */
-
 #define aria_sbox_8way(x0, x1, x2, x3,            	\
 		       x4, x5, x6, x7,			\
 		       t0, t1, t2, t3,			\
@@ -561,7 +558,6 @@
 			     y4, y5, y6, y7,		\
 			     mem_tmp, 8);
 
-#ifdef CONFIG_AS_GFNI
 #define aria_fe_gfni(x0, x1, x2, x3,			\
 		     x4, x5, x6, x7,			\
 		     y0, y1, y2, y3,			\
@@ -719,8 +715,6 @@
 			     y4, y5, y6, y7,		\
 			     mem_tmp, 8);
 
-#endif /* CONFIG_AS_GFNI */
-
 /* NB: section is mergeable, all elements must be aligned 16-byte blocks */
 .section	.rodata.cst16, "aM", @progbits, 16
 .align 16
@@ -772,7 +766,6 @@
 .Ltf_hi__x2__and__fwd_aff:
 	.octa 0x3F893781E95FE1576CDA64D2BA0CB204
 
-#ifdef CONFIG_AS_GFNI
 /* AES affine: */
 #define tf_aff_const BV8(1, 1, 0, 0, 0, 1, 1, 0)
 .Ltf_aff_bitmatrix:
@@ -871,7 +864,6 @@
 		    BV8(0, 0, 0, 0, 0, 1, 0, 0),
 		    BV8(0, 0, 0, 0, 0, 0, 1, 0),
 		    BV8(0, 0, 0, 0, 0, 0, 0, 1))
-#endif /* CONFIG_AS_GFNI */
 
 /* 4-bit mask */
 .section	.rodata.cst4.L0f0f0f0f, "aM", @progbits, 4
@@ -1140,7 +1132,6 @@ SYM_TYPED_FUNC_START(aria_aesni_avx_ctr_crypt_16way)
 	RET;
 SYM_FUNC_END(aria_aesni_avx_ctr_crypt_16way)
 
-#ifdef CONFIG_AS_GFNI
 SYM_FUNC_START_LOCAL(__aria_aesni_avx_gfni_crypt_16way)
 	/* input:
 	*      %r9: rk
@@ -1359,4 +1350,3 @@ SYM_TYPED_FUNC_START(aria_aesni_avx_gfni_ctr_crypt_16way)
 	FRAME_END
 	RET;
 SYM_FUNC_END(aria_aesni_avx_gfni_ctr_crypt_16way)
-#endif /* CONFIG_AS_GFNI */
arch/x86/crypto/aria-aesni-avx2-asm_64.S +1 -9
index c60fa2980630..ed53d4f46bd7 100644
@@ -302,7 +302,6 @@
 	vpbroadcastb ((round * 16) + idx + 4)(rk), t0;	\
 	vpxor t0, x7, x7;
 
-#ifdef CONFIG_AS_GFNI
 #define aria_sbox_8way_gfni(x0, x1, x2, x3,		\
 			    x4, x5, x6, x7,		\
 			    t0, t1, t2, t3,		\
@@ -325,7 +324,6 @@
 	vgf2p8affineinvqb $0, t2, x3, x3;		\
 	vgf2p8affineinvqb $0, t2, x7, x7
 
-#endif /* CONFIG_AS_GFNI */
 #define aria_sbox_8way(x0, x1, x2, x3,			\
 		       x4, x5, x6, x7,			\
 		       t0, t1, t2, t3,			\
@@ -598,7 +596,7 @@
 	aria_load_state_8way(y0, y1, y2, y3,		\
 			     y4, y5, y6, y7,		\
 			     mem_tmp, 8);
-#ifdef CONFIG_AS_GFNI
+
 #define aria_fe_gfni(x0, x1, x2, x3,			\
 		     x4, x5, x6, x7,			\
 		     y0, y1, y2, y3,			\
@@ -752,7 +750,6 @@
 	aria_load_state_8way(y0, y1, y2, y3,		\
 			     y4, y5, y6, y7,		\
 			     mem_tmp, 8);
-#endif /* CONFIG_AS_GFNI */
 
 .section        .rodata.cst32.shufb_16x16b, "aM", @progbits, 32
 .align 32
@@ -806,7 +803,6 @@
 .Ltf_hi__x2__and__fwd_aff:
 	.octa 0x3F893781E95FE1576CDA64D2BA0CB204
 
-#ifdef CONFIG_AS_GFNI
 .section	.rodata.cst8, "aM", @progbits, 8
 .align 8
 /* AES affine: */
@@ -868,8 +864,6 @@
 		    BV8(0, 0, 0, 0, 0, 0, 1, 0),
 		    BV8(0, 0, 0, 0, 0, 0, 0, 1))
 
-#endif /* CONFIG_AS_GFNI */
-
 /* 4-bit mask */
 .section	.rodata.cst4.L0f0f0f0f, "aM", @progbits, 4
 .align 4
@@ -1219,7 +1213,6 @@ SYM_TYPED_FUNC_START(aria_aesni_avx2_ctr_crypt_32way)
 	RET;
 SYM_FUNC_END(aria_aesni_avx2_ctr_crypt_32way)
 
-#ifdef CONFIG_AS_GFNI
 SYM_FUNC_START_LOCAL(__aria_aesni_avx2_gfni_crypt_32way)
 	/* input:
 	 *      %r9: rk
@@ -1438,4 +1431,3 @@ SYM_TYPED_FUNC_START(aria_aesni_avx2_gfni_ctr_crypt_32way)
 	FRAME_END
 	RET;
 SYM_FUNC_END(aria_aesni_avx2_gfni_ctr_crypt_32way)
-#endif /* CONFIG_AS_GFNI */
arch/x86/crypto/aria_aesni_avx2_glue.c +1 -3
index 87a11804fc77..95fccc6dc420 100644
@@ -26,7 +26,6 @@ asmlinkage void aria_aesni_avx2_ctr_crypt_32way(const void *ctx, u8 *dst,
 						const u8 *src,
 						u8 *keystream, u8 *iv);
 EXPORT_SYMBOL_GPL(aria_aesni_avx2_ctr_crypt_32way);
-#ifdef CONFIG_AS_GFNI
 asmlinkage void aria_aesni_avx2_gfni_encrypt_32way(const void *ctx, u8 *dst,
 						   const u8 *src);
 EXPORT_SYMBOL_GPL(aria_aesni_avx2_gfni_encrypt_32way);
@@ -37,7 +36,6 @@ asmlinkage void aria_aesni_avx2_gfni_ctr_crypt_32way(const void *ctx, u8 *dst,
 						     const u8 *src,
 						     u8 *keystream, u8 *iv);
 EXPORT_SYMBOL_GPL(aria_aesni_avx2_gfni_ctr_crypt_32way);
-#endif /* CONFIG_AS_GFNI */
 
 static struct aria_avx_ops aria_ops;
 
@@ -217,7 +215,7 @@ static int __init aria_avx2_init(void)
 		return -ENODEV;
 	}
 
-	if (boot_cpu_has(X86_FEATURE_GFNI) && IS_ENABLED(CONFIG_AS_GFNI)) {
+	if (boot_cpu_has(X86_FEATURE_GFNI)) {
 		aria_ops.aria_encrypt_16way = aria_aesni_avx_gfni_encrypt_16way;
 		aria_ops.aria_decrypt_16way = aria_aesni_avx_gfni_decrypt_16way;
 		aria_ops.aria_ctr_crypt_16way = aria_aesni_avx_gfni_ctr_crypt_16way;
arch/x86/crypto/aria_aesni_avx_glue.c +1 -3
index 4e1516b76669..487094d64863 100644
@@ -26,7 +26,6 @@ asmlinkage void aria_aesni_avx_ctr_crypt_16way(const void *ctx, u8 *dst,
 					       const u8 *src,
 					       u8 *keystream, u8 *iv);
 EXPORT_SYMBOL_GPL(aria_aesni_avx_ctr_crypt_16way);
-#ifdef CONFIG_AS_GFNI
 asmlinkage void aria_aesni_avx_gfni_encrypt_16way(const void *ctx, u8 *dst,
 						  const u8 *src);
 EXPORT_SYMBOL_GPL(aria_aesni_avx_gfni_encrypt_16way);
@@ -37,7 +36,6 @@ asmlinkage void aria_aesni_avx_gfni_ctr_crypt_16way(const void *ctx, u8 *dst,
 						    const u8 *src,
 						    u8 *keystream, u8 *iv);
 EXPORT_SYMBOL_GPL(aria_aesni_avx_gfni_ctr_crypt_16way);
-#endif /* CONFIG_AS_GFNI */
 
 static struct aria_avx_ops aria_ops;
 
@@ -203,7 +201,7 @@ static int __init aria_avx_init(void)
 		return -ENODEV;
 	}
 
-	if (boot_cpu_has(X86_FEATURE_GFNI) && IS_ENABLED(CONFIG_AS_GFNI)) {
+	if (boot_cpu_has(X86_FEATURE_GFNI)) {
 		aria_ops.aria_encrypt_16way = aria_aesni_avx_gfni_encrypt_16way;
 		aria_ops.aria_decrypt_16way = aria_aesni_avx_gfni_decrypt_16way;
 		aria_ops.aria_ctr_crypt_16way = aria_aesni_avx_gfni_ctr_crypt_16way;
arch/x86/crypto/blake2s-core.S +0 -4
index b50b35ff1fdb..ac1c845445a4 100644
@@ -29,7 +29,6 @@ SIGMA:
 .byte 13,  7, 12,  3, 11, 14,  1,  9,  2,  5, 15,  8, 10,  0,  4,  6
 .byte  6, 14, 11,  0, 15,  9,  3,  8, 10, 12, 13,  1,  5,  2,  7,  4
 .byte 10,  8,  7,  1,  2,  4,  6,  5, 13, 15,  9,  3,  0, 11, 14, 12
-#ifdef CONFIG_AS_AVX512
 .section .rodata.cst64.BLAKE2S_SIGMA2, "aM", @progbits, 640
 .align 64
 SIGMA2:
@@ -43,7 +42,6 @@ SIGMA2:
 .long  6, 13,  0, 14, 12,  2,  1, 11, 15,  4,  5,  8,  7,  9,  3, 10
 .long 15,  5,  4, 13, 10,  7,  3, 11, 12,  2,  0,  6,  9,  8,  1, 14
 .long  8,  7, 14, 11, 13, 15,  0, 12, 10,  4,  5,  6,  3,  2,  1,  9
-#endif /* CONFIG_AS_AVX512 */
 
 .text
 SYM_FUNC_START(blake2s_compress_ssse3)
@@ -174,7 +172,6 @@ SYM_FUNC_START(blake2s_compress_ssse3)
 	RET
 SYM_FUNC_END(blake2s_compress_ssse3)
 
-#ifdef CONFIG_AS_AVX512
 SYM_FUNC_START(blake2s_compress_avx512)
 	vmovdqu		(%rdi),%xmm0
 	vmovdqu		0x10(%rdi),%xmm1
@@ -253,4 +250,3 @@ SYM_FUNC_START(blake2s_compress_avx512)
 	vzeroupper
 	RET
 SYM_FUNC_END(blake2s_compress_avx512)
-#endif /* CONFIG_AS_AVX512 */
arch/x86/crypto/blake2s-glue.c +2 -4
index 0313f9673f56..00f84f29cc8c 100644
@@ -41,8 +41,7 @@ void blake2s_compress(struct blake2s_state *state, const u8 *block,
 					    SZ_4K / BLAKE2S_BLOCK_SIZE);
 
 		kernel_fpu_begin();
-		if (IS_ENABLED(CONFIG_AS_AVX512) &&
-		    static_branch_likely(&blake2s_use_avx512))
+		if (static_branch_likely(&blake2s_use_avx512))
 			blake2s_compress_avx512(state, block, blocks, inc);
 		else
 			blake2s_compress_ssse3(state, block, blocks, inc);
@@ -59,8 +58,7 @@ static int __init blake2s_mod_init(void)
 	if (boot_cpu_has(X86_FEATURE_SSSE3))
 		static_branch_enable(&blake2s_use_ssse3);
 
-	if (IS_ENABLED(CONFIG_AS_AVX512) &&
-	    boot_cpu_has(X86_FEATURE_AVX) &&
+	if (boot_cpu_has(X86_FEATURE_AVX) &&
 	    boot_cpu_has(X86_FEATURE_AVX2) &&
 	    boot_cpu_has(X86_FEATURE_AVX512F) &&
 	    boot_cpu_has(X86_FEATURE_AVX512VL) &&
arch/x86/crypto/chacha_glue.c +2 -4
index 8bb74a272879..ce12ad807af1 100644
@@ -48,8 +48,7 @@ static unsigned int chacha_advance(unsigned int len, unsigned int maxblocks)
 static void chacha_dosimd(u32 *state, u8 *dst, const u8 *src,
 			  unsigned int bytes, int nrounds)
 {
-	if (IS_ENABLED(CONFIG_AS_AVX512) &&
-	    static_branch_likely(&chacha_use_avx512vl)) {
+	if (static_branch_likely(&chacha_use_avx512vl)) {
 		while (bytes >= CHACHA_BLOCK_SIZE * 8) {
 			chacha_8block_xor_avx512vl(state, dst, src, bytes,
 						   nrounds);
@@ -282,8 +281,7 @@ static int __init chacha_simd_mod_init(void)
 	    cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL)) {
 		static_branch_enable(&chacha_use_avx2);
 
-		if (IS_ENABLED(CONFIG_AS_AVX512) &&
-		    boot_cpu_has(X86_FEATURE_AVX512VL) &&
+		if (boot_cpu_has(X86_FEATURE_AVX512VL) &&
 		    boot_cpu_has(X86_FEATURE_AVX512BW)) /* kmovq */
 			static_branch_enable(&chacha_use_avx512vl);
 	}
arch/x86/crypto/poly1305-x86_64-cryptogams.pl +0 -8
index b9abcd79c1f4..409ec6955733 100644
@@ -2811,18 +2811,10 @@ if ($avx>2) {
 # reason stack layout is kept identical to poly1305_blocks_avx2. If not
 # for this tail, we wouldn't have to even allocate stack frame...
 
-if($kernel) {
-	$code .= "#ifdef CONFIG_AS_AVX512\n";
-}
-
 &declare_function("poly1305_blocks_avx512", 32, 4);
 poly1305_blocks_avxN(1);
 &end_function("poly1305_blocks_avx512");
 
-if ($kernel) {
-	$code .= "#endif\n";
-}
-
 if (!$kernel && $avx>3) {
 ########################################################################
 # VPMADD52 version using 2^44 radix.
arch/x86/crypto/poly1305_glue.c +2 -2
index 08ff4b489f7e..506a6f2beb78 100644
@@ -107,7 +107,7 @@ static void poly1305_simd_blocks(void *ctx, const u8 *inp, size_t len,
 		const size_t bytes = min_t(size_t, len, SZ_4K);
 
 		kernel_fpu_begin();
-		if (IS_ENABLED(CONFIG_AS_AVX512) && static_branch_likely(&poly1305_use_avx512))
+		if (static_branch_likely(&poly1305_use_avx512))
 			poly1305_blocks_avx512(ctx, inp, bytes, padbit);
 		else if (static_branch_likely(&poly1305_use_avx2))
 			poly1305_blocks_avx2(ctx, inp, bytes, padbit);
@@ -265,7 +265,7 @@ static int __init poly1305_simd_mod_init(void)
 	if (boot_cpu_has(X86_FEATURE_AVX) && boot_cpu_has(X86_FEATURE_AVX2) &&
 	    cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL))
 		static_branch_enable(&poly1305_use_avx2);
-	if (IS_ENABLED(CONFIG_AS_AVX512) && boot_cpu_has(X86_FEATURE_AVX) &&
+	if (boot_cpu_has(X86_FEATURE_AVX) &&
 	    boot_cpu_has(X86_FEATURE_AVX2) && boot_cpu_has(X86_FEATURE_AVX512F) &&
 	    cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM | XFEATURE_MASK_AVX512, NULL) &&
 	    /* Skylake downclocks unacceptably much when using zmm, but later generations are fast. */
arch/x86/crypto/sha1_ssse3_glue.c +0 -10
index ab8bc54f254d..abb793cbad01 100644
@@ -28,9 +28,7 @@
 #include <asm/simd.h>
 
 static const struct x86_cpu_id module_cpu_ids[] = {
-#ifdef CONFIG_AS_SHA1_NI
 	X86_MATCH_FEATURE(X86_FEATURE_SHA_NI, NULL),
-#endif
 	X86_MATCH_FEATURE(X86_FEATURE_AVX2, NULL),
 	X86_MATCH_FEATURE(X86_FEATURE_AVX, NULL),
 	X86_MATCH_FEATURE(X86_FEATURE_SSSE3, NULL),
@@ -256,7 +254,6 @@ static void unregister_sha1_avx2(void)
 		crypto_unregister_shash(&sha1_avx2_alg);
 }
 
-#ifdef CONFIG_AS_SHA1_NI
 asmlinkage void sha1_ni_transform(struct sha1_state *digest, const u8 *data,
 				  int rounds);
 
@@ -306,11 +303,6 @@ static void unregister_sha1_ni(void)
 		crypto_unregister_shash(&sha1_ni_alg);
 }
 
-#else
-static inline int register_sha1_ni(void) { return 0; }
-static inline void unregister_sha1_ni(void) { }
-#endif
-
 static int __init sha1_ssse3_mod_init(void)
 {
 	if (!x86_match_cpu(module_cpu_ids))
@@ -360,6 +352,4 @@ MODULE_ALIAS_CRYPTO("sha1");
 MODULE_ALIAS_CRYPTO("sha1-ssse3");
 MODULE_ALIAS_CRYPTO("sha1-avx");
 MODULE_ALIAS_CRYPTO("sha1-avx2");
-#ifdef CONFIG_AS_SHA1_NI
 MODULE_ALIAS_CRYPTO("sha1-ni");
-#endif
arch/x86/crypto/sha256_ssse3_glue.c +0 -10
index e04a43d9f7d5..429a3cefbab4 100644
@@ -45,9 +45,7 @@ asmlinkage void sha256_transform_ssse3(struct sha256_state *state,
 				       const u8 *data, int blocks);
 
 static const struct x86_cpu_id module_cpu_ids[] = {
-#ifdef CONFIG_AS_SHA256_NI
 	X86_MATCH_FEATURE(X86_FEATURE_SHA_NI, NULL),
-#endif
 	X86_MATCH_FEATURE(X86_FEATURE_AVX2, NULL),
 	X86_MATCH_FEATURE(X86_FEATURE_AVX, NULL),
 	X86_MATCH_FEATURE(X86_FEATURE_SSSE3, NULL),
@@ -329,7 +327,6 @@ static void unregister_sha256_avx2(void)
 				ARRAY_SIZE(sha256_avx2_algs));
 }
 
-#ifdef CONFIG_AS_SHA256_NI
 asmlinkage void sha256_ni_transform(struct sha256_state *digest,
 				    const u8 *data, int rounds);
 
@@ -403,11 +400,6 @@ static void unregister_sha256_ni(void)
 				ARRAY_SIZE(sha256_ni_algs));
 }
 
-#else
-static inline int register_sha256_ni(void) { return 0; }
-static inline void unregister_sha256_ni(void) { }
-#endif
-
 static int __init sha256_ssse3_mod_init(void)
 {
 	if (!x86_match_cpu(module_cpu_ids))
@@ -461,7 +453,5 @@ MODULE_ALIAS_CRYPTO("sha224");
 MODULE_ALIAS_CRYPTO("sha224-ssse3");
 MODULE_ALIAS_CRYPTO("sha224-avx");
 MODULE_ALIAS_CRYPTO("sha224-avx2");
-#ifdef CONFIG_AS_SHA256_NI
 MODULE_ALIAS_CRYPTO("sha256-ni");
 MODULE_ALIAS_CRYPTO("sha224-ni");
-#endif
Signature · 1 line
2.39.5
#6 lore raw

PATCH 4/4 arm64: drop binutils version checks

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Now that gcc-8 and binutils-2.30 are the minimum versions, a lot of the individual feature checks can go away for simplification.

---
 arch/arm64/Kconfig              | 37 ++-------------------------------
 arch/arm64/Makefile             | 21 ++-----------------
 arch/arm64/include/asm/rwonce.h |  4 ----
 arch/arm64/kvm/Kconfig          |  1 -
 arch/arm64/lib/xor-neon.c       |  2 +-
 5 files changed, 5 insertions(+), 60 deletions(-)
arch/arm64/Kconfig +2 -35
index a182295e6f08..d33e3955566d 100644
@@ -642,9 +642,6 @@ config ARM64_ERRATUM_843419
 
 	  If unsure, say Y.
 
-config ARM64_LD_HAS_FIX_ERRATUM_843419
-	def_bool $(ld-option,--fix-cortex-a53-843419)
-
 config ARM64_ERRATUM_1024718
 	bool "Cortex-A55: 1024718: Update of DBM/AP bits without break before make might result in incorrect update"
 	default y
@@ -1890,13 +1887,9 @@ config ARM64_PAN
 	  The feature is detected at runtime, and will remain as a 'nop'
 	  instruction if the cpu does not implement the feature.
 
-config AS_HAS_LSE_ATOMICS
-	def_bool $(as-instr,.arch_extension lse)
-
 config ARM64_LSE_ATOMICS
 	bool
 	default ARM64_USE_LSE_ATOMICS
-	depends on AS_HAS_LSE_ATOMICS
 
 config ARM64_USE_LSE_ATOMICS
 	bool "Atomic instructions"
@@ -1908,20 +1901,12 @@ config ARM64_USE_LSE_ATOMICS
 
 	  Say Y here to make use of these instructions for the in-kernel
 	  atomic routines. This incurs a small overhead on CPUs that do
-	  not support these instructions and requires the kernel to be
-	  built with binutils >= 2.25 in order for the new instructions
-	  to be used.
+	  not support these instructions.
 
 endmenu # "ARMv8.1 architectural features"
 
 menu "ARMv8.2 architectural features"
 
-config AS_HAS_ARMV8_2
-	def_bool $(cc-option,-Wa$(comma)-march=armv8.2-a)
-
-config AS_HAS_SHA3
-	def_bool $(as-instr,.arch armv8.2-a+sha3)
-
 config ARM64_PMEM
 	bool "Enable support for persistent memory"
 	select ARCH_HAS_PMEM_API
@@ -1995,7 +1980,6 @@ config ARM64_PTR_AUTH_KERNEL
 	bool "Use pointer authentication for kernel"
 	default y
 	depends on ARM64_PTR_AUTH
-	depends on (CC_HAS_SIGN_RETURN_ADDRESS || CC_HAS_BRANCH_PROT_PAC_RET) && AS_HAS_ARMV8_3
 	# Modern compilers insert a .note.gnu.property section note for PAC
 	# which is only understood by binutils starting with version 2.33.1.
 	depends on LD_IS_LLD || LD_VERSION >= 23301 || (CC_IS_GCC && GCC_VERSION < 90100)
@@ -2016,19 +2000,10 @@ config CC_HAS_BRANCH_PROT_PAC_RET
 	# GCC 9 or later, clang 8 or later
 	def_bool $(cc-option,-mbranch-protection=pac-ret+leaf)
 
-config CC_HAS_SIGN_RETURN_ADDRESS
-	# GCC 7, 8
-	def_bool $(cc-option,-msign-return-address=all)
-
-config AS_HAS_ARMV8_3
-	def_bool $(cc-option,-Wa$(comma)-march=armv8.3-a)
-
 config AS_HAS_CFI_NEGATE_RA_STATE
+	# binutils 2.34+
 	def_bool $(as-instr,.cfi_startproc\n.cfi_negate_ra_state\n.cfi_endproc\n)
 
-config AS_HAS_LDAPR
-	def_bool $(as-instr,.arch_extension rcpc)
-
 endmenu # "ARMv8.3 architectural features"
 
 menu "ARMv8.4 architectural features"
@@ -2056,20 +2031,13 @@ config ARM64_AMU_EXTN
 	  correctly reflect reality. Most commonly, the value read will be 0,
 	  indicating that the counter is not enabled.
 
-config AS_HAS_ARMV8_4
-	def_bool $(cc-option,-Wa$(comma)-march=armv8.4-a)
-
 config ARM64_TLB_RANGE
 	bool "Enable support for tlbi range feature"
 	default y
-	depends on AS_HAS_ARMV8_4
 	help
 	  ARMv8.4-TLBI provides TLBI invalidation instruction that apply to a
 	  range of input addresses.
 
-	  The feature introduces new assembly instructions, and they were
-	  support when binutils >= 2.30.
-
 endmenu # "ARMv8.4 architectural features"
 
 menu "ARMv8.5 architectural features"
@@ -2145,7 +2113,6 @@ config ARM64_MTE
 	default y
 	depends on ARM64_AS_HAS_MTE && ARM64_TAGGED_ADDR_ABI
 	depends on AS_HAS_ARMV8_5
-	depends on AS_HAS_LSE_ATOMICS
 	# Required for tag checking in the uaccess routines
 	select ARM64_PAN
 	select ARCH_HAS_SUBPAGE_FAULTS
arch/arm64/Makefile +2 -19
index 1d5dfcd1c13e..73a10f65ce8b 100644
@@ -16,14 +16,11 @@ ifeq ($(CONFIG_RELOCATABLE), y)
 # Pass --no-apply-dynamic-relocs to restore pre-binutils-2.27 behaviour
 # for relative relocs, since this leads to better Image compression
 # with the relocation offsets always being zero.
-LDFLAGS_vmlinux		+= -shared -Bsymbolic -z notext \
-			$(call ld-option, --no-apply-dynamic-relocs)
+LDFLAGS_vmlinux	+= -shared -Bsymbolic -z notext --no-apply-dynamic-relocs
 endif
 
 ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
-  ifeq ($(CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419),y)
 LDFLAGS_vmlinux	+= --fix-cortex-a53-843419
-  endif
 endif
 
 cc_has_k_constraint := $(call try-run,echo				\
@@ -105,12 +102,8 @@ endif
 # hardware.
 ifeq ($(CONFIG_AS_HAS_ARMV8_5), y)
   asm-arch := armv8.5-a
-else ifeq ($(CONFIG_AS_HAS_ARMV8_4), y)
+else
   asm-arch := armv8.4-a
-else ifeq ($(CONFIG_AS_HAS_ARMV8_3), y)
-  asm-arch := armv8.3-a
-else ifeq ($(CONFIG_AS_HAS_ARMV8_2), y)
-  asm-arch := armv8.2-a
 endif
 
 ifdef asm-arch
@@ -201,16 +194,6 @@ install zinstall:
 
 archprepare:
 	$(Q)$(MAKE) $(build)=arch/arm64/tools kapi
-ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
-  ifneq ($(CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419),y)
-	@echo "warning: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum" >&2
-  endif
-endif
-ifeq ($(CONFIG_ARM64_USE_LSE_ATOMICS),y)
-  ifneq ($(CONFIG_ARM64_LSE_ATOMICS),y)
-	@echo "warning: LSE atomics not supported by binutils" >&2
-  endif
-endif
 
 ifeq ($(KBUILD_EXTMOD),)
 # We need to generate vdso-offsets.h before compiling certain files in kernel/.
arch/arm64/include/asm/rwonce.h +0 -4
index 56f7b1d4d54b..97d9256d33c9 100644
@@ -12,16 +12,12 @@
 
 #ifndef BUILD_VDSO
 
-#ifdef CONFIG_AS_HAS_LDAPR
 #define __LOAD_RCPC(sfx, regs...)					\
 	ALTERNATIVE(							\
 		"ldar"	#sfx "\t" #regs,				\
 		".arch_extension rcpc\n"				\
 		"ldapr"	#sfx "\t" #regs,				\
 	ARM64_HAS_LDAPR)
-#else
-#define __LOAD_RCPC(sfx, regs...)	"ldar" #sfx "\t" #regs
-#endif /* CONFIG_AS_HAS_LDAPR */
 
 /*
  * When building with LTO, there is an increased risk of the compiler
arch/arm64/kvm/Kconfig +0 -1
index 096e45acadb2..713248f240e0 100644
@@ -19,7 +19,6 @@ if VIRTUALIZATION
 
 menuconfig KVM
 	bool "Kernel-based Virtual Machine (KVM) support"
-	depends on AS_HAS_ARMV8_4
 	select KVM_COMMON
 	select KVM_GENERIC_HARDWARE_ENABLING
 	select KVM_GENERIC_MMU_NOTIFIER
arch/arm64/lib/xor-neon.c +1 -1
index f9a53b7f9842..8fffebfa17b2 100644
@@ -319,7 +319,7 @@ static void xor_arm64_eor3_5(unsigned long bytes,
 
 static int __init xor_neon_init(void)
 {
-	if (IS_ENABLED(CONFIG_AS_HAS_SHA3) && cpu_have_named_feature(SHA3)) {
+	if (cpu_have_named_feature(SHA3)) {
 		xor_block_inner_neon.do_3 = xor_arm64_eor3_3;
 		xor_block_inner_neon.do_4 = xor_arm64_eor3_4;
 		xor_block_inner_neon.do_5 = xor_arm64_eor3_5;
Signature · 1 line
2.39.5
maintainer
#7 lore raw

Re: [PATCH 4/4] arm64: drop binutils version checks

Hi Arnd,

Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Now that gcc-8 and binutils-2.30 are the minimum versions, a lot of the individual feature checks can go away for simplification.

Quoted 8 lines
---
 arch/arm64/Kconfig              | 37 ++-------------------------------
 arch/arm64/Makefile             | 21 ++-----------------
 arch/arm64/include/asm/rwonce.h |  4 ----
 arch/arm64/kvm/Kconfig          |  1 -
 arch/arm64/lib/xor-neon.c       |  2 +-
 5 files changed, 5 insertions(+), 60 deletions(-)

Since some of these checks are dynamic (i.e. they try passing various options to the tools to see if they barf), have you checked that the minimum supported version of clang implements them all?

Will

#8 lore raw

Re: [PATCH 4/4] arm64: drop binutils version checks

Quoted 17 lines · Will Deacon

Hi Arnd,

Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Now that gcc-8 and binutils-2.30 are the minimum versions, a lot of the individual feature checks can go away for simplification.

Quoted 8 lines
---
 arch/arm64/Kconfig              | 37 ++-------------------------------
 arch/arm64/Makefile             | 21 ++-----------------
 arch/arm64/include/asm/rwonce.h |  4 ----
 arch/arm64/kvm/Kconfig          |  1 -
 arch/arm64/lib/xor-neon.c       |  2 +-
 5 files changed, 5 insertions(+), 60 deletions(-)
Quoted 3 lines

Since some of these checks are dynamic (i.e. they try passing various options to the tools to see if they barf), have you checked that the minimum supported version of clang implements them all?

I did some randconfig build testing with clang-13/lld-13, since that is the oldest supported version, and checked that the options are all supported. I'm pretty sure it's been there for a long time before that already.

Arnd

maintainer
#9 lore raw

Re: [PATCH 4/4] arm64: drop binutils version checks

Quoted 18 lines · Arnd Bergmann
Quoted 17 lines · Will Deacon

Hi Arnd,

Quoted 13 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Now that gcc-8 and binutils-2.30 are the minimum versions, a lot of the individual feature checks can go away for simplification.

---
 arch/arm64/Kconfig              | 37 ++-------------------------------
 arch/arm64/Makefile             | 21 ++-----------------
 arch/arm64/include/asm/rwonce.h |  4 ----
 arch/arm64/kvm/Kconfig          |  1 -
 arch/arm64/lib/xor-neon.c       |  2 +-
 5 files changed, 5 insertions(+), 60 deletions(-)
Quoted 8 lines
Quoted 3 lines

Since some of these checks are dynamic (i.e. they try passing various options to the tools to see if they barf), have you checked that the minimum supported version of clang implements them all?

I did some randconfig build testing with clang-13/lld-13, since that is the oldest supported version, and checked that the options are all supported. I'm pretty sure it's been there for a long time before that already.

Thanks (especially to Mark!) for checking.

Will

reviewer Acked-by on v1 4/4
#10 lore raw

Re: [PATCH 4/4] arm64: drop binutils version checks

In reply to Arnd Bergmann

Hi Arnd,

Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Now that gcc-8 and binutils-2.30 are the minimum versions, a lot of the individual feature checks can go away for simplification.

To address Will's concern, I grabbed the LLVM 13.0.1 (since that's the minimum supported version) from https://www.kernel.org/pub//tools/llvm/,
and using v6.15-rc1 I checked the Kconfig resulting from:

  # magic script that puts the toolchain in my $PATH
  usekorg-llvm 13.0.1 make ARCH=arm64 LLVM=1 defconfig
  usekorg-llvm 13.0.1 make ARCH=arm64 LLVM=1 menuconfig

I then applied this series, and built a defconfig kernel with the same toolchain, which built cleanly and boots fine.

The gist is that everything looks good, so:

More specifically, with that I see:

	CC_IS_CLANG [=y]
	AS_IS_LLVM [=y]
	LD_IS_LLD [=y]

... and I've noted each of the Kconfig options below.

[...]

arch/arm64/Kconfig config ARM64_ERRATUM_843419 · line 646

Quoted 2 lines
arch/arm64/Kconfig +0 -2
-config ARM64_LD_HAS_FIX_ERRATUM_843419
-	def_bool $(ld-option,--fix-cortex-a53-843419)
	ARM64_LD_HAS_FIX_ERRATUM_843419 [=y] 

arch/arm64/Kconfig config ARM64_PAN · line 1894

Quoted 2 lines
arch/arm64/Kconfig +0 -2
-config AS_HAS_LSE_ATOMICS
-	def_bool $(as-instr,.arch_extension lse)
	AS_HAS_LSE_ATOMICS [=y]

arch/arm64/Kconfig config ARM64_USE_LSE_ATOMICS · line 1920

Quoted 2 lines
arch/arm64/Kconfig +0 -2
-config AS_HAS_ARMV8_2
-	def_bool $(cc-option,-Wa$(comma)-march=armv8.2-a)
	AS_HAS_ARMV8_2 [=y]

arch/arm64/Kconfig config ARM64_USE_LSE_ATOMICS · line 1923

Quoted 2 lines
arch/arm64/Kconfig +0 -2
-config AS_HAS_SHA3
-	def_bool $(as-instr,.arch armv8.2-a+sha3)
	AS_HAS_SHA3 [=y]

arch/arm64/Kconfig config CC_HAS_BRANCH_PROT_PAC_RET · line 2021

Quoted 3 lines
arch/arm64/Kconfig +0 -3
-config CC_HAS_SIGN_RETURN_ADDRESS
-	# GCC 7, 8
-	def_bool $(cc-option,-msign-return-address=all)

CC_HAS_SIGN_RETURN_ADDRESS [=y]

arch/arm64/Kconfig config CC_HAS_BRANCH_PROT_PAC_RET · line 2024

Quoted 2 lines
arch/arm64/Kconfig +0 -2
-config AS_HAS_ARMV8_3
-	def_bool $(cc-option,-Wa$(comma)-march=armv8.3-a)
	AS_HAS_ARMV8_3 [=y]

arch/arm64/Kconfig config CC_HAS_BRANCH_PROT_PAC_RET · line 2005

Quoted 3 lines

config AS_HAS_CFI_NEGATE_RA_STATE

arch/arm64/Kconfig +1 -0
+	# binutils 2.34+
 	def_bool $(as-instr,.cfi_startproc\n.cfi_negate_ra_state\n.cfi_endproc\n)
	AS_HAS_CFI_NEGATE_RA_STATE [=y]

arch/arm64/Kconfig config CC_HAS_BRANCH_PROT_PAC_RET · line 2030

Quoted 2 lines
arch/arm64/Kconfig +0 -2
-config AS_HAS_LDAPR
-	def_bool $(as-instr,.arch_extension rcpc)
	AS_HAS_LDAPR [=y]

arch/arm64/Kconfig config ARM64_AMU_EXTN · line 2060

Quoted 2 lines
arch/arm64/Kconfig +0 -2
-config AS_HAS_ARMV8_4
-	def_bool $(cc-option,-Wa$(comma)-march=armv8.4-a)
	AS_HAS_ARMV8_4 [=y]

arch/arm64/Makefile ifeq ($(CONFIG_RELOCATABLE), y) · line 20

Quoted 12 lines
arch/arm64/Makefile +1 -2
index 1d5dfcd1c13e..73a10f65ce8b 100644
@@ -16,14 +16,11 @@ ifeq ($(CONFIG_RELOCATABLE), y)
 # Pass --no-apply-dynamic-relocs to restore pre-binutils-2.27 behaviour
 # for relative relocs, since this leads to better Image compression
 # with the relocation offsets always being zero.
-LDFLAGS_vmlinux		+= -shared -Bsymbolic -z notext \
-			$(call ld-option, --no-apply-dynamic-relocs)
+LDFLAGS_vmlinux	+= -shared -Bsymbolic -z notext --no-apply-dynamic-relocs
 endif

Looks good:

  [mark@lakrids:~/src/linux]% usekorg-llvm 13.0.1 ld.lld -shared -Bsymbolic -z notext --made-up-argument       
  ld.lld: error: unknown argument '--made-up-argument'
  [mark@lakrids:~/src/linux]% usekorg-llvm 13.0.1 ld.lld -shared -Bsymbolic -z notext --no-apply-dynamic-relocs
  ld.lld: error: no input files

arch/arm64/Makefile ifeq ($(CONFIG_RELOCATABLE), y) · line 24

Quoted 5 lines
arch/arm64/Makefile +0 -2
 ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
-  ifeq ($(CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419),y)
 LDFLAGS_vmlinux	+= --fix-cortex-a53-843419
-  endif
 endif

Looks good:

  [mark@lakrids:~/src/linux]% usekorg-llvm 13.0.1 ld.lld --made-up-argument
  ld.lld: error: unknown argument '--made-up-argument'
  [mark@lakrids:~/src/linux]% usekorg-llvm 13.0.1 ld.lld --fix-cortex-a53-843419
  ld.lld: error: no input files

[...]

arch/arm64/Makefile endif · line 107

Quoted 10 lines

ifeq ($(CONFIG_AS_HAS_ARMV8_5), y)
asm-arch := armv8.5-a

arch/arm64/Makefile +1 -5
-else ifeq ($(CONFIG_AS_HAS_ARMV8_4), y)
+else
   asm-arch := armv8.4-a
-else ifeq ($(CONFIG_AS_HAS_ARMV8_3), y)
-  asm-arch := armv8.3-a
-else ifeq ($(CONFIG_AS_HAS_ARMV8_2), y)
-  asm-arch := armv8.2-a
 endif

Looks good; this was checked in Kconfig.

[...]

arch/arm64/Makefile install zinstall: · line 213

Quoted 12 lines

archprepare:

arch/arm64/Makefile +0 -10
 	$(Q)$(MAKE) $(build)=arch/arm64/tools kapi
-ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
-  ifneq ($(CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419),y)
-	@echo "warning: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum" >&2
-  endif
-endif
-ifeq ($(CONFIG_ARM64_USE_LSE_ATOMICS),y)
-  ifneq ($(CONFIG_ARM64_LSE_ATOMICS),y)
-	@echo "warning: LSE atomics not supported by binutils" >&2
-  endif
-endif

Looks good; both were checked in Kconfig.

[...]

arch/arm64/Makefile

Quoted 10 lines
arch/arm64/Makefile +0 -4
-#ifdef CONFIG_AS_HAS_LDAPR
 #define __LOAD_RCPC(sfx, regs...)					\
 	ALTERNATIVE(							\
 		"ldar"	#sfx "\t" #regs,				\
 		".arch_extension rcpc\n"				\
 		"ldapr"	#sfx "\t" #regs,				\
 	ARM64_HAS_LDAPR)
-#else
-#define __LOAD_RCPC(sfx, regs...)	"ldar" #sfx "\t" #regs
-#endif /* CONFIG_AS_HAS_LDAPR */

Looks good.

Quoted 8 lines

/*
* When building with LTO, there is an increased risk of the compiler

arch/arm64/kvm/Kconfig +0 -0
index 096e45acadb2..713248f240e0 100644

arch/arm64/kvm/Kconfig if VIRTUALIZATION · line 24

Quoted 7 lines
arch/arm64/kvm/Kconfig +0 -1
@@ -19,7 +19,6 @@ if VIRTUALIZATION
 
 menuconfig KVM
 	bool "Kernel-based Virtual Machine (KVM) support"
-	depends on AS_HAS_ARMV8_4
 	select KVM_COMMON
 	select KVM_GENERIC_HARDWARE_ENABLING
 	select KVM_GENERIC_MMU_NOTIFIER

Looks good.

arch/arm64/lib/xor-neon.c static void xor_arm64_eor3_5(unsigned long bytes, · line 322

Quoted 10 lines
arch/arm64/lib/xor-neon.c +1 -1
index f9a53b7f9842..8fffebfa17b2 100644
@@ -319,7 +319,7 @@ static void xor_arm64_eor3_5(unsigned long bytes,
 
 static int __init xor_neon_init(void)
 {
-	if (IS_ENABLED(CONFIG_AS_HAS_SHA3) && cpu_have_named_feature(SHA3)) {
+	if (cpu_have_named_feature(SHA3)) {

Looks good.

Mark.

#11 lore raw
In reply to Arnd Bergmann
Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

x86 already requires gcc-8.1 since linux-6.15-rc1, which led me to actually go through all version checks and make this is the minimum for all architectures.

Quoted 8 lines

Most of the actual resulting changes are actually for raising the binutils version, which eliminates version checks on x86 and arm64.

Arnd Bergmann (4):
kbuild: require gcc-8 and binutils-2.30
raid6: skip avx512 checks
x86: remove checks for binutils-2.30 and earlier
arm64: drop binutils version checks

This is intended to supersede the patches from Uros that removed checks for binutils < 2.25, right? See:

* https://lore.kernel.org/linux-crypto/[email protected]/
* https://lore.kernel.org/linux-crypto/[email protected]
* https://lore.kernel.org/linux-crypto/[email protected]/

If we can indeed bump up the requirement to 2.30, that would be great.

Just a note though: I recently added VAES and VPCLMULQDQ instructions to BoringSSL, which increased the binutils requirement of building BoringSSL to 2.30, and this caused issues in a downstream project; e.g. see
https://github.com/briansmith/ring/issues/2463. Specifically people complained about being unable to build on Amazon Linux 2 and CentOS/RHEL/Oracle Linux 7.

So I just thought I'd mention that, based on past experience with this sort of thing, those are the specific cases where it seems people are most likely to be trying to use binutils < 2.30.

But if those distros are not going to be supported any longer (without installing newer tools on them), or even are already unsupported due to the gcc requirement, bumping up the binutils requirement to 2.30 sounds good to me.

- Eric

#12 lore raw
Quoted 23 lines · On Mon, 7 Apr 2025 09:41:51 -0700 Eric Biggers <[email protected]> wrote:
Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

x86 already requires gcc-8.1 since linux-6.15-rc1, which led me to actually go through all version checks and make this is the minimum for all architectures.

Quoted 8 lines

Most of the actual resulting changes are actually for raising the binutils version, which eliminates version checks on x86 and arm64.

Arnd Bergmann (4):
kbuild: require gcc-8 and binutils-2.30
raid6: skip avx512 checks
x86: remove checks for binutils-2.30 and earlier
arm64: drop binutils version checks

This is intended to supersede the patches from Uros that removed checks for binutils < 2.25, right? See:

* https://lore.kernel.org/linux-crypto/[email protected]/
* https://lore.kernel.org/linux-crypto/[email protected]
* https://lore.kernel.org/linux-crypto/[email protected]/

Quoted 7 lines

If we can indeed bump up the requirement to 2.30, that would be great.

Just a note though: I recently added VAES and VPCLMULQDQ instructions to BoringSSL, which increased the binutils requirement of building BoringSSL to 2.30, and this caused issues in a downstream project; e.g. see
https://github.com/briansmith/ring/issues/2463. Specifically people complained about being unable to build on Amazon Linux 2 and CentOS/RHEL/Oracle Linux 7.

Just tell them RHEL 7 is no longer supported :-)
(Was a right PITA installing an extra package on a CentOS 7 system we use as a build machine...)

In any case it is relatively easy to install a later gcc - even though it ends up in a very obscure place.

David

Quoted 11 lines

So I just thought I'd mention that, based on past experience with this sort of thing, those are the specific cases where it seems people are most likely to be trying to use binutils < 2.30.

But if those distros are not going to be supported any longer (without installing newer tools on them), or even are already unsupported due to the gcc requirement, bumping up the binutils requirement to 2.30 sounds good to me.

- Eric

#13 lore raw
In reply to Eric Biggers
Quoted 16 lines · Eric Biggers
Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

x86 already requires gcc-8.1 since linux-6.15-rc1, which led me to actually go through all version checks and make this is the minimum for all architectures.

Quoted 8 lines

Most of the actual resulting changes are actually for raising the binutils version, which eliminates version checks on x86 and arm64.

Arnd Bergmann (4):
kbuild: require gcc-8 and binutils-2.30
raid6: skip avx512 checks
x86: remove checks for binutils-2.30 and earlier
arm64: drop binutils version checks

Quoted 6 lines

This is intended to supersede the patches from Uros that removed checks for binutils < 2.25, right? See:

* https://lore.kernel.org/linux-crypto/[email protected]/
* https://lore.kernel.org/linux-crypto/[email protected]
* https://lore.kernel.org/linux-crypto/[email protected]/

Yeah, so these commits (now pending in the x86 tree) should nicely complement each other, there shouldn't be much friction other than:

a72d55dc3bd6 x86/idle: Remove CONFIG_AS_TPAUSE

... which will have a conflict in arch/x86/Kconfig.assembler but is straightforward to resolve.

Quoted 1 line

If we can indeed bump up the requirement to 2.30, that would be great.

Agreed.

Thanks,

Ingo

#14 lore raw
In reply to Eric Biggers
Quoted 11 lines · Eric Biggers

On Mon, Apr 07, 2025 at 11:41:12AM +0200, Arnd Bergmann wrote:

This is intended to supersede the patches from Uros that removed checks for binutils < 2.25, right? See:

*
https://lore.kernel.org/linux-crypto/[email protected]/
*
https://lore.kernel.org/linux-crypto/[email protected]
*
https://lore.kernel.org/linux-crypto/[email protected]/

I missed these, but it does sounds we easy to work out, either by rebasing my patch or dropping Uros' version.

Quoted 8 lines

If we can indeed bump up the requirement to 2.30, that would be great.

Just a note though: I recently added VAES and VPCLMULQDQ instructions to BoringSSL, which increased the binutils requirement of building BoringSSL to 2.30, and this caused issues in a downstream project; e.g. see
https://github.com/briansmith/ring/issues/2463. Specifically people complained about being unable to build on Amazon Linux 2 and CentOS/RHEL/Oracle Linux 7.

Quoted 7 lines

So I just thought I'd mention that, based on past experience with this sort of thing, those are the specific cases where it seems people are most likely to be trying to use binutils < 2.30.

But if those distros are not going to be supported any longer (without installing newer tools on them), or even are already unsupported due to the gcc requirement, bumping up the binutils requirement to 2.30 sounds good to me.

RHEL7 comes wit gcc-4.8.5, which is already too old to build the kernel, so I'm not worried about it at all. RHEL8 and Debian 10 have gcc-8, which is why that makes sense as a new minimum version.

SLES-15 (gcc-7), Debian 9 (gcc-6), and Ubuntu 18.05 (gcc-7) are the ones that can currently build mainline kernels but are broken by this change. SLES-15 is the only one of those that are still supported, but they do ship with add-on compilers.

Arnd

#15 lore raw
Quoted 13 lines · Arnd Bergmann
Quoted 11 lines · Eric Biggers

On Mon, Apr 07, 2025 at 11:41:12AM +0200, Arnd Bergmann wrote:

This is intended to supersede the patches from Uros that removed checks for binutils < 2.25, right? See:

*
https://lore.kernel.org/linux-crypto/[email protected]/
*
https://lore.kernel.org/linux-crypto/[email protected]
*
https://lore.kernel.org/linux-crypto/[email protected]/

Quoted 2 lines

I missed these, but it does sounds we easy to work out, either by rebasing my patch or dropping Uros' version.

It's a trivial conflict resolution AFAICS, already done in today's -next.

Thanks,

Ingo

reviewer Acked-by on the v1 series
#16 lore raw
In reply to Arnd Bergmann
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

x86 already requires gcc-8.1 since linux-6.15-rc1, which led me to actually go through all version checks and make this is the minimum for all architectures.

I am very much in favour of this, so for the series:

Is the aim to get this in for v6.15?

I believe this will permit a number of further cleanups for arm64, and if it's possible to get this in for v6.15, it'd be a bit easier to start preparing those for v6.16. No big problem if that's not the case.

Mark.

Quoted 79 lines

Most of the actual resulting changes are actually for raising the binutils version, which eliminates version checks on x86 and arm64.

Arnd Bergmann (4):
kbuild: require gcc-8 and binutils-2.30
raid6: skip avx512 checks
x86: remove checks for binutils-2.30 and earlier
arm64: drop binutils version checks

Cc "H. Peter Anvin" <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Brian Gerst <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Herbert Xu <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Masahiro Yamada <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Nicolas Schier <[email protected]>
Cc Takashi Iwai <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Uros Bizjak <[email protected]>
Cc Will Deacon <[email protected]>
 Documentation/admin-guide/README.rst          |  2 +-
 Documentation/kbuild/makefiles.rst            |  4 +-
 Documentation/process/changes.rst             |  4 +-
 .../translations/it_IT/process/changes.rst    |  4 +-
 .../translations/zh_CN/admin-guide/README.rst |  2 +-
 arch/arm64/Kconfig                            | 37 +--------------
 arch/arm64/Makefile                           | 21 +--------
 arch/arm64/include/asm/rwonce.h               |  4 --
 arch/arm64/kvm/Kconfig                        |  1 -
 arch/arm64/lib/xor-neon.c                     |  2 +-
 arch/um/Makefile                              |  4 +-
 arch/x86/Kconfig.assembler                    | 29 ------------
 arch/x86/crypto/Kconfig                       |  2 +-
 arch/x86/crypto/Makefile                      | 12 +++--
 arch/x86/crypto/aes-ctr-avx-x86_64.S          |  2 -
 arch/x86/crypto/aes-xts-avx-x86_64.S          |  2 -
 arch/x86/crypto/aesni-intel_glue.c            | 21 +--------
 arch/x86/crypto/aria-aesni-avx-asm_64.S       | 10 -----
 arch/x86/crypto/aria-aesni-avx2-asm_64.S      | 10 +----
 arch/x86/crypto/aria_aesni_avx2_glue.c        |  4 +-
 arch/x86/crypto/aria_aesni_avx_glue.c         |  4 +-
 arch/x86/crypto/blake2s-core.S                |  4 --
 arch/x86/crypto/blake2s-glue.c                |  6 +--
 arch/x86/crypto/chacha_glue.c                 |  6 +--
 arch/x86/crypto/poly1305-x86_64-cryptogams.pl |  8 ----
 arch/x86/crypto/poly1305_glue.c               |  4 +-
 arch/x86/crypto/sha1_ssse3_glue.c             | 10 -----
 arch/x86/crypto/sha256_ssse3_glue.c           | 10 -----
 include/linux/unroll.h                        |  4 +-
 kernel/gcov/gcc_4_7.c                         |  4 --
 lib/raid6/algos.c                             |  6 ---
 lib/raid6/avx512.c                            |  4 --
 lib/raid6/recov_avx512.c                      |  6 ---
 lib/raid6/test/Makefile                       |  3 --
 lib/test_fortify/Makefile                     |  5 +--
 scripts/Makefile.compiler                     |  2 +-
 scripts/gcc-plugins/gcc-common.h              | 45 -------------------
 scripts/min-tool-version.sh                   |  6 +--
 38 files changed, 36 insertions(+), 278 deletions(-)
Signature · 1 line
2.39.5
#17 lore raw
Quoted 9 lines · Mark Rutland
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

x86 already requires gcc-8.1 since linux-6.15-rc1, which led me to actually go through all version checks and make this is the minimum for all architectures.

I am very much in favour of this, so for the series:

Quoted 7 lines

Is the aim to get this in for v6.15?

I believe this will permit a number of further cleanups for arm64, and if it's possible to get this in for v6.15, it'd be a bit easier to start preparing those for v6.16. No big problem if that's not the case.

I wasn't planning to push it for 6.15, as we've discussed this change for a long time already, I don't think there is any rush now, though I agree it would have helped to have it earlier.

I already found another follow-up, removing support for the sancov gcc plugin that is no longer needed, I'm sure there is more.

Arnd