Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'kbuild-v5.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull more Kbuild updates from Masahiro Yamada:

- raise minimum supported binutils version to 2.23

- remove old CONFIG_AS_* macros that we know binutils >= 2.23 supports

- move remaining CONFIG_AS_* tests to Kconfig from Makefile

- enable -Wtautological-compare warnings to catch more issues

- do not support GCC plugins for GCC <= 4.7

- fix various breakages of 'make xconfig'

- include the linker version used for linking the kernel into
LINUX_COMPILER, which is used for the banner, and also exposed to
/proc/version

- link lib-y objects to vmlinux forcibly when CONFIG_MODULES=y, which
allows us to remove the lib-ksyms.o workaround, and to solve the last
known issue of the LLVM linker

- add dummy tools in scripts/dummy-tools/ to enable all compiler tests
in Kconfig, which will be useful for distro maintainers

- support the single switch, LLVM=1 to use Clang and all LLVM utilities
instead of GCC and Binutils.

- support LLVM_IAS=1 to enable the integrated assembler, which is still
experimental

* tag 'kbuild-v5.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (36 commits)
kbuild: fix comment about missing include guard detection
kbuild: support LLVM=1 to switch the default tools to Clang/LLVM
kbuild: replace AS=clang with LLVM_IAS=1
kbuild: add dummy toolchains to enable all cc-option etc. in Kconfig
kbuild: link lib-y objects to vmlinux forcibly when CONFIG_MODULES=y
MIPS: fw: arc: add __weak to prom_meminit and prom_free_prom_memory
kbuild: remove -I$(srctree)/tools/include from scripts/Makefile
kbuild: do not pass $(KBUILD_CFLAGS) to scripts/mkcompile_h
Documentation/llvm: fix the name of llvm-size
kbuild: mkcompile_h: Include $LD version in /proc/version
kconfig: qconf: Fix a few alignment issues
kconfig: qconf: remove some old bogus TODOs
kconfig: qconf: fix support for the split view mode
kconfig: qconf: fix the content of the main widget
kconfig: qconf: Change title for the item window
kconfig: qconf: clean deprecated warnings
gcc-plugins: drop support for GCC <= 4.7
kbuild: Enable -Wtautological-compare
x86: update AS_* macros to binutils >=2.23, supporting ADX and AVX2
crypto: x86 - clean up poly1305-x86_64-cryptogams.S by 'make clean'
...

+389 -526
+5
Documentation/kbuild/kbuild.rst
··· 262 262 These two variables allow to override the user@host string displayed during 263 263 boot and in /proc/version. The default value is the output of the commands 264 264 whoami and host, respectively. 265 + 266 + LLVM 267 + ---- 268 + If this variable is set to 1, Kbuild will use Clang and LLVM utilities instead 269 + of GCC and GNU binutils to build the kernel.
+11 -4
Documentation/kbuild/llvm.rst
··· 47 47 LLVM Utilities 48 48 -------------- 49 49 50 - LLVM has substitutes for GNU binutils utilities. These can be invoked as 51 - additional parameters to `make`. 50 + LLVM has substitutes for GNU binutils utilities. Kbuild supports `LLVM=1` 51 + to enable them. 52 52 53 - make CC=clang AS=clang LD=ld.lld AR=llvm-ar NM=llvm-nm STRIP=llvm-strip \\ 54 - OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump OBJSIZE=llvm-objsize \\ 53 + make LLVM=1 54 + 55 + They can be enabled individually. The full list of the parameters: 56 + 57 + make CC=clang LD=ld.lld AR=llvm-ar NM=llvm-nm STRIP=llvm-strip \\ 58 + OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump OBJSIZE=llvm-size \\ 55 59 READELF=llvm-readelf HOSTCC=clang HOSTCXX=clang++ HOSTAR=llvm-ar \\ 56 60 HOSTLD=ld.lld 61 + 62 + Currently, the integrated assembler is disabled by default. You can pass 63 + `LLVM_IAS=1` to enable it. 57 64 58 65 Getting Help 59 66 ------------
+2 -2
Documentation/process/changes.rst
··· 31 31 ====================== =============== ======================================== 32 32 GNU C 4.6 gcc --version 33 33 GNU make 3.81 make --version 34 - binutils 2.21 ld -v 34 + binutils 2.23 ld -v 35 35 flex 2.5.35 flex --version 36 36 bison 2.0 bison --version 37 37 util-linux 2.10o fdformat --version ··· 76 76 Binutils 77 77 -------- 78 78 79 - Binutils 2.21 or newer is needed to build the kernel. 79 + Binutils 2.23 or newer is needed to build the kernel. 80 80 81 81 pkg-config 82 82 ----------
+30 -10
Makefile
··· 399 399 HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS 2>/dev/null) 400 400 HOST_LFS_LIBS := $(shell getconf LFS_LIBS 2>/dev/null) 401 401 402 - HOSTCC = gcc 403 - HOSTCXX = g++ 402 + ifneq ($(LLVM),) 403 + HOSTCC = clang 404 + HOSTCXX = clang++ 405 + else 406 + HOSTCC = gcc 407 + HOSTCXX = g++ 408 + endif 404 409 KBUILD_HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \ 405 410 -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) \ 406 411 $(HOSTCFLAGS) ··· 414 409 KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS) 415 410 416 411 # Make variables (CC, etc...) 417 - LD = $(CROSS_COMPILE)ld 418 - CC = $(CROSS_COMPILE)gcc 419 412 CPP = $(CC) -E 413 + ifneq ($(LLVM),) 414 + CC = clang 415 + LD = ld.lld 416 + AR = llvm-ar 417 + NM = llvm-nm 418 + OBJCOPY = llvm-objcopy 419 + OBJDUMP = llvm-objdump 420 + READELF = llvm-readelf 421 + OBJSIZE = llvm-size 422 + STRIP = llvm-strip 423 + else 424 + CC = $(CROSS_COMPILE)gcc 425 + LD = $(CROSS_COMPILE)ld 420 426 AR = $(CROSS_COMPILE)ar 421 427 NM = $(CROSS_COMPILE)nm 422 - STRIP = $(CROSS_COMPILE)strip 423 428 OBJCOPY = $(CROSS_COMPILE)objcopy 424 429 OBJDUMP = $(CROSS_COMPILE)objdump 425 - OBJSIZE = $(CROSS_COMPILE)size 426 430 READELF = $(CROSS_COMPILE)readelf 431 + OBJSIZE = $(CROSS_COMPILE)size 432 + STRIP = $(CROSS_COMPILE)strip 433 + endif 427 434 PAHOLE = pahole 428 435 LEX = flex 429 436 YACC = bison ··· 555 538 ifneq ($(GCC_TOOLCHAIN),) 556 539 CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN) 557 540 endif 558 - ifeq ($(if $(AS),$(shell $(AS) --version 2>&1 | head -n 1 | grep clang)),) 541 + ifneq ($(LLVM_IAS),1) 559 542 CLANG_FLAGS += -no-integrated-as 560 543 endif 561 544 CLANG_FLAGS += -Werror=unknown-warning-option ··· 764 747 KBUILD_CPPFLAGS += -Qunused-arguments 765 748 KBUILD_CFLAGS += -Wno-format-invalid-specifier 766 749 KBUILD_CFLAGS += -Wno-gnu 767 - # Quiet clang warning: comparison of unsigned expression < 0 is always false 768 - KBUILD_CFLAGS += -Wno-tautological-compare 769 750 # CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the 770 751 # source of a reference will be _MergedGlobals and not on of the whitelisted names. 771 752 # See modpost pattern 2 ··· 1051 1036 core-y := $(patsubst %/, %/built-in.a, $(core-y)) 1052 1037 drivers-y := $(patsubst %/, %/built-in.a, $(drivers-y)) 1053 1038 net-y := $(patsubst %/, %/built-in.a, $(net-y)) 1039 + libs-y2 := $(patsubst %/, %/built-in.a, $(filter %/, $(libs-y))) 1040 + ifdef CONFIG_MODULES 1041 + libs-y1 := $(filter-out %/, $(libs-y)) 1042 + libs-y2 += $(patsubst %/, %/lib.a, $(filter %/, $(libs-y))) 1043 + else 1054 1044 libs-y1 := $(patsubst %/, %/lib.a, $(libs-y)) 1055 - libs-y2 := $(patsubst %/, %/built-in.a, $(filter-out %.a, $(libs-y))) 1045 + endif 1056 1046 virt-y := $(patsubst %/, %/built-in.a, $(virt-y)) 1057 1047 1058 1048 # Externally visible symbols (used by link-vmlinux.sh)
-15
arch/h8300/include/uapi/asm/bitsperlong.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 - #ifndef _UAPI__ASM_H8300_BITS_PER_LONG 3 - #define _UAPI__ASM_H8300_BITS_PER_LONG 4 - 5 - #include <asm-generic/bitsperlong.h> 6 - 7 - #if !defined(__ASSEMBLY__) 8 - /* h8300-unknown-linux required long */ 9 - #define __kernel_size_t __kernel_size_t 10 - typedef unsigned long __kernel_size_t; 11 - typedef long __kernel_ssize_t; 12 - typedef long __kernel_ptrdiff_t; 13 - #endif 14 - 15 - #endif /* _UAPI__ASM_H8300_BITS_PER_LONG */
+13
arch/h8300/include/uapi/asm/posix_types.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ 2 + #ifndef _UAPI_ASM_POSIX_TYPES_H 3 + #define _UAPI_ASM_POSIX_TYPES_H 4 + 5 + /* h8300-unknown-linux required long */ 6 + #define __kernel_size_t __kernel_size_t 7 + typedef unsigned long __kernel_size_t; 8 + typedef long __kernel_ssize_t; 9 + typedef long __kernel_ptrdiff_t; 10 + 11 + #include <asm-generic/posix_types.h> 12 + 13 + #endif /* _UAPI_ASM_POSIX_TYPES_H */
+2 -2
arch/mips/fw/arc/memory.c
··· 117 117 return memtype_classify_arc(type); 118 118 } 119 119 120 - void __init prom_meminit(void) 120 + void __weak __init prom_meminit(void) 121 121 { 122 122 struct linux_mdesc *p; 123 123 ··· 162 162 { 163 163 } 164 164 165 - void __init prom_free_prom_memory(void) 165 + void __weak __init prom_free_prom_memory(void) 166 166 { 167 167 int i; 168 168
+3 -5
arch/sh/include/asm/bitops-op32.h
··· 16 16 #define BYTE_OFFSET(nr) ((nr) % BITS_PER_BYTE) 17 17 #endif 18 18 19 - #define IS_IMMEDIATE(nr) (__builtin_constant_p(nr)) 20 - 21 19 static inline void __set_bit(int nr, volatile unsigned long *addr) 22 20 { 23 - if (IS_IMMEDIATE(nr)) { 21 + if (__builtin_constant_p(nr)) { 24 22 __asm__ __volatile__ ( 25 23 "bset.b %1, @(%O2,%0) ! __set_bit\n\t" 26 24 : "+r" (addr) ··· 35 37 36 38 static inline void __clear_bit(int nr, volatile unsigned long *addr) 37 39 { 38 - if (IS_IMMEDIATE(nr)) { 40 + if (__builtin_constant_p(nr)) { 39 41 __asm__ __volatile__ ( 40 42 "bclr.b %1, @(%O2,%0) ! __clear_bit\n\t" 41 43 : "+r" (addr) ··· 62 64 */ 63 65 static inline void __change_bit(int nr, volatile unsigned long *addr) 64 66 { 65 - if (IS_IMMEDIATE(nr)) { 67 + if (__builtin_constant_p(nr)) { 66 68 __asm__ __volatile__ ( 67 69 "bxor.b %1, @(%O2,%0) ! __change_bit\n\t" 68 70 : "+r" (addr)
-2
arch/sh/include/uapi/asm/setup.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 - #include <asm-generic/setup.h>
-2
arch/sh/include/uapi/asm/types.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 - #include <asm-generic/types.h>
+2
arch/x86/Kconfig
··· 2932 2932 source "drivers/firmware/Kconfig" 2933 2933 2934 2934 source "arch/x86/kvm/Kconfig" 2935 + 2936 + source "arch/x86/Kconfig.assembler"
+17
arch/x86/Kconfig.assembler
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + # Copyright (C) 2020 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. 3 + 4 + config AS_AVX512 5 + def_bool $(as-instr,vpmovm2b %k1$(comma)%zmm5) 6 + help 7 + Supported by binutils >= 2.25 and LLVM integrated assembler 8 + 9 + config AS_SHA1_NI 10 + def_bool $(as-instr,sha1msg1 %xmm0$(comma)%xmm1) 11 + help 12 + Supported by binutils >= 2.24 and LLVM integrated assembler 13 + 14 + config AS_SHA256_NI 15 + def_bool $(as-instr,sha256msg1 %xmm0$(comma)%xmm1) 16 + help 17 + Supported by binutils >= 2.24 and LLVM integrated assembler
-22
arch/x86/Makefile
··· 177 177 KBUILD_CFLAGS += $(call cc-option,-maccumulate-outgoing-args,) 178 178 endif 179 179 180 - # Stackpointer is addressed different for 32 bit and 64 bit x86 181 - sp-$(CONFIG_X86_32) := esp 182 - sp-$(CONFIG_X86_64) := rsp 183 - 184 - # do binutils support CFI? 185 - cfi := $(call as-instr,.cfi_startproc\n.cfi_rel_offset $(sp-y)$(comma)0\n.cfi_endproc,-DCONFIG_AS_CFI=1) 186 - # is .cfi_signal_frame supported too? 187 - cfi-sigframe := $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1) 188 - cfi-sections := $(call as-instr,.cfi_sections .debug_frame,-DCONFIG_AS_CFI_SECTIONS=1) 189 - 190 - # does binutils support specific instructions? 191 - asinstr += $(call as-instr,pshufb %xmm0$(comma)%xmm0,-DCONFIG_AS_SSSE3=1) 192 - avx_instr := $(call as-instr,vxorps %ymm0$(comma)%ymm1$(comma)%ymm2,-DCONFIG_AS_AVX=1) 193 - avx2_instr :=$(call as-instr,vpbroadcastb %xmm0$(comma)%ymm1,-DCONFIG_AS_AVX2=1) 194 - avx512_instr :=$(call as-instr,vpmovm2b %k1$(comma)%zmm5,-DCONFIG_AS_AVX512=1) 195 - sha1_ni_instr :=$(call as-instr,sha1msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA1_NI=1) 196 - sha256_ni_instr :=$(call as-instr,sha256msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA256_NI=1) 197 - adx_instr := $(call as-instr,adox %r10$(comma)%r10,-DCONFIG_AS_ADX=1) 198 - 199 - KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) $(adx_instr) 200 - KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) $(adx_instr) 201 - 202 180 KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE) 203 181 204 182 #
+69 -103
arch/x86/crypto/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # 3 - # Arch-specific CryptoAPI modules. 4 - # 3 + # x86 crypto algorithms 5 4 6 5 OBJECT_FILES_NON_STANDARD := y 7 - 8 - avx_supported := $(call as-instr,vpxor %xmm0$(comma)%xmm0$(comma)%xmm0,yes,no) 9 - avx2_supported := $(call as-instr,vpgatherdd %ymm0$(comma)(%eax$(comma)%ymm1\ 10 - $(comma)4)$(comma)%ymm2,yes,no) 11 - avx512_supported :=$(call as-instr,vpmovm2b %k1$(comma)%zmm5,yes,no) 12 - sha1_ni_supported :=$(call as-instr,sha1msg1 %xmm0$(comma)%xmm1,yes,no) 13 - sha256_ni_supported :=$(call as-instr,sha256msg1 %xmm0$(comma)%xmm1,yes,no) 14 - adx_supported := $(call as-instr,adox %r10$(comma)%r10,yes,no) 15 6 16 7 obj-$(CONFIG_CRYPTO_GLUE_HELPER_X86) += glue_helper.o 17 8 18 9 obj-$(CONFIG_CRYPTO_TWOFISH_586) += twofish-i586.o 10 + twofish-i586-y := twofish-i586-asm_32.o twofish_glue.o 11 + obj-$(CONFIG_CRYPTO_TWOFISH_X86_64) += twofish-x86_64.o 12 + twofish-x86_64-y := twofish-x86_64-asm_64.o twofish_glue.o 13 + obj-$(CONFIG_CRYPTO_TWOFISH_X86_64_3WAY) += twofish-x86_64-3way.o 14 + twofish-x86_64-3way-y := twofish-x86_64-asm_64-3way.o twofish_glue_3way.o 15 + obj-$(CONFIG_CRYPTO_TWOFISH_AVX_X86_64) += twofish-avx-x86_64.o 16 + twofish-avx-x86_64-y := twofish-avx-x86_64-asm_64.o twofish_avx_glue.o 17 + 19 18 obj-$(CONFIG_CRYPTO_SERPENT_SSE2_586) += serpent-sse2-i586.o 19 + serpent-sse2-i586-y := serpent-sse2-i586-asm_32.o serpent_sse2_glue.o 20 + obj-$(CONFIG_CRYPTO_SERPENT_SSE2_X86_64) += serpent-sse2-x86_64.o 21 + serpent-sse2-x86_64-y := serpent-sse2-x86_64-asm_64.o serpent_sse2_glue.o 22 + obj-$(CONFIG_CRYPTO_SERPENT_AVX_X86_64) += serpent-avx-x86_64.o 23 + serpent-avx-x86_64-y := serpent-avx-x86_64-asm_64.o serpent_avx_glue.o 24 + obj-$(CONFIG_CRYPTO_SERPENT_AVX2_X86_64) += serpent-avx2.o 25 + serpent-avx2-y := serpent-avx2-asm_64.o serpent_avx2_glue.o 20 26 21 27 obj-$(CONFIG_CRYPTO_DES3_EDE_X86_64) += des3_ede-x86_64.o 22 - obj-$(CONFIG_CRYPTO_CAMELLIA_X86_64) += camellia-x86_64.o 23 - obj-$(CONFIG_CRYPTO_BLOWFISH_X86_64) += blowfish-x86_64.o 24 - obj-$(CONFIG_CRYPTO_TWOFISH_X86_64) += twofish-x86_64.o 25 - obj-$(CONFIG_CRYPTO_TWOFISH_X86_64_3WAY) += twofish-x86_64-3way.o 26 - obj-$(CONFIG_CRYPTO_CHACHA20_X86_64) += chacha-x86_64.o 27 - obj-$(CONFIG_CRYPTO_SERPENT_SSE2_X86_64) += serpent-sse2-x86_64.o 28 - obj-$(CONFIG_CRYPTO_AES_NI_INTEL) += aesni-intel.o 29 - obj-$(CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL) += ghash-clmulni-intel.o 28 + des3_ede-x86_64-y := des3_ede-asm_64.o des3_ede_glue.o 30 29 31 - obj-$(CONFIG_CRYPTO_CRC32C_INTEL) += crc32c-intel.o 32 - obj-$(CONFIG_CRYPTO_SHA1_SSSE3) += sha1-ssse3.o 33 - obj-$(CONFIG_CRYPTO_CRC32_PCLMUL) += crc32-pclmul.o 34 - obj-$(CONFIG_CRYPTO_SHA256_SSSE3) += sha256-ssse3.o 35 - obj-$(CONFIG_CRYPTO_SHA512_SSSE3) += sha512-ssse3.o 36 - obj-$(CONFIG_CRYPTO_CRCT10DIF_PCLMUL) += crct10dif-pclmul.o 37 - obj-$(CONFIG_CRYPTO_POLY1305_X86_64) += poly1305-x86_64.o 30 + obj-$(CONFIG_CRYPTO_CAMELLIA_X86_64) += camellia-x86_64.o 31 + camellia-x86_64-y := camellia-x86_64-asm_64.o camellia_glue.o 32 + obj-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64) += camellia-aesni-avx-x86_64.o 33 + camellia-aesni-avx-x86_64-y := camellia-aesni-avx-asm_64.o camellia_aesni_avx_glue.o 34 + obj-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64) += camellia-aesni-avx2.o 35 + camellia-aesni-avx2-y := camellia-aesni-avx2-asm_64.o camellia_aesni_avx2_glue.o 36 + 37 + obj-$(CONFIG_CRYPTO_BLOWFISH_X86_64) += blowfish-x86_64.o 38 + blowfish-x86_64-y := blowfish-x86_64-asm_64.o blowfish_glue.o 39 + 40 + obj-$(CONFIG_CRYPTO_CAST5_AVX_X86_64) += cast5-avx-x86_64.o 41 + cast5-avx-x86_64-y := cast5-avx-x86_64-asm_64.o cast5_avx_glue.o 42 + 43 + obj-$(CONFIG_CRYPTO_CAST6_AVX_X86_64) += cast6-avx-x86_64.o 44 + cast6-avx-x86_64-y := cast6-avx-x86_64-asm_64.o cast6_avx_glue.o 38 45 39 46 obj-$(CONFIG_CRYPTO_AEGIS128_AESNI_SSE2) += aegis128-aesni.o 40 - 41 - obj-$(CONFIG_CRYPTO_NHPOLY1305_SSE2) += nhpoly1305-sse2.o 42 - obj-$(CONFIG_CRYPTO_NHPOLY1305_AVX2) += nhpoly1305-avx2.o 43 - 44 - # These modules require the assembler to support ADX. 45 - ifeq ($(adx_supported),yes) 46 - obj-$(CONFIG_CRYPTO_CURVE25519_X86) += curve25519-x86_64.o 47 - endif 48 - 49 - # These modules require assembler to support AVX. 50 - ifeq ($(avx_supported),yes) 51 - obj-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64) += \ 52 - camellia-aesni-avx-x86_64.o 53 - obj-$(CONFIG_CRYPTO_CAST5_AVX_X86_64) += cast5-avx-x86_64.o 54 - obj-$(CONFIG_CRYPTO_CAST6_AVX_X86_64) += cast6-avx-x86_64.o 55 - obj-$(CONFIG_CRYPTO_TWOFISH_AVX_X86_64) += twofish-avx-x86_64.o 56 - obj-$(CONFIG_CRYPTO_SERPENT_AVX_X86_64) += serpent-avx-x86_64.o 57 - obj-$(CONFIG_CRYPTO_BLAKE2S_X86) += blake2s-x86_64.o 58 - endif 59 - 60 - # These modules require assembler to support AVX2. 61 - ifeq ($(avx2_supported),yes) 62 - obj-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64) += camellia-aesni-avx2.o 63 - obj-$(CONFIG_CRYPTO_SERPENT_AVX2_X86_64) += serpent-avx2.o 64 - endif 65 - 66 - twofish-i586-y := twofish-i586-asm_32.o twofish_glue.o 67 - serpent-sse2-i586-y := serpent-sse2-i586-asm_32.o serpent_sse2_glue.o 68 - 69 - des3_ede-x86_64-y := des3_ede-asm_64.o des3_ede_glue.o 70 - camellia-x86_64-y := camellia-x86_64-asm_64.o camellia_glue.o 71 - blowfish-x86_64-y := blowfish-x86_64-asm_64.o blowfish_glue.o 72 - twofish-x86_64-y := twofish-x86_64-asm_64.o twofish_glue.o 73 - twofish-x86_64-3way-y := twofish-x86_64-asm_64-3way.o twofish_glue_3way.o 74 - chacha-x86_64-y := chacha-ssse3-x86_64.o chacha_glue.o 75 - serpent-sse2-x86_64-y := serpent-sse2-x86_64-asm_64.o serpent_sse2_glue.o 76 - 77 47 aegis128-aesni-y := aegis128-aesni-asm.o aegis128-aesni-glue.o 78 48 79 - nhpoly1305-sse2-y := nh-sse2-x86_64.o nhpoly1305-sse2-glue.o 80 - blake2s-x86_64-y := blake2s-core.o blake2s-glue.o 81 - poly1305-x86_64-y := poly1305-x86_64-cryptogams.o poly1305_glue.o 82 - ifneq ($(CONFIG_CRYPTO_POLY1305_X86_64),) 83 - targets += poly1305-x86_64-cryptogams.S 84 - endif 49 + obj-$(CONFIG_CRYPTO_CHACHA20_X86_64) += chacha-x86_64.o 50 + chacha-x86_64-y := chacha-avx2-x86_64.o chacha-ssse3-x86_64.o chacha_glue.o 51 + chacha-x86_64-$(CONFIG_AS_AVX512) += chacha-avx512vl-x86_64.o 85 52 86 - ifeq ($(avx_supported),yes) 87 - camellia-aesni-avx-x86_64-y := camellia-aesni-avx-asm_64.o \ 88 - camellia_aesni_avx_glue.o 89 - cast5-avx-x86_64-y := cast5-avx-x86_64-asm_64.o cast5_avx_glue.o 90 - cast6-avx-x86_64-y := cast6-avx-x86_64-asm_64.o cast6_avx_glue.o 91 - twofish-avx-x86_64-y := twofish-avx-x86_64-asm_64.o \ 92 - twofish_avx_glue.o 93 - serpent-avx-x86_64-y := serpent-avx-x86_64-asm_64.o \ 94 - serpent_avx_glue.o 95 - endif 96 - 97 - ifeq ($(avx2_supported),yes) 98 - camellia-aesni-avx2-y := camellia-aesni-avx2-asm_64.o camellia_aesni_avx2_glue.o 99 - chacha-x86_64-y += chacha-avx2-x86_64.o 100 - serpent-avx2-y := serpent-avx2-asm_64.o serpent_avx2_glue.o 101 - 102 - nhpoly1305-avx2-y := nh-avx2-x86_64.o nhpoly1305-avx2-glue.o 103 - endif 104 - 105 - ifeq ($(avx512_supported),yes) 106 - chacha-x86_64-y += chacha-avx512vl-x86_64.o 107 - endif 108 - 53 + obj-$(CONFIG_CRYPTO_AES_NI_INTEL) += aesni-intel.o 109 54 aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o 110 55 aesni-intel-$(CONFIG_64BIT) += aesni-intel_avx-x86_64.o aes_ctrby8_avx-x86_64.o 56 + 57 + obj-$(CONFIG_CRYPTO_SHA1_SSSE3) += sha1-ssse3.o 58 + sha1-ssse3-y := sha1_avx2_x86_64_asm.o sha1_ssse3_asm.o sha1_ssse3_glue.o 59 + sha1-ssse3-$(CONFIG_AS_SHA1_NI) += sha1_ni_asm.o 60 + 61 + obj-$(CONFIG_CRYPTO_SHA256_SSSE3) += sha256-ssse3.o 62 + sha256-ssse3-y := sha256-ssse3-asm.o sha256-avx-asm.o sha256-avx2-asm.o sha256_ssse3_glue.o 63 + sha256-ssse3-$(CONFIG_AS_SHA256_NI) += sha256_ni_asm.o 64 + 65 + obj-$(CONFIG_CRYPTO_SHA512_SSSE3) += sha512-ssse3.o 66 + sha512-ssse3-y := sha512-ssse3-asm.o sha512-avx-asm.o sha512-avx2-asm.o sha512_ssse3_glue.o 67 + 68 + obj-$(CONFIG_CRYPTO_BLAKE2S_X86) += blake2s-x86_64.o 69 + blake2s-x86_64-y := blake2s-core.o blake2s-glue.o 70 + 71 + obj-$(CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL) += ghash-clmulni-intel.o 111 72 ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o 112 - sha1-ssse3-y := sha1_ssse3_asm.o sha1_ssse3_glue.o 113 - ifeq ($(avx2_supported),yes) 114 - sha1-ssse3-y += sha1_avx2_x86_64_asm.o 115 - endif 116 - ifeq ($(sha1_ni_supported),yes) 117 - sha1-ssse3-y += sha1_ni_asm.o 118 - endif 73 + 74 + obj-$(CONFIG_CRYPTO_CRC32C_INTEL) += crc32c-intel.o 119 75 crc32c-intel-y := crc32c-intel_glue.o 120 76 crc32c-intel-$(CONFIG_64BIT) += crc32c-pcl-intel-asm_64.o 77 + 78 + obj-$(CONFIG_CRYPTO_CRC32_PCLMUL) += crc32-pclmul.o 121 79 crc32-pclmul-y := crc32-pclmul_asm.o crc32-pclmul_glue.o 122 - sha256-ssse3-y := sha256-ssse3-asm.o sha256-avx-asm.o sha256-avx2-asm.o sha256_ssse3_glue.o 123 - ifeq ($(sha256_ni_supported),yes) 124 - sha256-ssse3-y += sha256_ni_asm.o 125 - endif 126 - sha512-ssse3-y := sha512-ssse3-asm.o sha512-avx-asm.o sha512-avx2-asm.o sha512_ssse3_glue.o 80 + 81 + obj-$(CONFIG_CRYPTO_CRCT10DIF_PCLMUL) += crct10dif-pclmul.o 127 82 crct10dif-pclmul-y := crct10dif-pcl-asm_64.o crct10dif-pclmul_glue.o 83 + 84 + obj-$(CONFIG_CRYPTO_POLY1305_X86_64) += poly1305-x86_64.o 85 + poly1305-x86_64-y := poly1305-x86_64-cryptogams.o poly1305_glue.o 86 + targets += poly1305-x86_64-cryptogams.S 87 + 88 + obj-$(CONFIG_CRYPTO_NHPOLY1305_SSE2) += nhpoly1305-sse2.o 89 + nhpoly1305-sse2-y := nh-sse2-x86_64.o nhpoly1305-sse2-glue.o 90 + obj-$(CONFIG_CRYPTO_NHPOLY1305_AVX2) += nhpoly1305-avx2.o 91 + nhpoly1305-avx2-y := nh-avx2-x86_64.o nhpoly1305-avx2-glue.o 92 + 93 + obj-$(CONFIG_CRYPTO_CURVE25519_X86) += curve25519-x86_64.o 128 94 129 95 quiet_cmd_perlasm = PERLASM $@ 130 96 cmd_perlasm = $(PERL) $< > $@
-6
arch/x86/crypto/aesni-intel_avx-x86_64.S
··· 886 886 _partial_block_done_\@: 887 887 .endm # PARTIAL_BLOCK 888 888 889 - #ifdef CONFIG_AS_AVX 890 889 ############################################################################### 891 890 # GHASH_MUL MACRO to implement: Data*HashKey mod (128,127,126,121,0) 892 891 # Input: A and B (128-bits each, bit-reflected) ··· 1868 1869 ret 1869 1870 SYM_FUNC_END(aesni_gcm_finalize_avx_gen2) 1870 1871 1871 - #endif /* CONFIG_AS_AVX */ 1872 - 1873 - #ifdef CONFIG_AS_AVX2 1874 1872 ############################################################################### 1875 1873 # GHASH_MUL MACRO to implement: Data*HashKey mod (128,127,126,121,0) 1876 1874 # Input: A and B (128-bits each, bit-reflected) ··· 2835 2839 FUNC_RESTORE 2836 2840 ret 2837 2841 SYM_FUNC_END(aesni_gcm_finalize_avx_gen4) 2838 - 2839 - #endif /* CONFIG_AS_AVX2 */
+1 -20
arch/x86/crypto/aesni-intel_glue.c
··· 185 185 .finalize = &aesni_gcm_finalize, 186 186 }; 187 187 188 - #ifdef CONFIG_AS_AVX 189 188 asmlinkage void aes_ctr_enc_128_avx_by8(const u8 *in, u8 *iv, 190 189 void *keys, u8 *out, unsigned int num_bytes); 191 190 asmlinkage void aes_ctr_enc_192_avx_by8(const u8 *in, u8 *iv, ··· 233 234 .finalize = &aesni_gcm_finalize_avx_gen2, 234 235 }; 235 236 236 - #endif 237 - 238 - #ifdef CONFIG_AS_AVX2 239 237 /* 240 238 * asmlinkage void aesni_gcm_init_avx_gen4() 241 239 * gcm_data *my_ctx_data, context data ··· 274 278 .dec_update = &aesni_gcm_dec_update_avx_gen4, 275 279 .finalize = &aesni_gcm_finalize_avx_gen4, 276 280 }; 277 - 278 - #endif 279 281 280 282 static inline struct 281 283 aesni_rfc4106_gcm_ctx *aesni_rfc4106_gcm_ctx_get(struct crypto_aead *tfm) ··· 470 476 crypto_inc(ctrblk, AES_BLOCK_SIZE); 471 477 } 472 478 473 - #ifdef CONFIG_AS_AVX 474 479 static void aesni_ctr_enc_avx_tfm(struct crypto_aes_ctx *ctx, u8 *out, 475 480 const u8 *in, unsigned int len, u8 *iv) 476 481 { ··· 486 493 else 487 494 aes_ctr_enc_256_avx_by8(in, iv, (void *)ctx, out, len); 488 495 } 489 - #endif 490 496 491 497 static int ctr_crypt(struct skcipher_request *req) 492 498 { ··· 703 711 if (!enc) 704 712 left -= auth_tag_len; 705 713 706 - #ifdef CONFIG_AS_AVX2 707 714 if (left < AVX_GEN4_OPTSIZE && gcm_tfm == &aesni_gcm_tfm_avx_gen4) 708 715 gcm_tfm = &aesni_gcm_tfm_avx_gen2; 709 - #endif 710 - #ifdef CONFIG_AS_AVX 711 716 if (left < AVX_GEN2_OPTSIZE && gcm_tfm == &aesni_gcm_tfm_avx_gen2) 712 717 gcm_tfm = &aesni_gcm_tfm_sse; 713 - #endif 714 718 715 719 /* Linearize assoc, if not already linear */ 716 720 if (req->src->length >= assoclen && req->src->length && ··· 1064 1076 if (!x86_match_cpu(aesni_cpu_id)) 1065 1077 return -ENODEV; 1066 1078 #ifdef CONFIG_X86_64 1067 - #ifdef CONFIG_AS_AVX2 1068 1079 if (boot_cpu_has(X86_FEATURE_AVX2)) { 1069 1080 pr_info("AVX2 version of gcm_enc/dec engaged.\n"); 1070 1081 aesni_gcm_tfm = &aesni_gcm_tfm_avx_gen4; 1071 1082 } else 1072 - #endif 1073 - #ifdef CONFIG_AS_AVX 1074 1083 if (boot_cpu_has(X86_FEATURE_AVX)) { 1075 1084 pr_info("AVX version of gcm_enc/dec engaged.\n"); 1076 1085 aesni_gcm_tfm = &aesni_gcm_tfm_avx_gen2; 1077 - } else 1078 - #endif 1079 - { 1086 + } else { 1080 1087 pr_info("SSE version of gcm_enc/dec engaged.\n"); 1081 1088 aesni_gcm_tfm = &aesni_gcm_tfm_sse; 1082 1089 } 1083 1090 aesni_ctr_enc_tfm = aesni_ctr_enc; 1084 - #ifdef CONFIG_AS_AVX 1085 1091 if (boot_cpu_has(X86_FEATURE_AVX)) { 1086 1092 /* optimize performance of ctr mode encryption transform */ 1087 1093 aesni_ctr_enc_tfm = aesni_ctr_enc_avx_tfm; 1088 1094 pr_info("AES CTR mode by8 optimization enabled\n"); 1089 1095 } 1090 - #endif 1091 1096 #endif 1092 1097 1093 1098 err = crypto_register_alg(&aesni_cipher_alg);
-2
arch/x86/crypto/blake2s-core.S
··· 46 46 #endif /* CONFIG_AS_AVX512 */ 47 47 48 48 .text 49 - #ifdef CONFIG_AS_SSSE3 50 49 SYM_FUNC_START(blake2s_compress_ssse3) 51 50 testq %rdx,%rdx 52 51 je .Lendofloop ··· 173 174 .Lendofloop: 174 175 ret 175 176 SYM_FUNC_END(blake2s_compress_ssse3) 176 - #endif /* CONFIG_AS_SSSE3 */ 177 177 178 178 #ifdef CONFIG_AS_AVX512 179 179 SYM_FUNC_START(blake2s_compress_avx512)
+2 -4
arch/x86/crypto/chacha_glue.c
··· 79 79 } 80 80 } 81 81 82 - if (IS_ENABLED(CONFIG_AS_AVX2) && 83 - static_branch_likely(&chacha_use_avx2)) { 82 + if (static_branch_likely(&chacha_use_avx2)) { 84 83 while (bytes >= CHACHA_BLOCK_SIZE * 8) { 85 84 chacha_8block_xor_avx2(state, dst, src, bytes, nrounds); 86 85 bytes -= CHACHA_BLOCK_SIZE * 8; ··· 287 288 288 289 static_branch_enable(&chacha_use_simd); 289 290 290 - if (IS_ENABLED(CONFIG_AS_AVX2) && 291 - boot_cpu_has(X86_FEATURE_AVX) && 291 + if (boot_cpu_has(X86_FEATURE_AVX) && 292 292 boot_cpu_has(X86_FEATURE_AVX2) && 293 293 cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL)) { 294 294 static_branch_enable(&chacha_use_avx2);
-16
arch/x86/crypto/poly1305-x86_64-cryptogams.pl
··· 404 404 &end_function("poly1305_emit_x86_64"); 405 405 if ($avx) { 406 406 407 - if($kernel) { 408 - $code .= "#ifdef CONFIG_AS_AVX\n"; 409 - } 410 - 411 407 ######################################################################## 412 408 # Layout of opaque area is following. 413 409 # ··· 1512 1516 ___ 1513 1517 &end_function("poly1305_emit_avx"); 1514 1518 1515 - if ($kernel) { 1516 - $code .= "#endif\n"; 1517 - } 1518 - 1519 1519 if ($avx>1) { 1520 - 1521 - if ($kernel) { 1522 - $code .= "#ifdef CONFIG_AS_AVX2\n"; 1523 - } 1524 1520 1525 1521 my ($H0,$H1,$H2,$H3,$H4, $MASK, $T4,$T0,$T1,$T2,$T3, $D0,$D1,$D2,$D3,$D4) = 1526 1522 map("%ymm$_",(0..15)); ··· 2803 2815 &declare_function("poly1305_blocks_avx2", 32, 4); 2804 2816 poly1305_blocks_avxN(0); 2805 2817 &end_function("poly1305_blocks_avx2"); 2806 - 2807 - if($kernel) { 2808 - $code .= "#endif\n"; 2809 - } 2810 2818 2811 2819 ####################################################################### 2812 2820 if ($avx>2) {
+5 -6
arch/x86/crypto/poly1305_glue.c
··· 94 94 BUILD_BUG_ON(PAGE_SIZE < POLY1305_BLOCK_SIZE || 95 95 PAGE_SIZE % POLY1305_BLOCK_SIZE); 96 96 97 - if (!IS_ENABLED(CONFIG_AS_AVX) || !static_branch_likely(&poly1305_use_avx) || 97 + if (!static_branch_likely(&poly1305_use_avx) || 98 98 (len < (POLY1305_BLOCK_SIZE * 18) && !state->is_base2_26) || 99 99 !crypto_simd_usable()) { 100 100 convert_to_base2_64(ctx); ··· 108 108 kernel_fpu_begin(); 109 109 if (IS_ENABLED(CONFIG_AS_AVX512) && static_branch_likely(&poly1305_use_avx512)) 110 110 poly1305_blocks_avx512(ctx, inp, bytes, padbit); 111 - else if (IS_ENABLED(CONFIG_AS_AVX2) && static_branch_likely(&poly1305_use_avx2)) 111 + else if (static_branch_likely(&poly1305_use_avx2)) 112 112 poly1305_blocks_avx2(ctx, inp, bytes, padbit); 113 113 else 114 114 poly1305_blocks_avx(ctx, inp, bytes, padbit); ··· 123 123 static void poly1305_simd_emit(void *ctx, u8 mac[POLY1305_DIGEST_SIZE], 124 124 const u32 nonce[4]) 125 125 { 126 - if (!IS_ENABLED(CONFIG_AS_AVX) || !static_branch_likely(&poly1305_use_avx)) 126 + if (!static_branch_likely(&poly1305_use_avx)) 127 127 poly1305_emit_x86_64(ctx, mac, nonce); 128 128 else 129 129 poly1305_emit_avx(ctx, mac, nonce); ··· 261 261 262 262 static int __init poly1305_simd_mod_init(void) 263 263 { 264 - if (IS_ENABLED(CONFIG_AS_AVX) && boot_cpu_has(X86_FEATURE_AVX) && 264 + if (boot_cpu_has(X86_FEATURE_AVX) && 265 265 cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL)) 266 266 static_branch_enable(&poly1305_use_avx); 267 - if (IS_ENABLED(CONFIG_AS_AVX2) && boot_cpu_has(X86_FEATURE_AVX) && 268 - boot_cpu_has(X86_FEATURE_AVX2) && 267 + if (boot_cpu_has(X86_FEATURE_AVX) && boot_cpu_has(X86_FEATURE_AVX2) && 269 268 cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL)) 270 269 static_branch_enable(&poly1305_use_avx2); 271 270 if (IS_ENABLED(CONFIG_AS_AVX512) && boot_cpu_has(X86_FEATURE_AVX) &&
-4
arch/x86/crypto/sha1_ssse3_asm.S
··· 467 467 */ 468 468 SHA1_VECTOR_ASM sha1_transform_ssse3 469 469 470 - #ifdef CONFIG_AS_AVX 471 - 472 470 .macro W_PRECALC_AVX 473 471 474 472 .purgem W_PRECALC_00_15 ··· 551 553 * const u8 *data, int blocks); 552 554 */ 553 555 SHA1_VECTOR_ASM sha1_transform_avx 554 - 555 - #endif
-13
arch/x86/crypto/sha1_ssse3_glue.c
··· 114 114 crypto_unregister_shash(&sha1_ssse3_alg); 115 115 } 116 116 117 - #ifdef CONFIG_AS_AVX 118 117 asmlinkage void sha1_transform_avx(struct sha1_state *state, 119 118 const u8 *data, int blocks); 120 119 ··· 174 175 crypto_unregister_shash(&sha1_avx_alg); 175 176 } 176 177 177 - #else /* CONFIG_AS_AVX */ 178 - static inline int register_sha1_avx(void) { return 0; } 179 - static inline void unregister_sha1_avx(void) { } 180 - #endif /* CONFIG_AS_AVX */ 181 - 182 - 183 - #if defined(CONFIG_AS_AVX2) && (CONFIG_AS_AVX) 184 178 #define SHA1_AVX2_BLOCK_OPTSIZE 4 /* optimal 4*64 bytes of SHA1 blocks */ 185 179 186 180 asmlinkage void sha1_transform_avx2(struct sha1_state *state, ··· 244 252 if (avx2_usable()) 245 253 crypto_unregister_shash(&sha1_avx2_alg); 246 254 } 247 - 248 - #else 249 - static inline int register_sha1_avx2(void) { return 0; } 250 - static inline void unregister_sha1_avx2(void) { } 251 - #endif 252 255 253 256 #ifdef CONFIG_AS_SHA1_NI 254 257 asmlinkage void sha1_ni_transform(struct sha1_state *digest, const u8 *data,
-3
arch/x86/crypto/sha256-avx-asm.S
··· 47 47 # This code schedules 1 block at a time, with 4 lanes per block 48 48 ######################################################################## 49 49 50 - #ifdef CONFIG_AS_AVX 51 50 #include <linux/linkage.h> 52 51 53 52 ## assume buffers not aligned ··· 497 498 # shuffle xDxC -> DC00 498 499 _SHUF_DC00: 499 500 .octa 0x0b0a090803020100FFFFFFFFFFFFFFFF 500 - 501 - #endif
-3
arch/x86/crypto/sha256-avx2-asm.S
··· 48 48 # This code schedules 2 blocks at a time, with 4 lanes per block 49 49 ######################################################################## 50 50 51 - #ifdef CONFIG_AS_AVX2 52 51 #include <linux/linkage.h> 53 52 54 53 ## assume buffers not aligned ··· 766 767 .align 32 767 768 _SHUF_DC00: 768 769 .octa 0x0b0a090803020100FFFFFFFFFFFFFFFF,0x0b0a090803020100FFFFFFFFFFFFFFFF 769 - 770 - #endif
-12
arch/x86/crypto/sha256_ssse3_glue.c
··· 144 144 ARRAY_SIZE(sha256_ssse3_algs)); 145 145 } 146 146 147 - #ifdef CONFIG_AS_AVX 148 147 asmlinkage void sha256_transform_avx(struct sha256_state *state, 149 148 const u8 *data, int blocks); 150 149 ··· 220 221 ARRAY_SIZE(sha256_avx_algs)); 221 222 } 222 223 223 - #else 224 - static inline int register_sha256_avx(void) { return 0; } 225 - static inline void unregister_sha256_avx(void) { } 226 - #endif 227 - 228 - #if defined(CONFIG_AS_AVX2) && defined(CONFIG_AS_AVX) 229 224 asmlinkage void sha256_transform_rorx(struct sha256_state *state, 230 225 const u8 *data, int blocks); 231 226 ··· 293 300 crypto_unregister_shashes(sha256_avx2_algs, 294 301 ARRAY_SIZE(sha256_avx2_algs)); 295 302 } 296 - 297 - #else 298 - static inline int register_sha256_avx2(void) { return 0; } 299 - static inline void unregister_sha256_avx2(void) { } 300 - #endif 301 303 302 304 #ifdef CONFIG_AS_SHA256_NI 303 305 asmlinkage void sha256_ni_transform(struct sha256_state *digest,
-2
arch/x86/crypto/sha512-avx-asm.S
··· 47 47 # 48 48 ######################################################################## 49 49 50 - #ifdef CONFIG_AS_AVX 51 50 #include <linux/linkage.h> 52 51 53 52 .text ··· 423 424 .quad 0x3c9ebe0a15c9bebc,0x431d67c49c100d4c 424 425 .quad 0x4cc5d4becb3e42b6,0x597f299cfc657e2a 425 426 .quad 0x5fcb6fab3ad6faec,0x6c44198c4a475817 426 - #endif
-3
arch/x86/crypto/sha512-avx2-asm.S
··· 49 49 # This code schedules 1 blocks at a time, with 4 lanes per block 50 50 ######################################################################## 51 51 52 - #ifdef CONFIG_AS_AVX2 53 52 #include <linux/linkage.h> 54 53 55 54 .text ··· 748 749 MASK_YMM_LO: 749 750 .octa 0x00000000000000000000000000000000 750 751 .octa 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 751 - 752 - #endif
-10
arch/x86/crypto/sha512_ssse3_glue.c
··· 142 142 ARRAY_SIZE(sha512_ssse3_algs)); 143 143 } 144 144 145 - #ifdef CONFIG_AS_AVX 146 145 asmlinkage void sha512_transform_avx(struct sha512_state *state, 147 146 const u8 *data, int blocks); 148 147 static bool avx_usable(void) ··· 217 218 crypto_unregister_shashes(sha512_avx_algs, 218 219 ARRAY_SIZE(sha512_avx_algs)); 219 220 } 220 - #else 221 - static inline int register_sha512_avx(void) { return 0; } 222 - static inline void unregister_sha512_avx(void) { } 223 - #endif 224 221 225 - #if defined(CONFIG_AS_AVX2) && defined(CONFIG_AS_AVX) 226 222 asmlinkage void sha512_transform_rorx(struct sha512_state *state, 227 223 const u8 *data, int blocks); 228 224 ··· 292 298 crypto_unregister_shashes(sha512_avx2_algs, 293 299 ARRAY_SIZE(sha512_avx2_algs)); 294 300 } 295 - #else 296 - static inline int register_sha512_avx2(void) { return 0; } 297 - static inline void unregister_sha512_avx2(void) { } 298 - #endif 299 301 300 302 static int __init sha512_ssse3_mod_init(void) 301 303 {
-44
arch/x86/include/asm/dwarf2.h
··· 6 6 #warning "asm/dwarf2.h should be only included in pure assembly files" 7 7 #endif 8 8 9 - /* 10 - * Macros for dwarf2 CFI unwind table entries. 11 - * See "as.info" for details on these pseudo ops. Unfortunately 12 - * they are only supported in very new binutils, so define them 13 - * away for older version. 14 - */ 15 - 16 - #ifdef CONFIG_AS_CFI 17 - 18 9 #define CFI_STARTPROC .cfi_startproc 19 10 #define CFI_ENDPROC .cfi_endproc 20 11 #define CFI_DEF_CFA .cfi_def_cfa ··· 21 30 #define CFI_UNDEFINED .cfi_undefined 22 31 #define CFI_ESCAPE .cfi_escape 23 32 24 - #ifdef CONFIG_AS_CFI_SIGNAL_FRAME 25 - #define CFI_SIGNAL_FRAME .cfi_signal_frame 26 - #else 27 - #define CFI_SIGNAL_FRAME 28 - #endif 29 - 30 - #if defined(CONFIG_AS_CFI_SECTIONS) && defined(__ASSEMBLY__) 31 33 #ifndef BUILD_VDSO 32 34 /* 33 35 * Emit CFI data in .debug_frame sections, not .eh_frame sections. ··· 36 52 * symbols for the .dbg file. 37 53 */ 38 54 .cfi_sections .eh_frame, .debug_frame 39 - #endif 40 - #endif 41 - 42 - #else 43 - 44 - /* 45 - * Due to the structure of pre-exisiting code, don't use assembler line 46 - * comment character # to ignore the arguments. Instead, use a dummy macro. 47 - */ 48 - .macro cfi_ignore a=0, b=0, c=0, d=0 49 - .endm 50 - 51 - #define CFI_STARTPROC cfi_ignore 52 - #define CFI_ENDPROC cfi_ignore 53 - #define CFI_DEF_CFA cfi_ignore 54 - #define CFI_DEF_CFA_REGISTER cfi_ignore 55 - #define CFI_DEF_CFA_OFFSET cfi_ignore 56 - #define CFI_ADJUST_CFA_OFFSET cfi_ignore 57 - #define CFI_OFFSET cfi_ignore 58 - #define CFI_REL_OFFSET cfi_ignore 59 - #define CFI_REGISTER cfi_ignore 60 - #define CFI_RESTORE cfi_ignore 61 - #define CFI_REMEMBER_STATE cfi_ignore 62 - #define CFI_RESTORE_STATE cfi_ignore 63 - #define CFI_UNDEFINED cfi_ignore 64 - #define CFI_ESCAPE cfi_ignore 65 - #define CFI_SIGNAL_FRAME cfi_ignore 66 - 67 55 #endif 68 56 69 57 #endif /* _ASM_X86_DWARF2_H */
-9
arch/x86/include/asm/xor_avx.h
··· 11 11 * Based on Ingo Molnar and Zach Brown's respective MMX and SSE routines 12 12 */ 13 13 14 - #ifdef CONFIG_AS_AVX 15 - 16 14 #include <linux/compiler.h> 17 15 #include <asm/fpu/api.h> 18 16 ··· 168 170 #define AVX_SELECT(FASTEST) \ 169 171 (boot_cpu_has(X86_FEATURE_AVX) && boot_cpu_has(X86_FEATURE_OSXSAVE) ? &xor_block_avx : FASTEST) 170 172 171 - #else 172 - 173 - #define AVX_XOR_SPEED {} 174 - 175 - #define AVX_SELECT(FASTEST) (FASTEST) 176 - 177 - #endif 178 173 #endif
-3
drivers/gpu/drm/i915/Makefile
··· 28 28 CFLAGS_i915_pci.o = $(call cc-disable-warning, override-init) 29 29 CFLAGS_display/intel_fbdev.o = $(call cc-disable-warning, override-init) 30 30 31 - subdir-ccflags-y += \ 32 - $(call as-instr,movntdqa (%eax)$(comma)%xmm0,-DCONFIG_AS_MOVNTDQA) 33 - 34 31 subdir-ccflags-y += -I$(srctree)/$(src) 35 32 36 33 # Please keep these build lists sorted!
-5
drivers/gpu/drm/i915/i915_memcpy.c
··· 35 35 36 36 static DEFINE_STATIC_KEY_FALSE(has_movntdqa); 37 37 38 - #ifdef CONFIG_AS_MOVNTDQA 39 38 static void __memcpy_ntdqa(void *dst, const void *src, unsigned long len) 40 39 { 41 40 kernel_fpu_begin(); ··· 92 93 93 94 kernel_fpu_end(); 94 95 } 95 - #else 96 - static void __memcpy_ntdqa(void *dst, const void *src, unsigned long len) {} 97 - static void __memcpy_ntdqu(void *dst, const void *src, unsigned long len) {} 98 - #endif 99 96 100 97 /** 101 98 * i915_memcpy_from_wc: perform an accelerated *aligned* read from WC
+2 -4
include/crypto/curve25519.h
··· 33 33 const u8 secret[CURVE25519_KEY_SIZE], 34 34 const u8 basepoint[CURVE25519_KEY_SIZE]) 35 35 { 36 - if (IS_ENABLED(CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519) && 37 - (!IS_ENABLED(CONFIG_CRYPTO_CURVE25519_X86) || IS_ENABLED(CONFIG_AS_ADX))) 36 + if (IS_ENABLED(CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519)) 38 37 curve25519_arch(mypublic, secret, basepoint); 39 38 else 40 39 curve25519_generic(mypublic, secret, basepoint); ··· 49 50 CURVE25519_KEY_SIZE))) 50 51 return false; 51 52 52 - if (IS_ENABLED(CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519) && 53 - (!IS_ENABLED(CONFIG_CRYPTO_CURVE25519_X86) || IS_ENABLED(CONFIG_AS_ADX))) 53 + if (IS_ENABLED(CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519)) 54 54 curve25519_base_arch(pub, secret); 55 55 else 56 56 curve25519_generic(pub, secret, curve25519_base_point);
+1 -1
init/Makefile
··· 35 35 @$($(quiet)chk_compile.h) 36 36 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ 37 37 "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" \ 38 - "$(CONFIG_PREEMPT_RT)" "$(CC) $(KBUILD_CFLAGS)" 38 + "$(CONFIG_PREEMPT_RT)" "$(CC)" "$(LD)"
+1 -7
lib/raid6/algos.c
··· 34 34 &raid6_avx512x2, 35 35 &raid6_avx512x1, 36 36 #endif 37 - #ifdef CONFIG_AS_AVX2 38 37 &raid6_avx2x2, 39 38 &raid6_avx2x1, 40 - #endif 41 39 &raid6_sse2x2, 42 40 &raid6_sse2x1, 43 41 &raid6_sse1x2, ··· 49 51 &raid6_avx512x2, 50 52 &raid6_avx512x1, 51 53 #endif 52 - #ifdef CONFIG_AS_AVX2 53 54 &raid6_avx2x4, 54 55 &raid6_avx2x2, 55 56 &raid6_avx2x1, 56 - #endif 57 57 &raid6_sse2x4, 58 58 &raid6_sse2x2, 59 59 &raid6_sse2x1, ··· 93 97 EXPORT_SYMBOL_GPL(raid6_datap_recov); 94 98 95 99 const struct raid6_recov_calls *const raid6_recov_algos[] = { 100 + #ifdef CONFIG_X86 96 101 #ifdef CONFIG_AS_AVX512 97 102 &raid6_recov_avx512, 98 103 #endif 99 - #ifdef CONFIG_AS_AVX2 100 104 &raid6_recov_avx2, 101 - #endif 102 - #ifdef CONFIG_AS_SSSE3 103 105 &raid6_recov_ssse3, 104 106 #endif 105 107 #ifdef CONFIG_S390
-4
lib/raid6/avx2.c
··· 13 13 * 14 14 */ 15 15 16 - #ifdef CONFIG_AS_AVX2 17 - 18 16 #include <linux/raid/pq.h> 19 17 #include "x86.h" 20 18 ··· 468 470 1 /* Has cache hints */ 469 471 }; 470 472 #endif 471 - 472 - #endif /* CONFIG_AS_AVX2 */
-6
lib/raid6/recov_avx2.c
··· 4 4 * Author: Jim Kukunas <james.t.kukunas@linux.intel.com> 5 5 */ 6 6 7 - #ifdef CONFIG_AS_AVX2 8 - 9 7 #include <linux/raid/pq.h> 10 8 #include "x86.h" 11 9 ··· 311 313 #endif 312 314 .priority = 2, 313 315 }; 314 - 315 - #else 316 - #warning "your version of binutils lacks AVX2 support" 317 - #endif
-6
lib/raid6/recov_ssse3.c
··· 3 3 * Copyright (C) 2012 Intel Corporation 4 4 */ 5 5 6 - #ifdef CONFIG_AS_SSSE3 7 - 8 6 #include <linux/raid/pq.h> 9 7 #include "x86.h" 10 8 ··· 326 328 #endif 327 329 .priority = 1, 328 330 }; 329 - 330 - #else 331 - #warning "your version of binutils lacks SSSE3 support" 332 - #endif
+2 -7
lib/raid6/test/Makefile
··· 34 34 35 35 ifeq ($(IS_X86),yes) 36 36 OBJS += mmx.o sse1.o sse2.o avx2.o recov_ssse3.o recov_avx2.o avx512.o recov_avx512.o 37 - CFLAGS += $(shell echo "pshufb %xmm0, %xmm0" | \ 38 - gcc -c -x assembler - >&/dev/null && \ 39 - rm ./-.o && echo -DCONFIG_AS_SSSE3=1) 40 - CFLAGS += $(shell echo "vpbroadcastb %xmm0, %ymm1" | \ 41 - gcc -c -x assembler - >&/dev/null && \ 42 - rm ./-.o && echo -DCONFIG_AS_AVX2=1) 37 + CFLAGS += -DCONFIG_X86 43 38 CFLAGS += $(shell echo "vpmovm2b %k1, %zmm5" | \ 44 - gcc -c -x assembler - >&/dev/null && \ 39 + gcc -c -x assembler - >/dev/null 2>&1 && \ 45 40 rm ./-.o && echo -DCONFIG_AS_AVX512=1) 46 41 else ifeq ($(HAS_NEON),yes) 47 42 OBJS += neon.o neon1.o neon2.o neon4.o neon8.o recov_neon.o recov_neon_inner.o
+1 -1
net/netfilter/Makefile
··· 83 83 nft_set_pipapo.o 84 84 85 85 ifdef CONFIG_X86_64 86 - ifneq (,$(findstring -DCONFIG_AS_AVX2=1,$(KBUILD_CFLAGS))) 86 + ifndef CONFIG_UML 87 87 nf_tables-objs += nft_set_pipapo_avx2.o 88 88 endif 89 89 endif
+1 -1
net/netfilter/nf_tables_api.c
··· 3291 3291 &nft_set_rhash_type, 3292 3292 &nft_set_bitmap_type, 3293 3293 &nft_set_rbtree_type, 3294 - #if defined(CONFIG_X86_64) && defined(CONFIG_AS_AVX2) 3294 + #if defined(CONFIG_X86_64) && !defined(CONFIG_UML) 3295 3295 &nft_set_pipapo_avx2_type, 3296 3296 #endif 3297 3297 &nft_set_pipapo_type,
+1 -1
net/netfilter/nft_set_pipapo.c
··· 2201 2201 }, 2202 2202 }; 2203 2203 2204 - #if defined(CONFIG_X86_64) && defined(CONFIG_AS_AVX2) 2204 + #if defined(CONFIG_X86_64) && !defined(CONFIG_UML) 2205 2205 const struct nft_set_type nft_set_pipapo_avx2_type = { 2206 2206 .features = NFT_SET_INTERVAL | NFT_SET_MAP | NFT_SET_OBJECT | 2207 2207 NFT_SET_TIMEOUT,
+2 -2
net/netfilter/nft_set_pipapo_avx2.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 2 #ifndef _NFT_SET_PIPAPO_AVX2_H 3 3 4 - #ifdef CONFIG_AS_AVX2 4 + #if defined(CONFIG_X86_64) && !defined(CONFIG_UML) 5 5 #include <asm/fpu/xstate.h> 6 6 #define NFT_PIPAPO_ALIGN (XSAVE_YMM_SIZE / BITS_PER_BYTE) 7 7 ··· 9 9 const u32 *key, const struct nft_set_ext **ext); 10 10 bool nft_pipapo_avx2_estimate(const struct nft_set_desc *desc, u32 features, 11 11 struct nft_set_estimate *est); 12 - #endif /* CONFIG_AS_AVX2 */ 12 + #endif /* defined(CONFIG_X86_64) && !defined(CONFIG_UML) */ 13 13 14 14 #endif /* _NFT_SET_PIPAPO_AVX2_H */
-3
scripts/Kconfig.include
··· 48 48 # Fail if the linker is gold as it's not capable of linking the kernel proper 49 49 $(error-if,$(success, $(LD) -v | grep -q gold), gold linker '$(LD)' not supported) 50 50 51 - # gcc version including patch level 52 - gcc-version := $(shell,$(srctree)/scripts/gcc-version.sh $(CC)) 53 - 54 51 # machine bit flags 55 52 # $(m32-flag): -m32 if the compiler supports it, or an empty string otherwise. 56 53 # $(m64-flag): -m64 if the compiler supports it, or an empty string otherwise.
-4
scripts/Makefile
··· 2 2 ### 3 3 # scripts contains sources for various helper programs used throughout 4 4 # the kernel for the build process. 5 - # --------------------------------------------------------------------------- 6 - # kallsyms: Find all symbols in vmlinux 7 - 8 - HOST_EXTRACFLAGS += -I$(srctree)/tools/include 9 5 10 6 always-$(CONFIG_BUILD_BIN2C) += bin2c 11 7 always-$(CONFIG_KALLSYMS) += kallsyms
+1 -18
scripts/Makefile.build
··· 46 46 include scripts/Makefile.lib 47 47 48 48 # Do not include host rules unless needed 49 - ifneq ($(hostprogs)$(hostlibs-y)$(hostlibs-m)$(hostcxxlibs-y)$(hostcxxlibs-m),) 49 + ifneq ($(hostprogs)$(hostcxxlibs-y)$(hostcxxlibs-m),) 50 50 include scripts/Makefile.host 51 51 endif 52 52 ··· 65 65 66 66 ifneq ($(strip $(lib-y) $(lib-m) $(lib-)),) 67 67 lib-target := $(obj)/lib.a 68 - real-obj-y += $(obj)/lib-ksyms.o 69 68 endif 70 69 71 70 ifdef need-builtin ··· 408 409 $(call if_changed,ar) 409 410 410 411 targets += $(lib-target) 411 - 412 - dummy-object = $(obj)/.lib_exports.o 413 - ksyms-lds = $(dot-target).lds 414 - 415 - quiet_cmd_export_list = EXPORTS $@ 416 - cmd_export_list = $(OBJDUMP) -h $< | \ 417 - sed -ne '/___ksymtab/s/.*+\([^ ]*\).*/EXTERN(\1)/p' >$(ksyms-lds);\ 418 - rm -f $(dummy-object);\ 419 - echo | $(CC) $(a_flags) -c -o $(dummy-object) -x assembler -;\ 420 - $(LD) $(ld_flags) -r -o $@ -T $(ksyms-lds) $(dummy-object);\ 421 - rm $(dummy-object) $(ksyms-lds) 422 - 423 - $(obj)/lib-ksyms.o: $(lib-target) FORCE 424 - $(call if_changed,export_list) 425 - 426 - targets += $(obj)/lib-ksyms.o 427 412 428 413 endif 429 414
-1
scripts/Makefile.clean
··· 30 30 __clean-files := $(extra-y) $(extra-m) $(extra-) \ 31 31 $(always) $(always-y) $(always-m) $(always-) $(targets) $(clean-files) \ 32 32 $(hostprogs) $(hostprogs-y) $(hostprogs-m) $(hostprogs-) \ 33 - $(hostlibs-y) $(hostlibs-m) $(hostlibs-) \ 34 33 $(hostcxxlibs-y) $(hostcxxlibs-m) 35 34 36 35 __clean-files := $(filter-out $(no-clean-files), $(__clean-files))
+1
scripts/Makefile.extrawarn
··· 49 49 KBUILD_CFLAGS += -Wno-sign-compare 50 50 KBUILD_CFLAGS += -Wno-format-zero-length 51 51 KBUILD_CFLAGS += $(call cc-disable-warning, pointer-to-enum-cast) 52 + KBUILD_CFLAGS += -Wno-tautological-constant-out-of-range-compare 52 53 endif 53 54 54 55 endif
+1 -22
scripts/Makefile.host
··· 39 39 # They are linked as C++ code to the executable qconf 40 40 41 41 __hostprogs := $(sort $(hostprogs)) 42 - host-cshlib := $(sort $(hostlibs-y) $(hostlibs-m)) 43 42 host-cxxshlib := $(sort $(hostcxxlibs-y) $(hostcxxlibs-m)) 44 43 45 44 # C code ··· 62 63 host-cxxobjs := $(sort $(foreach m,$(host-cxxmulti),$($(m)-cxxobjs))) 63 64 64 65 # Object (.o) files used by the shared libaries 65 - host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs)))) 66 66 host-cxxshobjs := $(sort $(foreach m,$(host-cxxshlib),$($(m:.so=-objs)))) 67 67 68 68 host-csingle := $(addprefix $(obj)/,$(host-csingle)) ··· 69 71 host-cobjs := $(addprefix $(obj)/,$(host-cobjs)) 70 72 host-cxxmulti := $(addprefix $(obj)/,$(host-cxxmulti)) 71 73 host-cxxobjs := $(addprefix $(obj)/,$(host-cxxobjs)) 72 - host-cshlib := $(addprefix $(obj)/,$(host-cshlib)) 73 74 host-cxxshlib := $(addprefix $(obj)/,$(host-cxxshlib)) 74 - host-cshobjs := $(addprefix $(obj)/,$(host-cshobjs)) 75 75 host-cxxshobjs := $(addprefix $(obj)/,$(host-cxxshobjs)) 76 76 77 77 ##### ··· 137 141 $(call if_changed_dep,host-cxxobjs) 138 142 139 143 # Compile .c file, create position independent .o file 140 - # host-cshobjs -> .o 141 - quiet_cmd_host-cshobjs = HOSTCC -fPIC $@ 142 - cmd_host-cshobjs = $(HOSTCC) $(hostc_flags) -fPIC -c -o $@ $< 143 - $(host-cshobjs): $(obj)/%.o: $(src)/%.c FORCE 144 - $(call if_changed_dep,host-cshobjs) 145 - 146 - # Compile .c file, create position independent .o file 147 144 # Note that plugin capable gcc versions can be either C or C++ based 148 145 # therefore plugin source files have to be compilable in both C and C++ mode. 149 146 # This is why a C++ compiler is invoked on a .c file. ··· 145 156 cmd_host-cxxshobjs = $(HOSTCXX) $(hostcxx_flags) -fPIC -c -o $@ $< 146 157 $(host-cxxshobjs): $(obj)/%.o: $(src)/%.c FORCE 147 158 $(call if_changed_dep,host-cxxshobjs) 148 - 149 - # Link a shared library, based on position independent .o files 150 - # *.o -> .so shared library (host-cshlib) 151 - quiet_cmd_host-cshlib = HOSTLLD -shared $@ 152 - cmd_host-cshlib = $(HOSTCC) $(KBUILD_HOSTLDFLAGS) -shared -o $@ \ 153 - $(addprefix $(obj)/, $($(target-stem)-objs)) \ 154 - $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(target-stem).so) 155 - $(host-cshlib): FORCE 156 - $(call if_changed,host-cshlib) 157 - $(call multi_depend, $(host-cshlib), .so, -objs) 158 159 159 160 # Link a shared library, based on position independent .o files 160 161 # *.o -> .so shared library (host-cxxshlib) ··· 157 178 $(call multi_depend, $(host-cxxshlib), .so, -objs) 158 179 159 180 targets += $(host-csingle) $(host-cmulti) $(host-cobjs)\ 160 - $(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs) $(host-cxxshlib) $(host-cxxshobjs) 181 + $(host-cxxmulti) $(host-cxxobjs) $(host-cxxshlib) $(host-cxxshobjs)
+91
scripts/dummy-tools/gcc
··· 1 + #!/bin/sh 2 + # SPDX-License-Identifier: GPL-2.0-only 3 + # 4 + # Staring v4.18, Kconfig evaluates compiler capabilities, and hides CONFIG 5 + # options your compiler does not support. This works well if you configure and 6 + # build the kernel on the same host machine. 7 + # 8 + # It is inconvenient if you prepare the .config that is carried to a different 9 + # build environment (typically this happens when you package the kernel for 10 + # distros) because using a different compiler potentially produces different 11 + # CONFIG options than the real build environment. So, you probably want to make 12 + # as many options visible as possible. In other words, you need to create a 13 + # super-set of CONFIG options that cover any build environment. If some of the 14 + # CONFIG options turned out to be unsupported on the build machine, they are 15 + # automatically disabled by the nature of Kconfig. 16 + # 17 + # However, it is not feasible to get a full-featured compiler for every arch. 18 + # Hence these dummy toolchains to make all compiler tests pass. 19 + # 20 + # Usage: 21 + # 22 + # From the top directory of the source tree, run 23 + # 24 + # $ make CROSS_COMPILE=scripts/dummy-tools/ oldconfig 25 + # 26 + # Most of compiler features are tested by cc-option, which simply checks the 27 + # exit code of $(CC). This script does nothing and just exits with 0 in most 28 + # cases. So, $(cc-option, ...) is evaluated as 'y'. 29 + # 30 + # This scripts caters to more checks; handle --version and pre-process __GNUC__ 31 + # etc. to pretend to be GCC, and also do right things to satisfy some scripts. 32 + 33 + # Check if the first parameter appears in the rest. Succeeds if found. 34 + # This helper is useful if a particular option was passed to this script. 35 + # Typically used like this: 36 + # arg_contain <word-you-are-searching-for> "$@" 37 + arg_contain () 38 + { 39 + search="$1" 40 + shift 41 + 42 + while [ $# -gt 0 ] 43 + do 44 + if [ "$search" = "$1" ]; then 45 + return 0 46 + fi 47 + shift 48 + done 49 + 50 + return 1 51 + } 52 + 53 + # To set CONFIG_CC_IS_GCC=y 54 + if arg_contain --version "$@"; then 55 + echo "gcc (scripts/dummy-tools/gcc)" 56 + exit 0 57 + fi 58 + 59 + if arg_contain -E "$@"; then 60 + # For scripts/gcc-version.sh; This emulates GCC 20.0.0 61 + if arg_contain - "$@"; then 62 + sed 's/^__GNUC__$/20/; s/^__GNUC_MINOR__$/0/; s/^__GNUC_PATCHLEVEL__$/0/' 63 + exit 0 64 + else 65 + echo "no input files" >&2 66 + exit 1 67 + fi 68 + fi 69 + 70 + if arg_contain -S "$@"; then 71 + # For scripts/gcc-x86-*-has-stack-protector.sh 72 + if arg_contain -fstack-protector "$@"; then 73 + echo "%gs" 74 + exit 0 75 + fi 76 + fi 77 + 78 + # For scripts/gcc-plugin.sh 79 + if arg_contain -print-file-name=plugin "$@"; then 80 + plugin_dir=$(mktemp -d) 81 + 82 + sed -n 's/.*#include "\(.*\)"/\1/p' $(dirname $0)/../gcc-plugins/gcc-common.h | 83 + while read header 84 + do 85 + mkdir -p $plugin_dir/include/$(dirname $header) 86 + touch $plugin_dir/include/$header 87 + done 88 + 89 + echo $plugin_dir 90 + exit 0 91 + fi
+30
scripts/dummy-tools/ld
··· 1 + #!/bin/sh 2 + # SPDX-License-Identifier: GPL-2.0-only 3 + 4 + # Dummy script that always succeeds. 5 + 6 + # Check if the first parameter appears in the rest. Succeeds if found. 7 + # This helper is useful if a particular option was passed to this script. 8 + # Typically used like this: 9 + # arg_contain <word-you-are-searching-for> "$@" 10 + arg_contain () 11 + { 12 + search="$1" 13 + shift 14 + 15 + while [ $# -gt 0 ] 16 + do 17 + if [ "$search" = "$1" ]; then 18 + return 0 19 + fi 20 + shift 21 + done 22 + 23 + return 1 24 + } 25 + 26 + if arg_contain --version "$@" || arg_contain -v "$@"; then 27 + progname=$(basename $0) 28 + echo "GNU $progname (scripts/dummy-tools/$progname) 2.50" 29 + exit 0 30 + fi
+5 -52
scripts/gcc-plugin.sh
··· 1 1 #!/bin/sh 2 2 # SPDX-License-Identifier: GPL-2.0 3 + 4 + set -e 5 + 3 6 srctree=$(dirname "$0") 4 7 5 - SHOW_ERROR= 6 - if [ "$1" = "--show-error" ] ; then 7 - SHOW_ERROR=1 8 - shift || true 9 - fi 10 - 11 - gccplugins_dir=$($3 -print-file-name=plugin) 12 - plugincc=$($1 -E -x c++ - -o /dev/null -I"${srctree}"/gcc-plugins -I"${gccplugins_dir}"/include 2>&1 <<EOF 13 - #include "gcc-common.h" 14 - #if BUILDING_GCC_VERSION >= 4008 || defined(ENABLE_BUILD_WITH_CXX) 15 - #warning $2 CXX 16 - #else 17 - #warning $1 CC 18 - #endif 19 - EOF 20 - ) 21 - 22 - if [ $? -ne 0 ] 23 - then 24 - if [ -n "$SHOW_ERROR" ] ; then 25 - echo "${plugincc}" >&2 26 - fi 27 - exit 1 28 - fi 29 - 30 - case "$plugincc" in 31 - *"$1 CC"*) 32 - echo "$1" 33 - exit 0 34 - ;; 35 - 36 - *"$2 CXX"*) 37 - # the c++ compiler needs another test, see below 38 - ;; 39 - 40 - *) 41 - exit 1 42 - ;; 43 - esac 8 + gccplugins_dir=$($* -print-file-name=plugin) 44 9 45 10 # we need a c++ compiler that supports the designated initializer GNU extension 46 - plugincc=$($2 -c -x c++ -std=gnu++98 - -fsyntax-only -I"${srctree}"/gcc-plugins -I"${gccplugins_dir}"/include 2>&1 <<EOF 11 + $HOSTCC -c -x c++ -std=gnu++98 - -fsyntax-only -I $srctree/gcc-plugins -I $gccplugins_dir/include 2>/dev/null <<EOF 47 12 #include "gcc-common.h" 48 13 class test { 49 14 public: ··· 17 52 .test = 1 18 53 }; 19 54 EOF 20 - ) 21 - 22 - if [ $? -eq 0 ] 23 - then 24 - echo "$2" 25 - exit 0 26 - fi 27 - 28 - if [ -n "$SHOW_ERROR" ] ; then 29 - echo "${plugincc}" >&2 30 - fi 31 - exit 1
+2 -10
scripts/gcc-plugins/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - preferred-plugin-hostcc := $(if-success,[ $(gcc-version) -ge 40800 ],$(HOSTCXX),$(HOSTCC)) 3 - 4 - config PLUGIN_HOSTCC 5 - string 6 - default "$(shell,$(srctree)/scripts/gcc-plugin.sh "$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")" if CC_IS_GCC 7 - help 8 - Host compiler used to build GCC plugins. This can be $(HOSTCXX), 9 - $(HOSTCC), or a null string if GCC plugin is unsupported. 10 - 11 2 config HAVE_GCC_PLUGINS 12 3 bool 13 4 help ··· 8 17 menuconfig GCC_PLUGINS 9 18 bool "GCC plugins" 10 19 depends on HAVE_GCC_PLUGINS 11 - depends on PLUGIN_HOSTCC != "" 20 + depends on CC_IS_GCC && GCC_VERSION >= 40800 21 + depends on $(success,$(srctree)/scripts/gcc-plugin.sh $(CC)) 12 22 default y 13 23 help 14 24 GCC plugins are loadable modules that provide extra features to the
+6 -15
scripts/gcc-plugins/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - PLUGINCC := $(CONFIG_PLUGIN_HOSTCC:"%"=%) 3 2 GCC_PLUGINS_DIR := $(shell $(CC) -print-file-name=plugin) 4 3 5 - ifeq ($(PLUGINCC),$(HOSTCC)) 6 - HOSTLIBS := hostlibs 7 - HOST_EXTRACFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu99 -ggdb 8 - export HOST_EXTRACFLAGS 9 - else 10 - HOSTLIBS := hostcxxlibs 11 - HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++98 -fno-rtti 12 - HOST_EXTRACXXFLAGS += -fno-exceptions -fasynchronous-unwind-tables -ggdb 13 - HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable -Wno-c++11-compat 14 - export HOST_EXTRACXXFLAGS 15 - endif 4 + HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++98 -fno-rtti 5 + HOST_EXTRACXXFLAGS += -fno-exceptions -fasynchronous-unwind-tables -ggdb 6 + HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable -Wno-c++11-compat 16 7 17 8 $(obj)/randomize_layout_plugin.o: $(objtree)/$(obj)/randomize_layout_seed.h 18 9 quiet_cmd_create_randomize_layout_seed = GENSEED $@ ··· 13 22 $(call if_changed,create_randomize_layout_seed) 14 23 targets = randomize_layout_seed.h randomize_layout_hash.h 15 24 16 - $(HOSTLIBS)-y := $(foreach p,$(GCC_PLUGIN),$(if $(findstring /,$(p)),,$(p))) 17 - always-y := $($(HOSTLIBS)-y) 25 + hostcxxlibs-y := $(foreach p,$(GCC_PLUGIN),$(if $(findstring /,$(p)),,$(p))) 26 + always-y := $(hostcxxlibs-y) 18 27 19 - $(foreach p,$($(HOSTLIBS)-y:%.so=%),$(eval $(p)-objs := $(p).o)) 28 + $(foreach p,$(hostcxxlibs-y:%.so=%),$(eval $(p)-objs := $(p).o)) 20 29 21 30 clean-files += *.so
+65 -27
scripts/kconfig/qconf.cc
··· 154 154 155 155 if (!sym_is_changeable(sym) && list->optMode == normalOpt) { 156 156 setPixmap(promptColIdx, QIcon()); 157 - setText(noColIdx, QString::null); 158 - setText(modColIdx, QString::null); 159 - setText(yesColIdx, QString::null); 157 + setText(noColIdx, QString()); 158 + setText(modColIdx, QString()); 159 + setText(yesColIdx, QString()); 160 160 break; 161 161 } 162 162 expr = sym_get_tristate_value(sym); ··· 276 276 if (sym_get_string_value(item->menu->sym)) 277 277 setText(QString::fromLocal8Bit(sym_get_string_value(item->menu->sym))); 278 278 else 279 - setText(QString::null); 279 + setText(QString()); 280 280 Parent::show(); 281 281 setFocus(); 282 282 } ··· 316 316 setVerticalScrollMode(ScrollPerPixel); 317 317 setHorizontalScrollMode(ScrollPerPixel); 318 318 319 - setHeaderLabels(QStringList() << "Option" << "Name" << "N" << "M" << "Y" << "Value"); 319 + if (mode == symbolMode) 320 + setHeaderLabels(QStringList() << "Item" << "Name" << "N" << "M" << "Y" << "Value"); 321 + else 322 + setHeaderLabels(QStringList() << "Option" << "Name" << "N" << "M" << "Y" << "Value"); 320 323 321 324 connect(this, SIGNAL(itemSelectionChanged(void)), 322 325 SLOT(updateSelection(void))); ··· 399 396 { 400 397 struct menu *menu; 401 398 enum prop_type type; 399 + 400 + if (mode == symbolMode) 401 + setHeaderLabels(QStringList() << "Item" << "Name" << "N" << "M" << "Y" << "Value"); 402 + else 403 + setHeaderLabels(QStringList() << "Option" << "Name" << "N" << "M" << "Y" << "Value"); 402 404 403 405 if (selectedItems().count() == 0) 404 406 return; ··· 633 625 last = item; 634 626 continue; 635 627 } 636 - hide: 628 + hide: 637 629 if (item && item->menu == child) { 638 630 last = parent->firstChild(); 639 631 if (last == item) ··· 698 690 last = item; 699 691 continue; 700 692 } 701 - hide: 693 + hide: 702 694 if (item && item->menu == child) { 703 695 last = (ConfigItem*)parent->topLevelItem(0); 704 696 if (last == item) ··· 742 734 type = menu->prompt ? menu->prompt->type : P_UNKNOWN; 743 735 if (type == P_MENU && rootEntry != menu && 744 736 mode != fullMode && mode != menuMode) { 745 - emit menuSelected(menu); 737 + if (mode == menuMode) 738 + emit menuSelected(menu); 739 + else 740 + emit itemSelected(menu); 746 741 break; 747 742 } 748 743 case Qt::Key_Space: ··· 837 826 838 827 void ConfigList::mouseDoubleClickEvent(QMouseEvent* e) 839 828 { 840 - QPoint p = e->pos(); // TODO: Check if this works(was contentsToViewport). 829 + QPoint p = e->pos(); 841 830 ConfigItem* item = (ConfigItem*)itemAt(p); 842 831 struct menu *menu; 843 832 enum prop_type ptype; ··· 852 841 if (!menu) 853 842 goto skip; 854 843 ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; 855 - if (ptype == P_MENU && (mode == singleMode || mode == symbolMode)) 856 - emit menuSelected(menu); 857 - else if (menu->sym) 844 + if (ptype == P_MENU) { 845 + if (mode == singleMode) 846 + emit itemSelected(menu); 847 + else if (mode == symbolMode) 848 + emit menuSelected(menu); 849 + } else if (menu->sym) 858 850 changeValue(item); 859 851 860 852 skip: ··· 1237 1223 { 1238 1224 QMenu* popup = Parent::createStandardContextMenu(pos); 1239 1225 QAction* action = new QAction("Show Debug Info", popup); 1240 - action->setCheckable(true); 1241 - connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool))); 1242 - connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool))); 1243 - action->setChecked(showDebug()); 1226 + 1227 + action->setCheckable(true); 1228 + connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool))); 1229 + connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool))); 1230 + action->setChecked(showDebug()); 1244 1231 popup->addSeparator(); 1245 1232 popup->addAction(action); 1246 1233 return popup; ··· 1367 1352 if ((x.isValid())&&(y.isValid())) 1368 1353 move(x.toInt(), y.toInt()); 1369 1354 1370 - split1 = new QSplitter(this); 1371 - split1->setOrientation(Qt::Horizontal); 1372 - setCentralWidget(split1); 1355 + QWidget *widget = new QWidget(this); 1356 + QVBoxLayout *layout = new QVBoxLayout(widget); 1357 + setCentralWidget(widget); 1373 1358 1374 - menuView = new ConfigView(split1, "menu"); 1359 + split1 = new QSplitter(widget); 1360 + split1->setOrientation(Qt::Horizontal); 1361 + split1->setChildrenCollapsible(false); 1362 + 1363 + menuView = new ConfigView(widget, "menu"); 1375 1364 menuList = menuView->list; 1376 1365 1377 - split2 = new QSplitter(split1); 1366 + split2 = new QSplitter(widget); 1367 + split2->setChildrenCollapsible(false); 1378 1368 split2->setOrientation(Qt::Vertical); 1379 1369 1380 1370 // create config tree 1381 - configView = new ConfigView(split2, "config"); 1371 + configView = new ConfigView(widget, "config"); 1382 1372 configList = configView->list; 1383 1373 1384 - helpText = new ConfigInfoView(split2, "help"); 1374 + helpText = new ConfigInfoView(widget, "help"); 1375 + 1376 + layout->addWidget(split2); 1377 + split2->addWidget(split1); 1378 + split1->addWidget(configView); 1379 + split1->addWidget(menuView); 1380 + split2->addWidget(helpText); 1385 1381 1386 1382 setTabOrder(configList, helpText); 1387 1383 configList->setFocus(); ··· 1510 1484 helpText, SLOT(setInfo(struct menu *))); 1511 1485 connect(configList, SIGNAL(menuSelected(struct menu *)), 1512 1486 SLOT(changeMenu(struct menu *))); 1487 + connect(configList, SIGNAL(itemSelected(struct menu *)), 1488 + SLOT(changeItens(struct menu *))); 1513 1489 connect(configList, SIGNAL(parentSelected()), 1514 1490 SLOT(goBack())); 1515 1491 connect(menuList, SIGNAL(menuChanged(struct menu *)), ··· 1608 1580 searchWindow->show(); 1609 1581 } 1610 1582 1611 - void ConfigMainWindow::changeMenu(struct menu *menu) 1583 + void ConfigMainWindow::changeItens(struct menu *menu) 1612 1584 { 1613 1585 configList->setRootMenu(menu); 1586 + 1614 1587 if (configList->rootEntry->parent == &rootmenu) 1588 + backAction->setEnabled(false); 1589 + else 1590 + backAction->setEnabled(true); 1591 + } 1592 + 1593 + void ConfigMainWindow::changeMenu(struct menu *menu) 1594 + { 1595 + menuList->setRootMenu(menu); 1596 + 1597 + if (menuList->rootEntry->parent == &rootmenu) 1615 1598 backAction->setEnabled(false); 1616 1599 else 1617 1600 backAction->setEnabled(true); ··· 1737 1698 fullViewAction->setEnabled(true); 1738 1699 fullViewAction->setChecked(false); 1739 1700 1740 - configList->mode = symbolMode; 1701 + configList->mode = menuMode; 1741 1702 if (configList->rootEntry == &rootmenu) 1742 1703 configList->updateListAll(); 1743 1704 else 1744 1705 configList->setRootMenu(&rootmenu); 1745 1706 configList->setAllOpen(true); 1746 1707 configApp->processEvents(); 1747 - menuList->mode = menuMode; 1708 + menuList->mode = symbolMode; 1748 1709 menuList->setRootMenu(&rootmenu); 1749 1710 menuList->setAllOpen(true); 1750 1711 menuView->show(); ··· 1772 1733 1773 1734 /* 1774 1735 * ask for saving configuration before quitting 1775 - * TODO ask only when something changed 1776 1736 */ 1777 1737 void ConfigMainWindow::closeEvent(QCloseEvent* e) 1778 1738 {
+2
scripts/kconfig/qconf.h
··· 71 71 signals: 72 72 void menuChanged(struct menu *menu); 73 73 void menuSelected(struct menu *menu); 74 + void itemSelected(struct menu *menu); 74 75 void parentSelected(void); 75 76 void gotFocus(struct menu *); 76 77 ··· 299 298 ConfigMainWindow(void); 300 299 public slots: 301 300 void changeMenu(struct menu *); 301 + void changeItens(struct menu *); 302 302 void setMenuLink(struct menu *); 303 303 void listFocusChanged(void); 304 304 void goBack(void);
+5 -1
scripts/mkcompile_h
··· 7 7 PREEMPT=$4 8 8 PREEMPT_RT=$5 9 9 CC=$6 10 + LD=$7 10 11 11 12 vecho() { [ "${quiet}" = "silent_" ] || echo "$@" ; } 12 13 ··· 62 61 printf '#define LINUX_COMPILE_BY "%s"\n' "$LINUX_COMPILE_BY" 63 62 echo \#define LINUX_COMPILE_HOST \"$LINUX_COMPILE_HOST\" 64 63 65 - echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | grep ' version ' | sed 's/[[:space:]]*$//'`\" 64 + CC_VERSION=$($CC -v 2>&1 | grep ' version ' | sed 's/[[:space:]]*$//') 65 + LD_VERSION=$($LD -v | head -n1 | sed 's/(compatible with [^)]*)//' \ 66 + | sed 's/[[:space:]]*$//') 67 + printf '#define LINUX_COMPILER "%s"\n' "$CC_VERSION, $LD_VERSION" 66 68 } > .tmpcompile 67 69 68 70 # Only replace the real compile.h if the new one is different,
+6
tools/objtool/Makefile
··· 3 3 include ../scripts/Makefile.arch 4 4 5 5 # always use the host compiler 6 + ifneq ($(LLVM),) 7 + HOSTAR ?= llvm-ar 8 + HOSTCC ?= clang 9 + HOSTLD ?= ld.lld 10 + else 6 11 HOSTAR ?= ar 7 12 HOSTCC ?= gcc 8 13 HOSTLD ?= ld 14 + endif 9 15 AR = $(HOSTAR) 10 16 CC = $(HOSTCC) 11 17 LD = $(HOSTLD)
+1 -1
usr/include/Makefile
··· 93 93 94 94 extra-y := $(patsubst $(obj)/%.h,%.hdrtest, $(shell find $(obj) -name '*.h' 2>/dev/null)) 95 95 96 - # Include the header to detect missing include guard. 96 + # Include the header twice to detect missing include guard. 97 97 quiet_cmd_hdrtest = HDRTEST $< 98 98 cmd_hdrtest = \ 99 99 $(CC) $(c_flags) -S -o /dev/null -x c /dev/null \