mirror of
https://github.com/torvalds/linux.git
synced 2024-12-25 12:21:37 +00:00
Kbuild updates for v5.7 (2nd)
- 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 -----BEGIN PGP SIGNATURE----- iQJJBAABCgAzFiEEbmPs18K1szRHjPqEPYsBB53g2wYFAl6RNqEVHG1hc2FoaXJv eUBrZXJuZWwub3JnAAoJED2LAQed4NsGZPEP/3affmzIWJuKGF1RErOHK3KCe/uX PmLjoRZ7im7V+J4b3W+p+re6BOXIXhW+rtKoP/Ijuys9g80WeeAb2nB4h0ESOtff 3NgN97v28mh4tVtbluJambFDXItei+UwDp1sgg2sZ7ehaSBVny9hgNmPRn5YcyoS O3Juy85q70l8awBWThjEHgSxEw2Rzh9PLE6YmMt40rHTxVEDjMOPSuBlp/+TWj3X ugF/wInp+J5mCAKCwJI4L6PavdwIwf9hg3Cv/DpoOw60TxwH+7Rq6RueDKBgHhe3 UEPHrXyPCsF/JQwwSFxN7k481RV2PjkXFwA3U5vH+3WIRb4ETX0+fmBIrLPSAX4z 6rZiEvdrGS4TVvW2i8mrkJUrLPHNyQ90q/FU0V18A1k77Cv7mWJjSebTAVYNvz/v f/DxApaepwprdtHcNYJMN/TVnwxNexJK+U+bkuXsmDggvZYCxwLQUjtI3Sab1Rv9 C6Y8WgqKx8yP6NbqVtUMkwXdEhBiHgybVxkl9hseUEbhUElIViuq5rlrHa0FVt2Q w4orgFXOd7k5iuDr7ka+wa3p20KLQQuB+vwLaCpi35+4vepQ7P0i2tFNwSclo7lO +iNy4Bq20W0/cmQeUJIzctJGibwro1I3HPN1UJ7gp0fZ2WVGzV0SKpwQ0tLOVuuU y9yPsL1ciDpKQKMh =jpyF -----END PGP SIGNATURE----- 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' ...
This commit is contained in:
commit
b753101a4a
@ -262,3 +262,8 @@ KBUILD_BUILD_USER, KBUILD_BUILD_HOST
|
||||
These two variables allow to override the user@host string displayed during
|
||||
boot and in /proc/version. The default value is the output of the commands
|
||||
whoami and host, respectively.
|
||||
|
||||
LLVM
|
||||
----
|
||||
If this variable is set to 1, Kbuild will use Clang and LLVM utilities instead
|
||||
of GCC and GNU binutils to build the kernel.
|
||||
|
@ -47,14 +47,21 @@ example:
|
||||
LLVM Utilities
|
||||
--------------
|
||||
|
||||
LLVM has substitutes for GNU binutils utilities. These can be invoked as
|
||||
additional parameters to `make`.
|
||||
LLVM has substitutes for GNU binutils utilities. Kbuild supports `LLVM=1`
|
||||
to enable them.
|
||||
|
||||
make CC=clang AS=clang LD=ld.lld AR=llvm-ar NM=llvm-nm STRIP=llvm-strip \\
|
||||
OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump OBJSIZE=llvm-objsize \\
|
||||
make LLVM=1
|
||||
|
||||
They can be enabled individually. The full list of the parameters:
|
||||
|
||||
make CC=clang LD=ld.lld AR=llvm-ar NM=llvm-nm STRIP=llvm-strip \\
|
||||
OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump OBJSIZE=llvm-size \\
|
||||
READELF=llvm-readelf HOSTCC=clang HOSTCXX=clang++ HOSTAR=llvm-ar \\
|
||||
HOSTLD=ld.lld
|
||||
|
||||
Currently, the integrated assembler is disabled by default. You can pass
|
||||
`LLVM_IAS=1` to enable it.
|
||||
|
||||
Getting Help
|
||||
------------
|
||||
|
||||
|
@ -31,7 +31,7 @@ you probably needn't concern yourself with pcmciautils.
|
||||
====================== =============== ========================================
|
||||
GNU C 4.6 gcc --version
|
||||
GNU make 3.81 make --version
|
||||
binutils 2.21 ld -v
|
||||
binutils 2.23 ld -v
|
||||
flex 2.5.35 flex --version
|
||||
bison 2.0 bison --version
|
||||
util-linux 2.10o fdformat --version
|
||||
@ -76,7 +76,7 @@ You will need GNU make 3.81 or later to build the kernel.
|
||||
Binutils
|
||||
--------
|
||||
|
||||
Binutils 2.21 or newer is needed to build the kernel.
|
||||
Binutils 2.23 or newer is needed to build the kernel.
|
||||
|
||||
pkg-config
|
||||
----------
|
||||
|
40
Makefile
40
Makefile
@ -399,8 +399,13 @@ HOST_LFS_CFLAGS := $(shell getconf LFS_CFLAGS 2>/dev/null)
|
||||
HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS 2>/dev/null)
|
||||
HOST_LFS_LIBS := $(shell getconf LFS_LIBS 2>/dev/null)
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTCXX = g++
|
||||
ifneq ($(LLVM),)
|
||||
HOSTCC = clang
|
||||
HOSTCXX = clang++
|
||||
else
|
||||
HOSTCC = gcc
|
||||
HOSTCXX = g++
|
||||
endif
|
||||
KBUILD_HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \
|
||||
-fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) \
|
||||
$(HOSTCFLAGS)
|
||||
@ -409,16 +414,28 @@ KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS)
|
||||
KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS)
|
||||
|
||||
# Make variables (CC, etc...)
|
||||
LD = $(CROSS_COMPILE)ld
|
||||
CC = $(CROSS_COMPILE)gcc
|
||||
CPP = $(CC) -E
|
||||
ifneq ($(LLVM),)
|
||||
CC = clang
|
||||
LD = ld.lld
|
||||
AR = llvm-ar
|
||||
NM = llvm-nm
|
||||
OBJCOPY = llvm-objcopy
|
||||
OBJDUMP = llvm-objdump
|
||||
READELF = llvm-readelf
|
||||
OBJSIZE = llvm-size
|
||||
STRIP = llvm-strip
|
||||
else
|
||||
CC = $(CROSS_COMPILE)gcc
|
||||
LD = $(CROSS_COMPILE)ld
|
||||
AR = $(CROSS_COMPILE)ar
|
||||
NM = $(CROSS_COMPILE)nm
|
||||
STRIP = $(CROSS_COMPILE)strip
|
||||
OBJCOPY = $(CROSS_COMPILE)objcopy
|
||||
OBJDUMP = $(CROSS_COMPILE)objdump
|
||||
OBJSIZE = $(CROSS_COMPILE)size
|
||||
READELF = $(CROSS_COMPILE)readelf
|
||||
OBJSIZE = $(CROSS_COMPILE)size
|
||||
STRIP = $(CROSS_COMPILE)strip
|
||||
endif
|
||||
PAHOLE = pahole
|
||||
LEX = flex
|
||||
YACC = bison
|
||||
@ -538,7 +555,7 @@ endif
|
||||
ifneq ($(GCC_TOOLCHAIN),)
|
||||
CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN)
|
||||
endif
|
||||
ifeq ($(if $(AS),$(shell $(AS) --version 2>&1 | head -n 1 | grep clang)),)
|
||||
ifneq ($(LLVM_IAS),1)
|
||||
CLANG_FLAGS += -no-integrated-as
|
||||
endif
|
||||
CLANG_FLAGS += -Werror=unknown-warning-option
|
||||
@ -747,8 +764,6 @@ ifdef CONFIG_CC_IS_CLANG
|
||||
KBUILD_CPPFLAGS += -Qunused-arguments
|
||||
KBUILD_CFLAGS += -Wno-format-invalid-specifier
|
||||
KBUILD_CFLAGS += -Wno-gnu
|
||||
# Quiet clang warning: comparison of unsigned expression < 0 is always false
|
||||
KBUILD_CFLAGS += -Wno-tautological-compare
|
||||
# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
|
||||
# source of a reference will be _MergedGlobals and not on of the whitelisted names.
|
||||
# See modpost pattern 2
|
||||
@ -1036,8 +1051,13 @@ init-y := $(patsubst %/, %/built-in.a, $(init-y))
|
||||
core-y := $(patsubst %/, %/built-in.a, $(core-y))
|
||||
drivers-y := $(patsubst %/, %/built-in.a, $(drivers-y))
|
||||
net-y := $(patsubst %/, %/built-in.a, $(net-y))
|
||||
libs-y2 := $(patsubst %/, %/built-in.a, $(filter %/, $(libs-y)))
|
||||
ifdef CONFIG_MODULES
|
||||
libs-y1 := $(filter-out %/, $(libs-y))
|
||||
libs-y2 += $(patsubst %/, %/lib.a, $(filter %/, $(libs-y)))
|
||||
else
|
||||
libs-y1 := $(patsubst %/, %/lib.a, $(libs-y))
|
||||
libs-y2 := $(patsubst %/, %/built-in.a, $(filter-out %.a, $(libs-y)))
|
||||
endif
|
||||
virt-y := $(patsubst %/, %/built-in.a, $(virt-y))
|
||||
|
||||
# Externally visible symbols (used by link-vmlinux.sh)
|
||||
|
@ -1,15 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
#ifndef _UAPI__ASM_H8300_BITS_PER_LONG
|
||||
#define _UAPI__ASM_H8300_BITS_PER_LONG
|
||||
|
||||
#include <asm-generic/bitsperlong.h>
|
||||
|
||||
#if !defined(__ASSEMBLY__)
|
||||
/* h8300-unknown-linux required long */
|
||||
#define __kernel_size_t __kernel_size_t
|
||||
typedef unsigned long __kernel_size_t;
|
||||
typedef long __kernel_ssize_t;
|
||||
typedef long __kernel_ptrdiff_t;
|
||||
#endif
|
||||
|
||||
#endif /* _UAPI__ASM_H8300_BITS_PER_LONG */
|
13
arch/h8300/include/uapi/asm/posix_types.h
Normal file
13
arch/h8300/include/uapi/asm/posix_types.h
Normal file
@ -0,0 +1,13 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
|
||||
#ifndef _UAPI_ASM_POSIX_TYPES_H
|
||||
#define _UAPI_ASM_POSIX_TYPES_H
|
||||
|
||||
/* h8300-unknown-linux required long */
|
||||
#define __kernel_size_t __kernel_size_t
|
||||
typedef unsigned long __kernel_size_t;
|
||||
typedef long __kernel_ssize_t;
|
||||
typedef long __kernel_ptrdiff_t;
|
||||
|
||||
#include <asm-generic/posix_types.h>
|
||||
|
||||
#endif /* _UAPI_ASM_POSIX_TYPES_H */
|
@ -117,7 +117,7 @@ static int __init prom_memtype_classify(union linux_memtypes type)
|
||||
return memtype_classify_arc(type);
|
||||
}
|
||||
|
||||
void __init prom_meminit(void)
|
||||
void __weak __init prom_meminit(void)
|
||||
{
|
||||
struct linux_mdesc *p;
|
||||
|
||||
@ -162,7 +162,7 @@ void __weak __init prom_cleanup(void)
|
||||
{
|
||||
}
|
||||
|
||||
void __init prom_free_prom_memory(void)
|
||||
void __weak __init prom_free_prom_memory(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -16,11 +16,9 @@
|
||||
#define BYTE_OFFSET(nr) ((nr) % BITS_PER_BYTE)
|
||||
#endif
|
||||
|
||||
#define IS_IMMEDIATE(nr) (__builtin_constant_p(nr))
|
||||
|
||||
static inline void __set_bit(int nr, volatile unsigned long *addr)
|
||||
{
|
||||
if (IS_IMMEDIATE(nr)) {
|
||||
if (__builtin_constant_p(nr)) {
|
||||
__asm__ __volatile__ (
|
||||
"bset.b %1, @(%O2,%0) ! __set_bit\n\t"
|
||||
: "+r" (addr)
|
||||
@ -37,7 +35,7 @@ static inline void __set_bit(int nr, volatile unsigned long *addr)
|
||||
|
||||
static inline void __clear_bit(int nr, volatile unsigned long *addr)
|
||||
{
|
||||
if (IS_IMMEDIATE(nr)) {
|
||||
if (__builtin_constant_p(nr)) {
|
||||
__asm__ __volatile__ (
|
||||
"bclr.b %1, @(%O2,%0) ! __clear_bit\n\t"
|
||||
: "+r" (addr)
|
||||
@ -64,7 +62,7 @@ static inline void __clear_bit(int nr, volatile unsigned long *addr)
|
||||
*/
|
||||
static inline void __change_bit(int nr, volatile unsigned long *addr)
|
||||
{
|
||||
if (IS_IMMEDIATE(nr)) {
|
||||
if (__builtin_constant_p(nr)) {
|
||||
__asm__ __volatile__ (
|
||||
"bxor.b %1, @(%O2,%0) ! __change_bit\n\t"
|
||||
: "+r" (addr)
|
||||
|
@ -1,2 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
#include <asm-generic/setup.h>
|
@ -1,2 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
#include <asm-generic/types.h>
|
@ -2932,3 +2932,5 @@ config HAVE_ATOMIC_IOMAP
|
||||
source "drivers/firmware/Kconfig"
|
||||
|
||||
source "arch/x86/kvm/Kconfig"
|
||||
|
||||
source "arch/x86/Kconfig.assembler"
|
||||
|
17
arch/x86/Kconfig.assembler
Normal file
17
arch/x86/Kconfig.assembler
Normal file
@ -0,0 +1,17 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2020 Jason A. Donenfeld <Jason@zx2c4.com>. 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
|
@ -177,28 +177,6 @@ ifeq ($(ACCUMULATE_OUTGOING_ARGS), 1)
|
||||
KBUILD_CFLAGS += $(call cc-option,-maccumulate-outgoing-args,)
|
||||
endif
|
||||
|
||||
# Stackpointer is addressed different for 32 bit and 64 bit x86
|
||||
sp-$(CONFIG_X86_32) := esp
|
||||
sp-$(CONFIG_X86_64) := rsp
|
||||
|
||||
# do binutils support CFI?
|
||||
cfi := $(call as-instr,.cfi_startproc\n.cfi_rel_offset $(sp-y)$(comma)0\n.cfi_endproc,-DCONFIG_AS_CFI=1)
|
||||
# is .cfi_signal_frame supported too?
|
||||
cfi-sigframe := $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1)
|
||||
cfi-sections := $(call as-instr,.cfi_sections .debug_frame,-DCONFIG_AS_CFI_SECTIONS=1)
|
||||
|
||||
# does binutils support specific instructions?
|
||||
asinstr += $(call as-instr,pshufb %xmm0$(comma)%xmm0,-DCONFIG_AS_SSSE3=1)
|
||||
avx_instr := $(call as-instr,vxorps %ymm0$(comma)%ymm1$(comma)%ymm2,-DCONFIG_AS_AVX=1)
|
||||
avx2_instr :=$(call as-instr,vpbroadcastb %xmm0$(comma)%ymm1,-DCONFIG_AS_AVX2=1)
|
||||
avx512_instr :=$(call as-instr,vpmovm2b %k1$(comma)%zmm5,-DCONFIG_AS_AVX512=1)
|
||||
sha1_ni_instr :=$(call as-instr,sha1msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA1_NI=1)
|
||||
sha256_ni_instr :=$(call as-instr,sha256msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA256_NI=1)
|
||||
adx_instr := $(call as-instr,adox %r10$(comma)%r10,-DCONFIG_AS_ADX=1)
|
||||
|
||||
KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) $(adx_instr)
|
||||
KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) $(adx_instr)
|
||||
|
||||
KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE)
|
||||
|
||||
#
|
||||
|
@ -1,131 +1,97 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
#
|
||||
# Arch-specific CryptoAPI modules.
|
||||
#
|
||||
# x86 crypto algorithms
|
||||
|
||||
OBJECT_FILES_NON_STANDARD := y
|
||||
|
||||
avx_supported := $(call as-instr,vpxor %xmm0$(comma)%xmm0$(comma)%xmm0,yes,no)
|
||||
avx2_supported := $(call as-instr,vpgatherdd %ymm0$(comma)(%eax$(comma)%ymm1\
|
||||
$(comma)4)$(comma)%ymm2,yes,no)
|
||||
avx512_supported :=$(call as-instr,vpmovm2b %k1$(comma)%zmm5,yes,no)
|
||||
sha1_ni_supported :=$(call as-instr,sha1msg1 %xmm0$(comma)%xmm1,yes,no)
|
||||
sha256_ni_supported :=$(call as-instr,sha256msg1 %xmm0$(comma)%xmm1,yes,no)
|
||||
adx_supported := $(call as-instr,adox %r10$(comma)%r10,yes,no)
|
||||
|
||||
obj-$(CONFIG_CRYPTO_GLUE_HELPER_X86) += glue_helper.o
|
||||
|
||||
obj-$(CONFIG_CRYPTO_TWOFISH_586) += twofish-i586.o
|
||||
twofish-i586-y := twofish-i586-asm_32.o twofish_glue.o
|
||||
obj-$(CONFIG_CRYPTO_TWOFISH_X86_64) += twofish-x86_64.o
|
||||
twofish-x86_64-y := twofish-x86_64-asm_64.o twofish_glue.o
|
||||
obj-$(CONFIG_CRYPTO_TWOFISH_X86_64_3WAY) += twofish-x86_64-3way.o
|
||||
twofish-x86_64-3way-y := twofish-x86_64-asm_64-3way.o twofish_glue_3way.o
|
||||
obj-$(CONFIG_CRYPTO_TWOFISH_AVX_X86_64) += twofish-avx-x86_64.o
|
||||
twofish-avx-x86_64-y := twofish-avx-x86_64-asm_64.o twofish_avx_glue.o
|
||||
|
||||
obj-$(CONFIG_CRYPTO_SERPENT_SSE2_586) += serpent-sse2-i586.o
|
||||
serpent-sse2-i586-y := serpent-sse2-i586-asm_32.o serpent_sse2_glue.o
|
||||
obj-$(CONFIG_CRYPTO_SERPENT_SSE2_X86_64) += serpent-sse2-x86_64.o
|
||||
serpent-sse2-x86_64-y := serpent-sse2-x86_64-asm_64.o serpent_sse2_glue.o
|
||||
obj-$(CONFIG_CRYPTO_SERPENT_AVX_X86_64) += serpent-avx-x86_64.o
|
||||
serpent-avx-x86_64-y := serpent-avx-x86_64-asm_64.o serpent_avx_glue.o
|
||||
obj-$(CONFIG_CRYPTO_SERPENT_AVX2_X86_64) += serpent-avx2.o
|
||||
serpent-avx2-y := serpent-avx2-asm_64.o serpent_avx2_glue.o
|
||||
|
||||
obj-$(CONFIG_CRYPTO_DES3_EDE_X86_64) += des3_ede-x86_64.o
|
||||
obj-$(CONFIG_CRYPTO_CAMELLIA_X86_64) += camellia-x86_64.o
|
||||
obj-$(CONFIG_CRYPTO_BLOWFISH_X86_64) += blowfish-x86_64.o
|
||||
obj-$(CONFIG_CRYPTO_TWOFISH_X86_64) += twofish-x86_64.o
|
||||
obj-$(CONFIG_CRYPTO_TWOFISH_X86_64_3WAY) += twofish-x86_64-3way.o
|
||||
obj-$(CONFIG_CRYPTO_CHACHA20_X86_64) += chacha-x86_64.o
|
||||
obj-$(CONFIG_CRYPTO_SERPENT_SSE2_X86_64) += serpent-sse2-x86_64.o
|
||||
obj-$(CONFIG_CRYPTO_AES_NI_INTEL) += aesni-intel.o
|
||||
obj-$(CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL) += ghash-clmulni-intel.o
|
||||
des3_ede-x86_64-y := des3_ede-asm_64.o des3_ede_glue.o
|
||||
|
||||
obj-$(CONFIG_CRYPTO_CRC32C_INTEL) += crc32c-intel.o
|
||||
obj-$(CONFIG_CRYPTO_SHA1_SSSE3) += sha1-ssse3.o
|
||||
obj-$(CONFIG_CRYPTO_CRC32_PCLMUL) += crc32-pclmul.o
|
||||
obj-$(CONFIG_CRYPTO_SHA256_SSSE3) += sha256-ssse3.o
|
||||
obj-$(CONFIG_CRYPTO_SHA512_SSSE3) += sha512-ssse3.o
|
||||
obj-$(CONFIG_CRYPTO_CRCT10DIF_PCLMUL) += crct10dif-pclmul.o
|
||||
obj-$(CONFIG_CRYPTO_POLY1305_X86_64) += poly1305-x86_64.o
|
||||
obj-$(CONFIG_CRYPTO_CAMELLIA_X86_64) += camellia-x86_64.o
|
||||
camellia-x86_64-y := camellia-x86_64-asm_64.o camellia_glue.o
|
||||
obj-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64) += camellia-aesni-avx-x86_64.o
|
||||
camellia-aesni-avx-x86_64-y := camellia-aesni-avx-asm_64.o camellia_aesni_avx_glue.o
|
||||
obj-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64) += camellia-aesni-avx2.o
|
||||
camellia-aesni-avx2-y := camellia-aesni-avx2-asm_64.o camellia_aesni_avx2_glue.o
|
||||
|
||||
obj-$(CONFIG_CRYPTO_BLOWFISH_X86_64) += blowfish-x86_64.o
|
||||
blowfish-x86_64-y := blowfish-x86_64-asm_64.o blowfish_glue.o
|
||||
|
||||
obj-$(CONFIG_CRYPTO_CAST5_AVX_X86_64) += cast5-avx-x86_64.o
|
||||
cast5-avx-x86_64-y := cast5-avx-x86_64-asm_64.o cast5_avx_glue.o
|
||||
|
||||
obj-$(CONFIG_CRYPTO_CAST6_AVX_X86_64) += cast6-avx-x86_64.o
|
||||
cast6-avx-x86_64-y := cast6-avx-x86_64-asm_64.o cast6_avx_glue.o
|
||||
|
||||
obj-$(CONFIG_CRYPTO_AEGIS128_AESNI_SSE2) += aegis128-aesni.o
|
||||
|
||||
obj-$(CONFIG_CRYPTO_NHPOLY1305_SSE2) += nhpoly1305-sse2.o
|
||||
obj-$(CONFIG_CRYPTO_NHPOLY1305_AVX2) += nhpoly1305-avx2.o
|
||||
|
||||
# These modules require the assembler to support ADX.
|
||||
ifeq ($(adx_supported),yes)
|
||||
obj-$(CONFIG_CRYPTO_CURVE25519_X86) += curve25519-x86_64.o
|
||||
endif
|
||||
|
||||
# These modules require assembler to support AVX.
|
||||
ifeq ($(avx_supported),yes)
|
||||
obj-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64) += \
|
||||
camellia-aesni-avx-x86_64.o
|
||||
obj-$(CONFIG_CRYPTO_CAST5_AVX_X86_64) += cast5-avx-x86_64.o
|
||||
obj-$(CONFIG_CRYPTO_CAST6_AVX_X86_64) += cast6-avx-x86_64.o
|
||||
obj-$(CONFIG_CRYPTO_TWOFISH_AVX_X86_64) += twofish-avx-x86_64.o
|
||||
obj-$(CONFIG_CRYPTO_SERPENT_AVX_X86_64) += serpent-avx-x86_64.o
|
||||
obj-$(CONFIG_CRYPTO_BLAKE2S_X86) += blake2s-x86_64.o
|
||||
endif
|
||||
|
||||
# These modules require assembler to support AVX2.
|
||||
ifeq ($(avx2_supported),yes)
|
||||
obj-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64) += camellia-aesni-avx2.o
|
||||
obj-$(CONFIG_CRYPTO_SERPENT_AVX2_X86_64) += serpent-avx2.o
|
||||
endif
|
||||
|
||||
twofish-i586-y := twofish-i586-asm_32.o twofish_glue.o
|
||||
serpent-sse2-i586-y := serpent-sse2-i586-asm_32.o serpent_sse2_glue.o
|
||||
|
||||
des3_ede-x86_64-y := des3_ede-asm_64.o des3_ede_glue.o
|
||||
camellia-x86_64-y := camellia-x86_64-asm_64.o camellia_glue.o
|
||||
blowfish-x86_64-y := blowfish-x86_64-asm_64.o blowfish_glue.o
|
||||
twofish-x86_64-y := twofish-x86_64-asm_64.o twofish_glue.o
|
||||
twofish-x86_64-3way-y := twofish-x86_64-asm_64-3way.o twofish_glue_3way.o
|
||||
chacha-x86_64-y := chacha-ssse3-x86_64.o chacha_glue.o
|
||||
serpent-sse2-x86_64-y := serpent-sse2-x86_64-asm_64.o serpent_sse2_glue.o
|
||||
|
||||
aegis128-aesni-y := aegis128-aesni-asm.o aegis128-aesni-glue.o
|
||||
|
||||
nhpoly1305-sse2-y := nh-sse2-x86_64.o nhpoly1305-sse2-glue.o
|
||||
blake2s-x86_64-y := blake2s-core.o blake2s-glue.o
|
||||
poly1305-x86_64-y := poly1305-x86_64-cryptogams.o poly1305_glue.o
|
||||
ifneq ($(CONFIG_CRYPTO_POLY1305_X86_64),)
|
||||
targets += poly1305-x86_64-cryptogams.S
|
||||
endif
|
||||
|
||||
ifeq ($(avx_supported),yes)
|
||||
camellia-aesni-avx-x86_64-y := camellia-aesni-avx-asm_64.o \
|
||||
camellia_aesni_avx_glue.o
|
||||
cast5-avx-x86_64-y := cast5-avx-x86_64-asm_64.o cast5_avx_glue.o
|
||||
cast6-avx-x86_64-y := cast6-avx-x86_64-asm_64.o cast6_avx_glue.o
|
||||
twofish-avx-x86_64-y := twofish-avx-x86_64-asm_64.o \
|
||||
twofish_avx_glue.o
|
||||
serpent-avx-x86_64-y := serpent-avx-x86_64-asm_64.o \
|
||||
serpent_avx_glue.o
|
||||
endif
|
||||
|
||||
ifeq ($(avx2_supported),yes)
|
||||
camellia-aesni-avx2-y := camellia-aesni-avx2-asm_64.o camellia_aesni_avx2_glue.o
|
||||
chacha-x86_64-y += chacha-avx2-x86_64.o
|
||||
serpent-avx2-y := serpent-avx2-asm_64.o serpent_avx2_glue.o
|
||||
|
||||
nhpoly1305-avx2-y := nh-avx2-x86_64.o nhpoly1305-avx2-glue.o
|
||||
endif
|
||||
|
||||
ifeq ($(avx512_supported),yes)
|
||||
chacha-x86_64-y += chacha-avx512vl-x86_64.o
|
||||
endif
|
||||
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
|
||||
|
||||
obj-$(CONFIG_CRYPTO_AES_NI_INTEL) += aesni-intel.o
|
||||
aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o
|
||||
aesni-intel-$(CONFIG_64BIT) += aesni-intel_avx-x86_64.o aes_ctrby8_avx-x86_64.o
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
obj-$(CONFIG_CRYPTO_BLAKE2S_X86) += blake2s-x86_64.o
|
||||
blake2s-x86_64-y := blake2s-core.o blake2s-glue.o
|
||||
|
||||
obj-$(CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL) += ghash-clmulni-intel.o
|
||||
ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o
|
||||
sha1-ssse3-y := sha1_ssse3_asm.o sha1_ssse3_glue.o
|
||||
ifeq ($(avx2_supported),yes)
|
||||
sha1-ssse3-y += sha1_avx2_x86_64_asm.o
|
||||
endif
|
||||
ifeq ($(sha1_ni_supported),yes)
|
||||
sha1-ssse3-y += sha1_ni_asm.o
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_CRYPTO_CRC32C_INTEL) += crc32c-intel.o
|
||||
crc32c-intel-y := crc32c-intel_glue.o
|
||||
crc32c-intel-$(CONFIG_64BIT) += crc32c-pcl-intel-asm_64.o
|
||||
|
||||
obj-$(CONFIG_CRYPTO_CRC32_PCLMUL) += crc32-pclmul.o
|
||||
crc32-pclmul-y := crc32-pclmul_asm.o crc32-pclmul_glue.o
|
||||
sha256-ssse3-y := sha256-ssse3-asm.o sha256-avx-asm.o sha256-avx2-asm.o sha256_ssse3_glue.o
|
||||
ifeq ($(sha256_ni_supported),yes)
|
||||
sha256-ssse3-y += sha256_ni_asm.o
|
||||
endif
|
||||
sha512-ssse3-y := sha512-ssse3-asm.o sha512-avx-asm.o sha512-avx2-asm.o sha512_ssse3_glue.o
|
||||
|
||||
obj-$(CONFIG_CRYPTO_CRCT10DIF_PCLMUL) += crct10dif-pclmul.o
|
||||
crct10dif-pclmul-y := crct10dif-pcl-asm_64.o crct10dif-pclmul_glue.o
|
||||
|
||||
obj-$(CONFIG_CRYPTO_POLY1305_X86_64) += poly1305-x86_64.o
|
||||
poly1305-x86_64-y := poly1305-x86_64-cryptogams.o poly1305_glue.o
|
||||
targets += poly1305-x86_64-cryptogams.S
|
||||
|
||||
obj-$(CONFIG_CRYPTO_NHPOLY1305_SSE2) += nhpoly1305-sse2.o
|
||||
nhpoly1305-sse2-y := nh-sse2-x86_64.o nhpoly1305-sse2-glue.o
|
||||
obj-$(CONFIG_CRYPTO_NHPOLY1305_AVX2) += nhpoly1305-avx2.o
|
||||
nhpoly1305-avx2-y := nh-avx2-x86_64.o nhpoly1305-avx2-glue.o
|
||||
|
||||
obj-$(CONFIG_CRYPTO_CURVE25519_X86) += curve25519-x86_64.o
|
||||
|
||||
quiet_cmd_perlasm = PERLASM $@
|
||||
cmd_perlasm = $(PERL) $< > $@
|
||||
$(obj)/%.S: $(src)/%.pl FORCE
|
||||
|
@ -886,7 +886,6 @@ _less_than_8_bytes_left_\@:
|
||||
_partial_block_done_\@:
|
||||
.endm # PARTIAL_BLOCK
|
||||
|
||||
#ifdef CONFIG_AS_AVX
|
||||
###############################################################################
|
||||
# GHASH_MUL MACRO to implement: Data*HashKey mod (128,127,126,121,0)
|
||||
# Input: A and B (128-bits each, bit-reflected)
|
||||
@ -1869,9 +1868,6 @@ key_256_finalize:
|
||||
ret
|
||||
SYM_FUNC_END(aesni_gcm_finalize_avx_gen2)
|
||||
|
||||
#endif /* CONFIG_AS_AVX */
|
||||
|
||||
#ifdef CONFIG_AS_AVX2
|
||||
###############################################################################
|
||||
# GHASH_MUL MACRO to implement: Data*HashKey mod (128,127,126,121,0)
|
||||
# Input: A and B (128-bits each, bit-reflected)
|
||||
@ -2839,5 +2835,3 @@ key_256_finalize4:
|
||||
FUNC_RESTORE
|
||||
ret
|
||||
SYM_FUNC_END(aesni_gcm_finalize_avx_gen4)
|
||||
|
||||
#endif /* CONFIG_AS_AVX2 */
|
||||
|
@ -185,7 +185,6 @@ static const struct aesni_gcm_tfm_s aesni_gcm_tfm_sse = {
|
||||
.finalize = &aesni_gcm_finalize,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_AS_AVX
|
||||
asmlinkage void aes_ctr_enc_128_avx_by8(const u8 *in, u8 *iv,
|
||||
void *keys, u8 *out, unsigned int num_bytes);
|
||||
asmlinkage void aes_ctr_enc_192_avx_by8(const u8 *in, u8 *iv,
|
||||
@ -234,9 +233,6 @@ static const struct aesni_gcm_tfm_s aesni_gcm_tfm_avx_gen2 = {
|
||||
.finalize = &aesni_gcm_finalize_avx_gen2,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_AS_AVX2
|
||||
/*
|
||||
* asmlinkage void aesni_gcm_init_avx_gen4()
|
||||
* gcm_data *my_ctx_data, context data
|
||||
@ -279,8 +275,6 @@ static const struct aesni_gcm_tfm_s aesni_gcm_tfm_avx_gen4 = {
|
||||
.finalize = &aesni_gcm_finalize_avx_gen4,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
static inline struct
|
||||
aesni_rfc4106_gcm_ctx *aesni_rfc4106_gcm_ctx_get(struct crypto_aead *tfm)
|
||||
{
|
||||
@ -476,7 +470,6 @@ static void ctr_crypt_final(struct crypto_aes_ctx *ctx,
|
||||
crypto_inc(ctrblk, AES_BLOCK_SIZE);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_AS_AVX
|
||||
static void aesni_ctr_enc_avx_tfm(struct crypto_aes_ctx *ctx, u8 *out,
|
||||
const u8 *in, unsigned int len, u8 *iv)
|
||||
{
|
||||
@ -493,7 +486,6 @@ static void aesni_ctr_enc_avx_tfm(struct crypto_aes_ctx *ctx, u8 *out,
|
||||
else
|
||||
aes_ctr_enc_256_avx_by8(in, iv, (void *)ctx, out, len);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int ctr_crypt(struct skcipher_request *req)
|
||||
{
|
||||
@ -711,14 +703,10 @@ static int gcmaes_crypt_by_sg(bool enc, struct aead_request *req,
|
||||
if (!enc)
|
||||
left -= auth_tag_len;
|
||||
|
||||
#ifdef CONFIG_AS_AVX2
|
||||
if (left < AVX_GEN4_OPTSIZE && gcm_tfm == &aesni_gcm_tfm_avx_gen4)
|
||||
gcm_tfm = &aesni_gcm_tfm_avx_gen2;
|
||||
#endif
|
||||
#ifdef CONFIG_AS_AVX
|
||||
if (left < AVX_GEN2_OPTSIZE && gcm_tfm == &aesni_gcm_tfm_avx_gen2)
|
||||
gcm_tfm = &aesni_gcm_tfm_sse;
|
||||
#endif
|
||||
|
||||
/* Linearize assoc, if not already linear */
|
||||
if (req->src->length >= assoclen && req->src->length &&
|
||||
@ -1076,30 +1064,23 @@ static int __init aesni_init(void)
|
||||
if (!x86_match_cpu(aesni_cpu_id))
|
||||
return -ENODEV;
|
||||
#ifdef CONFIG_X86_64
|
||||
#ifdef CONFIG_AS_AVX2
|
||||
if (boot_cpu_has(X86_FEATURE_AVX2)) {
|
||||
pr_info("AVX2 version of gcm_enc/dec engaged.\n");
|
||||
aesni_gcm_tfm = &aesni_gcm_tfm_avx_gen4;
|
||||
} else
|
||||
#endif
|
||||
#ifdef CONFIG_AS_AVX
|
||||
if (boot_cpu_has(X86_FEATURE_AVX)) {
|
||||
pr_info("AVX version of gcm_enc/dec engaged.\n");
|
||||
aesni_gcm_tfm = &aesni_gcm_tfm_avx_gen2;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
} else {
|
||||
pr_info("SSE version of gcm_enc/dec engaged.\n");
|
||||
aesni_gcm_tfm = &aesni_gcm_tfm_sse;
|
||||
}
|
||||
aesni_ctr_enc_tfm = aesni_ctr_enc;
|
||||
#ifdef CONFIG_AS_AVX
|
||||
if (boot_cpu_has(X86_FEATURE_AVX)) {
|
||||
/* optimize performance of ctr mode encryption transform */
|
||||
aesni_ctr_enc_tfm = aesni_ctr_enc_avx_tfm;
|
||||
pr_info("AES CTR mode by8 optimization enabled\n");
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
err = crypto_register_alg(&aesni_cipher_alg);
|
||||
|
@ -46,7 +46,6 @@ SIGMA2:
|
||||
#endif /* CONFIG_AS_AVX512 */
|
||||
|
||||
.text
|
||||
#ifdef CONFIG_AS_SSSE3
|
||||
SYM_FUNC_START(blake2s_compress_ssse3)
|
||||
testq %rdx,%rdx
|
||||
je .Lendofloop
|
||||
@ -174,7 +173,6 @@ SYM_FUNC_START(blake2s_compress_ssse3)
|
||||
.Lendofloop:
|
||||
ret
|
||||
SYM_FUNC_END(blake2s_compress_ssse3)
|
||||
#endif /* CONFIG_AS_SSSE3 */
|
||||
|
||||
#ifdef CONFIG_AS_AVX512
|
||||
SYM_FUNC_START(blake2s_compress_avx512)
|
||||
|
@ -79,8 +79,7 @@ static void chacha_dosimd(u32 *state, u8 *dst, const u8 *src,
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_AS_AVX2) &&
|
||||
static_branch_likely(&chacha_use_avx2)) {
|
||||
if (static_branch_likely(&chacha_use_avx2)) {
|
||||
while (bytes >= CHACHA_BLOCK_SIZE * 8) {
|
||||
chacha_8block_xor_avx2(state, dst, src, bytes, nrounds);
|
||||
bytes -= CHACHA_BLOCK_SIZE * 8;
|
||||
@ -288,8 +287,7 @@ static int __init chacha_simd_mod_init(void)
|
||||
|
||||
static_branch_enable(&chacha_use_simd);
|
||||
|
||||
if (IS_ENABLED(CONFIG_AS_AVX2) &&
|
||||
boot_cpu_has(X86_FEATURE_AVX) &&
|
||||
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(&chacha_use_avx2);
|
||||
|
@ -404,10 +404,6 @@ ___
|
||||
&end_function("poly1305_emit_x86_64");
|
||||
if ($avx) {
|
||||
|
||||
if($kernel) {
|
||||
$code .= "#ifdef CONFIG_AS_AVX\n";
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# Layout of opaque area is following.
|
||||
#
|
||||
@ -1516,16 +1512,8 @@ $code.=<<___;
|
||||
___
|
||||
&end_function("poly1305_emit_avx");
|
||||
|
||||
if ($kernel) {
|
||||
$code .= "#endif\n";
|
||||
}
|
||||
|
||||
if ($avx>1) {
|
||||
|
||||
if ($kernel) {
|
||||
$code .= "#ifdef CONFIG_AS_AVX2\n";
|
||||
}
|
||||
|
||||
my ($H0,$H1,$H2,$H3,$H4, $MASK, $T4,$T0,$T1,$T2,$T3, $D0,$D1,$D2,$D3,$D4) =
|
||||
map("%ymm$_",(0..15));
|
||||
my $S4=$MASK;
|
||||
@ -2816,10 +2804,6 @@ ___
|
||||
poly1305_blocks_avxN(0);
|
||||
&end_function("poly1305_blocks_avx2");
|
||||
|
||||
if($kernel) {
|
||||
$code .= "#endif\n";
|
||||
}
|
||||
|
||||
#######################################################################
|
||||
if ($avx>2) {
|
||||
# On entry we have input length divisible by 64. But since inner loop
|
||||
|
@ -94,7 +94,7 @@ static void poly1305_simd_blocks(void *ctx, const u8 *inp, size_t len,
|
||||
BUILD_BUG_ON(PAGE_SIZE < POLY1305_BLOCK_SIZE ||
|
||||
PAGE_SIZE % POLY1305_BLOCK_SIZE);
|
||||
|
||||
if (!IS_ENABLED(CONFIG_AS_AVX) || !static_branch_likely(&poly1305_use_avx) ||
|
||||
if (!static_branch_likely(&poly1305_use_avx) ||
|
||||
(len < (POLY1305_BLOCK_SIZE * 18) && !state->is_base2_26) ||
|
||||
!crypto_simd_usable()) {
|
||||
convert_to_base2_64(ctx);
|
||||
@ -108,7 +108,7 @@ static void poly1305_simd_blocks(void *ctx, const u8 *inp, size_t len,
|
||||
kernel_fpu_begin();
|
||||
if (IS_ENABLED(CONFIG_AS_AVX512) && static_branch_likely(&poly1305_use_avx512))
|
||||
poly1305_blocks_avx512(ctx, inp, bytes, padbit);
|
||||
else if (IS_ENABLED(CONFIG_AS_AVX2) && static_branch_likely(&poly1305_use_avx2))
|
||||
else if (static_branch_likely(&poly1305_use_avx2))
|
||||
poly1305_blocks_avx2(ctx, inp, bytes, padbit);
|
||||
else
|
||||
poly1305_blocks_avx(ctx, inp, bytes, padbit);
|
||||
@ -123,7 +123,7 @@ static void poly1305_simd_blocks(void *ctx, const u8 *inp, size_t len,
|
||||
static void poly1305_simd_emit(void *ctx, u8 mac[POLY1305_DIGEST_SIZE],
|
||||
const u32 nonce[4])
|
||||
{
|
||||
if (!IS_ENABLED(CONFIG_AS_AVX) || !static_branch_likely(&poly1305_use_avx))
|
||||
if (!static_branch_likely(&poly1305_use_avx))
|
||||
poly1305_emit_x86_64(ctx, mac, nonce);
|
||||
else
|
||||
poly1305_emit_avx(ctx, mac, nonce);
|
||||
@ -261,11 +261,10 @@ static struct shash_alg alg = {
|
||||
|
||||
static int __init poly1305_simd_mod_init(void)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_AS_AVX) && boot_cpu_has(X86_FEATURE_AVX) &&
|
||||
if (boot_cpu_has(X86_FEATURE_AVX) &&
|
||||
cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL))
|
||||
static_branch_enable(&poly1305_use_avx);
|
||||
if (IS_ENABLED(CONFIG_AS_AVX2) && boot_cpu_has(X86_FEATURE_AVX) &&
|
||||
boot_cpu_has(X86_FEATURE_AVX2) &&
|
||||
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) &&
|
||||
|
@ -467,8 +467,6 @@ W_PRECALC_SSSE3
|
||||
*/
|
||||
SHA1_VECTOR_ASM sha1_transform_ssse3
|
||||
|
||||
#ifdef CONFIG_AS_AVX
|
||||
|
||||
.macro W_PRECALC_AVX
|
||||
|
||||
.purgem W_PRECALC_00_15
|
||||
@ -553,5 +551,3 @@ W_PRECALC_AVX
|
||||
* const u8 *data, int blocks);
|
||||
*/
|
||||
SHA1_VECTOR_ASM sha1_transform_avx
|
||||
|
||||
#endif
|
||||
|
@ -114,7 +114,6 @@ static void unregister_sha1_ssse3(void)
|
||||
crypto_unregister_shash(&sha1_ssse3_alg);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_AS_AVX
|
||||
asmlinkage void sha1_transform_avx(struct sha1_state *state,
|
||||
const u8 *data, int blocks);
|
||||
|
||||
@ -175,13 +174,6 @@ static void unregister_sha1_avx(void)
|
||||
crypto_unregister_shash(&sha1_avx_alg);
|
||||
}
|
||||
|
||||
#else /* CONFIG_AS_AVX */
|
||||
static inline int register_sha1_avx(void) { return 0; }
|
||||
static inline void unregister_sha1_avx(void) { }
|
||||
#endif /* CONFIG_AS_AVX */
|
||||
|
||||
|
||||
#if defined(CONFIG_AS_AVX2) && (CONFIG_AS_AVX)
|
||||
#define SHA1_AVX2_BLOCK_OPTSIZE 4 /* optimal 4*64 bytes of SHA1 blocks */
|
||||
|
||||
asmlinkage void sha1_transform_avx2(struct sha1_state *state,
|
||||
@ -253,11 +245,6 @@ static void unregister_sha1_avx2(void)
|
||||
crypto_unregister_shash(&sha1_avx2_alg);
|
||||
}
|
||||
|
||||
#else
|
||||
static inline int register_sha1_avx2(void) { return 0; }
|
||||
static inline void unregister_sha1_avx2(void) { }
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_AS_SHA1_NI
|
||||
asmlinkage void sha1_ni_transform(struct sha1_state *digest, const u8 *data,
|
||||
int rounds);
|
||||
|
@ -47,7 +47,6 @@
|
||||
# This code schedules 1 block at a time, with 4 lanes per block
|
||||
########################################################################
|
||||
|
||||
#ifdef CONFIG_AS_AVX
|
||||
#include <linux/linkage.h>
|
||||
|
||||
## assume buffers not aligned
|
||||
@ -498,5 +497,3 @@ _SHUF_00BA:
|
||||
# shuffle xDxC -> DC00
|
||||
_SHUF_DC00:
|
||||
.octa 0x0b0a090803020100FFFFFFFFFFFFFFFF
|
||||
|
||||
#endif
|
||||
|
@ -48,7 +48,6 @@
|
||||
# This code schedules 2 blocks at a time, with 4 lanes per block
|
||||
########################################################################
|
||||
|
||||
#ifdef CONFIG_AS_AVX2
|
||||
#include <linux/linkage.h>
|
||||
|
||||
## assume buffers not aligned
|
||||
@ -767,5 +766,3 @@ _SHUF_00BA:
|
||||
.align 32
|
||||
_SHUF_DC00:
|
||||
.octa 0x0b0a090803020100FFFFFFFFFFFFFFFF,0x0b0a090803020100FFFFFFFFFFFFFFFF
|
||||
|
||||
#endif
|
||||
|
@ -144,7 +144,6 @@ static void unregister_sha256_ssse3(void)
|
||||
ARRAY_SIZE(sha256_ssse3_algs));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_AS_AVX
|
||||
asmlinkage void sha256_transform_avx(struct sha256_state *state,
|
||||
const u8 *data, int blocks);
|
||||
|
||||
@ -221,12 +220,6 @@ static void unregister_sha256_avx(void)
|
||||
ARRAY_SIZE(sha256_avx_algs));
|
||||
}
|
||||
|
||||
#else
|
||||
static inline int register_sha256_avx(void) { return 0; }
|
||||
static inline void unregister_sha256_avx(void) { }
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_AS_AVX2) && defined(CONFIG_AS_AVX)
|
||||
asmlinkage void sha256_transform_rorx(struct sha256_state *state,
|
||||
const u8 *data, int blocks);
|
||||
|
||||
@ -301,11 +294,6 @@ static void unregister_sha256_avx2(void)
|
||||
ARRAY_SIZE(sha256_avx2_algs));
|
||||
}
|
||||
|
||||
#else
|
||||
static inline int register_sha256_avx2(void) { return 0; }
|
||||
static inline void unregister_sha256_avx2(void) { }
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_AS_SHA256_NI
|
||||
asmlinkage void sha256_ni_transform(struct sha256_state *digest,
|
||||
const u8 *data, int rounds);
|
||||
|
@ -47,7 +47,6 @@
|
||||
#
|
||||
########################################################################
|
||||
|
||||
#ifdef CONFIG_AS_AVX
|
||||
#include <linux/linkage.h>
|
||||
|
||||
.text
|
||||
@ -424,4 +423,3 @@ K512:
|
||||
.quad 0x3c9ebe0a15c9bebc,0x431d67c49c100d4c
|
||||
.quad 0x4cc5d4becb3e42b6,0x597f299cfc657e2a
|
||||
.quad 0x5fcb6fab3ad6faec,0x6c44198c4a475817
|
||||
#endif
|
||||
|
@ -49,7 +49,6 @@
|
||||
# This code schedules 1 blocks at a time, with 4 lanes per block
|
||||
########################################################################
|
||||
|
||||
#ifdef CONFIG_AS_AVX2
|
||||
#include <linux/linkage.h>
|
||||
|
||||
.text
|
||||
@ -749,5 +748,3 @@ PSHUFFLE_BYTE_FLIP_MASK:
|
||||
MASK_YMM_LO:
|
||||
.octa 0x00000000000000000000000000000000
|
||||
.octa 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
|
||||
#endif
|
||||
|
@ -142,7 +142,6 @@ static void unregister_sha512_ssse3(void)
|
||||
ARRAY_SIZE(sha512_ssse3_algs));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_AS_AVX
|
||||
asmlinkage void sha512_transform_avx(struct sha512_state *state,
|
||||
const u8 *data, int blocks);
|
||||
static bool avx_usable(void)
|
||||
@ -218,12 +217,7 @@ static void unregister_sha512_avx(void)
|
||||
crypto_unregister_shashes(sha512_avx_algs,
|
||||
ARRAY_SIZE(sha512_avx_algs));
|
||||
}
|
||||
#else
|
||||
static inline int register_sha512_avx(void) { return 0; }
|
||||
static inline void unregister_sha512_avx(void) { }
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_AS_AVX2) && defined(CONFIG_AS_AVX)
|
||||
asmlinkage void sha512_transform_rorx(struct sha512_state *state,
|
||||
const u8 *data, int blocks);
|
||||
|
||||
@ -298,10 +292,6 @@ static void unregister_sha512_avx2(void)
|
||||
crypto_unregister_shashes(sha512_avx2_algs,
|
||||
ARRAY_SIZE(sha512_avx2_algs));
|
||||
}
|
||||
#else
|
||||
static inline int register_sha512_avx2(void) { return 0; }
|
||||
static inline void unregister_sha512_avx2(void) { }
|
||||
#endif
|
||||
|
||||
static int __init sha512_ssse3_mod_init(void)
|
||||
{
|
||||
|
@ -6,15 +6,6 @@
|
||||
#warning "asm/dwarf2.h should be only included in pure assembly files"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macros for dwarf2 CFI unwind table entries.
|
||||
* See "as.info" for details on these pseudo ops. Unfortunately
|
||||
* they are only supported in very new binutils, so define them
|
||||
* away for older version.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_AS_CFI
|
||||
|
||||
#define CFI_STARTPROC .cfi_startproc
|
||||
#define CFI_ENDPROC .cfi_endproc
|
||||
#define CFI_DEF_CFA .cfi_def_cfa
|
||||
@ -30,13 +21,6 @@
|
||||
#define CFI_UNDEFINED .cfi_undefined
|
||||
#define CFI_ESCAPE .cfi_escape
|
||||
|
||||
#ifdef CONFIG_AS_CFI_SIGNAL_FRAME
|
||||
#define CFI_SIGNAL_FRAME .cfi_signal_frame
|
||||
#else
|
||||
#define CFI_SIGNAL_FRAME
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_AS_CFI_SECTIONS) && defined(__ASSEMBLY__)
|
||||
#ifndef BUILD_VDSO
|
||||
/*
|
||||
* Emit CFI data in .debug_frame sections, not .eh_frame sections.
|
||||
@ -53,33 +37,5 @@
|
||||
*/
|
||||
.cfi_sections .eh_frame, .debug_frame
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* Due to the structure of pre-exisiting code, don't use assembler line
|
||||
* comment character # to ignore the arguments. Instead, use a dummy macro.
|
||||
*/
|
||||
.macro cfi_ignore a=0, b=0, c=0, d=0
|
||||
.endm
|
||||
|
||||
#define CFI_STARTPROC cfi_ignore
|
||||
#define CFI_ENDPROC cfi_ignore
|
||||
#define CFI_DEF_CFA cfi_ignore
|
||||
#define CFI_DEF_CFA_REGISTER cfi_ignore
|
||||
#define CFI_DEF_CFA_OFFSET cfi_ignore
|
||||
#define CFI_ADJUST_CFA_OFFSET cfi_ignore
|
||||
#define CFI_OFFSET cfi_ignore
|
||||
#define CFI_REL_OFFSET cfi_ignore
|
||||
#define CFI_REGISTER cfi_ignore
|
||||
#define CFI_RESTORE cfi_ignore
|
||||
#define CFI_REMEMBER_STATE cfi_ignore
|
||||
#define CFI_RESTORE_STATE cfi_ignore
|
||||
#define CFI_UNDEFINED cfi_ignore
|
||||
#define CFI_ESCAPE cfi_ignore
|
||||
#define CFI_SIGNAL_FRAME cfi_ignore
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_X86_DWARF2_H */
|
||||
|
@ -11,8 +11,6 @@
|
||||
* Based on Ingo Molnar and Zach Brown's respective MMX and SSE routines
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_AS_AVX
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <asm/fpu/api.h>
|
||||
|
||||
@ -170,11 +168,4 @@ do { \
|
||||
#define AVX_SELECT(FASTEST) \
|
||||
(boot_cpu_has(X86_FEATURE_AVX) && boot_cpu_has(X86_FEATURE_OSXSAVE) ? &xor_block_avx : FASTEST)
|
||||
|
||||
#else
|
||||
|
||||
#define AVX_XOR_SPEED {}
|
||||
|
||||
#define AVX_SELECT(FASTEST) (FASTEST)
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -28,9 +28,6 @@ subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
|
||||
CFLAGS_i915_pci.o = $(call cc-disable-warning, override-init)
|
||||
CFLAGS_display/intel_fbdev.o = $(call cc-disable-warning, override-init)
|
||||
|
||||
subdir-ccflags-y += \
|
||||
$(call as-instr,movntdqa (%eax)$(comma)%xmm0,-DCONFIG_AS_MOVNTDQA)
|
||||
|
||||
subdir-ccflags-y += -I$(srctree)/$(src)
|
||||
|
||||
# Please keep these build lists sorted!
|
||||
|
@ -35,7 +35,6 @@
|
||||
|
||||
static DEFINE_STATIC_KEY_FALSE(has_movntdqa);
|
||||
|
||||
#ifdef CONFIG_AS_MOVNTDQA
|
||||
static void __memcpy_ntdqa(void *dst, const void *src, unsigned long len)
|
||||
{
|
||||
kernel_fpu_begin();
|
||||
@ -93,10 +92,6 @@ static void __memcpy_ntdqu(void *dst, const void *src, unsigned long len)
|
||||
|
||||
kernel_fpu_end();
|
||||
}
|
||||
#else
|
||||
static void __memcpy_ntdqa(void *dst, const void *src, unsigned long len) {}
|
||||
static void __memcpy_ntdqu(void *dst, const void *src, unsigned long len) {}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* i915_memcpy_from_wc: perform an accelerated *aligned* read from WC
|
||||
|
@ -33,8 +33,7 @@ bool __must_check curve25519(u8 mypublic[CURVE25519_KEY_SIZE],
|
||||
const u8 secret[CURVE25519_KEY_SIZE],
|
||||
const u8 basepoint[CURVE25519_KEY_SIZE])
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519) &&
|
||||
(!IS_ENABLED(CONFIG_CRYPTO_CURVE25519_X86) || IS_ENABLED(CONFIG_AS_ADX)))
|
||||
if (IS_ENABLED(CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519))
|
||||
curve25519_arch(mypublic, secret, basepoint);
|
||||
else
|
||||
curve25519_generic(mypublic, secret, basepoint);
|
||||
@ -50,8 +49,7 @@ __must_check curve25519_generate_public(u8 pub[CURVE25519_KEY_SIZE],
|
||||
CURVE25519_KEY_SIZE)))
|
||||
return false;
|
||||
|
||||
if (IS_ENABLED(CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519) &&
|
||||
(!IS_ENABLED(CONFIG_CRYPTO_CURVE25519_X86) || IS_ENABLED(CONFIG_AS_ADX)))
|
||||
if (IS_ENABLED(CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519))
|
||||
curve25519_base_arch(pub, secret);
|
||||
else
|
||||
curve25519_generic(pub, secret, curve25519_base_point);
|
||||
|
@ -35,4 +35,4 @@ include/generated/compile.h: FORCE
|
||||
@$($(quiet)chk_compile.h)
|
||||
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
|
||||
"$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" \
|
||||
"$(CONFIG_PREEMPT_RT)" "$(CC) $(KBUILD_CFLAGS)"
|
||||
"$(CONFIG_PREEMPT_RT)" "$(CC)" "$(LD)"
|
||||
|
@ -34,10 +34,8 @@ const struct raid6_calls * const raid6_algos[] = {
|
||||
&raid6_avx512x2,
|
||||
&raid6_avx512x1,
|
||||
#endif
|
||||
#ifdef CONFIG_AS_AVX2
|
||||
&raid6_avx2x2,
|
||||
&raid6_avx2x1,
|
||||
#endif
|
||||
&raid6_sse2x2,
|
||||
&raid6_sse2x1,
|
||||
&raid6_sse1x2,
|
||||
@ -51,11 +49,9 @@ const struct raid6_calls * const raid6_algos[] = {
|
||||
&raid6_avx512x2,
|
||||
&raid6_avx512x1,
|
||||
#endif
|
||||
#ifdef CONFIG_AS_AVX2
|
||||
&raid6_avx2x4,
|
||||
&raid6_avx2x2,
|
||||
&raid6_avx2x1,
|
||||
#endif
|
||||
&raid6_sse2x4,
|
||||
&raid6_sse2x2,
|
||||
&raid6_sse2x1,
|
||||
@ -97,13 +93,11 @@ void (*raid6_datap_recov)(int, size_t, int, void **);
|
||||
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
|
||||
#ifdef CONFIG_AS_AVX2
|
||||
&raid6_recov_avx2,
|
||||
#endif
|
||||
#ifdef CONFIG_AS_SSSE3
|
||||
&raid6_recov_ssse3,
|
||||
#endif
|
||||
#ifdef CONFIG_S390
|
||||
|
@ -13,8 +13,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_AS_AVX2
|
||||
|
||||
#include <linux/raid/pq.h>
|
||||
#include "x86.h"
|
||||
|
||||
@ -470,5 +468,3 @@ const struct raid6_calls raid6_avx2x4 = {
|
||||
1 /* Has cache hints */
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_AS_AVX2 */
|
||||
|
@ -4,8 +4,6 @@
|
||||
* Author: Jim Kukunas <james.t.kukunas@linux.intel.com>
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_AS_AVX2
|
||||
|
||||
#include <linux/raid/pq.h>
|
||||
#include "x86.h"
|
||||
|
||||
@ -313,7 +311,3 @@ const struct raid6_recov_calls raid6_recov_avx2 = {
|
||||
#endif
|
||||
.priority = 2,
|
||||
};
|
||||
|
||||
#else
|
||||
#warning "your version of binutils lacks AVX2 support"
|
||||
#endif
|
||||
|
@ -3,8 +3,6 @@
|
||||
* Copyright (C) 2012 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_AS_SSSE3
|
||||
|
||||
#include <linux/raid/pq.h>
|
||||
#include "x86.h"
|
||||
|
||||
@ -328,7 +326,3 @@ const struct raid6_recov_calls raid6_recov_ssse3 = {
|
||||
#endif
|
||||
.priority = 1,
|
||||
};
|
||||
|
||||
#else
|
||||
#warning "your version of binutils lacks SSSE3 support"
|
||||
#endif
|
||||
|
@ -34,14 +34,9 @@ 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 += $(shell echo "pshufb %xmm0, %xmm0" | \
|
||||
gcc -c -x assembler - >&/dev/null && \
|
||||
rm ./-.o && echo -DCONFIG_AS_SSSE3=1)
|
||||
CFLAGS += $(shell echo "vpbroadcastb %xmm0, %ymm1" | \
|
||||
gcc -c -x assembler - >&/dev/null && \
|
||||
rm ./-.o && echo -DCONFIG_AS_AVX2=1)
|
||||
CFLAGS += -DCONFIG_X86
|
||||
CFLAGS += $(shell echo "vpmovm2b %k1, %zmm5" | \
|
||||
gcc -c -x assembler - >&/dev/null && \
|
||||
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
|
||||
|
@ -83,7 +83,7 @@ nf_tables-objs := nf_tables_core.o nf_tables_api.o nft_chain_filter.o \
|
||||
nft_set_pipapo.o
|
||||
|
||||
ifdef CONFIG_X86_64
|
||||
ifneq (,$(findstring -DCONFIG_AS_AVX2=1,$(KBUILD_CFLAGS)))
|
||||
ifndef CONFIG_UML
|
||||
nf_tables-objs += nft_set_pipapo_avx2.o
|
||||
endif
|
||||
endif
|
||||
|
@ -3291,7 +3291,7 @@ static const struct nft_set_type *nft_set_types[] = {
|
||||
&nft_set_rhash_type,
|
||||
&nft_set_bitmap_type,
|
||||
&nft_set_rbtree_type,
|
||||
#if defined(CONFIG_X86_64) && defined(CONFIG_AS_AVX2)
|
||||
#if defined(CONFIG_X86_64) && !defined(CONFIG_UML)
|
||||
&nft_set_pipapo_avx2_type,
|
||||
#endif
|
||||
&nft_set_pipapo_type,
|
||||
|
@ -2201,7 +2201,7 @@ const struct nft_set_type nft_set_pipapo_type = {
|
||||
},
|
||||
};
|
||||
|
||||
#if defined(CONFIG_X86_64) && defined(CONFIG_AS_AVX2)
|
||||
#if defined(CONFIG_X86_64) && !defined(CONFIG_UML)
|
||||
const struct nft_set_type nft_set_pipapo_avx2_type = {
|
||||
.features = NFT_SET_INTERVAL | NFT_SET_MAP | NFT_SET_OBJECT |
|
||||
NFT_SET_TIMEOUT,
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _NFT_SET_PIPAPO_AVX2_H
|
||||
|
||||
#ifdef CONFIG_AS_AVX2
|
||||
#if defined(CONFIG_X86_64) && !defined(CONFIG_UML)
|
||||
#include <asm/fpu/xstate.h>
|
||||
#define NFT_PIPAPO_ALIGN (XSAVE_YMM_SIZE / BITS_PER_BYTE)
|
||||
|
||||
@ -9,6 +9,6 @@ bool nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set,
|
||||
const u32 *key, const struct nft_set_ext **ext);
|
||||
bool nft_pipapo_avx2_estimate(const struct nft_set_desc *desc, u32 features,
|
||||
struct nft_set_estimate *est);
|
||||
#endif /* CONFIG_AS_AVX2 */
|
||||
#endif /* defined(CONFIG_X86_64) && !defined(CONFIG_UML) */
|
||||
|
||||
#endif /* _NFT_SET_PIPAPO_AVX2_H */
|
||||
|
@ -48,9 +48,6 @@ $(error-if,$(failure,command -v $(LD)),linker '$(LD)' not found)
|
||||
# Fail if the linker is gold as it's not capable of linking the kernel proper
|
||||
$(error-if,$(success, $(LD) -v | grep -q gold), gold linker '$(LD)' not supported)
|
||||
|
||||
# gcc version including patch level
|
||||
gcc-version := $(shell,$(srctree)/scripts/gcc-version.sh $(CC))
|
||||
|
||||
# machine bit flags
|
||||
# $(m32-flag): -m32 if the compiler supports it, or an empty string otherwise.
|
||||
# $(m64-flag): -m64 if the compiler supports it, or an empty string otherwise.
|
||||
|
@ -2,10 +2,6 @@
|
||||
###
|
||||
# scripts contains sources for various helper programs used throughout
|
||||
# the kernel for the build process.
|
||||
# ---------------------------------------------------------------------------
|
||||
# kallsyms: Find all symbols in vmlinux
|
||||
|
||||
HOST_EXTRACFLAGS += -I$(srctree)/tools/include
|
||||
|
||||
always-$(CONFIG_BUILD_BIN2C) += bin2c
|
||||
always-$(CONFIG_KALLSYMS) += kallsyms
|
||||
|
@ -46,7 +46,7 @@ include $(kbuild-file)
|
||||
include scripts/Makefile.lib
|
||||
|
||||
# Do not include host rules unless needed
|
||||
ifneq ($(hostprogs)$(hostlibs-y)$(hostlibs-m)$(hostcxxlibs-y)$(hostcxxlibs-m),)
|
||||
ifneq ($(hostprogs)$(hostcxxlibs-y)$(hostcxxlibs-m),)
|
||||
include scripts/Makefile.host
|
||||
endif
|
||||
|
||||
@ -65,7 +65,6 @@ endif
|
||||
|
||||
ifneq ($(strip $(lib-y) $(lib-m) $(lib-)),)
|
||||
lib-target := $(obj)/lib.a
|
||||
real-obj-y += $(obj)/lib-ksyms.o
|
||||
endif
|
||||
|
||||
ifdef need-builtin
|
||||
@ -410,22 +409,6 @@ $(lib-target): $(lib-y) FORCE
|
||||
|
||||
targets += $(lib-target)
|
||||
|
||||
dummy-object = $(obj)/.lib_exports.o
|
||||
ksyms-lds = $(dot-target).lds
|
||||
|
||||
quiet_cmd_export_list = EXPORTS $@
|
||||
cmd_export_list = $(OBJDUMP) -h $< | \
|
||||
sed -ne '/___ksymtab/s/.*+\([^ ]*\).*/EXTERN(\1)/p' >$(ksyms-lds);\
|
||||
rm -f $(dummy-object);\
|
||||
echo | $(CC) $(a_flags) -c -o $(dummy-object) -x assembler -;\
|
||||
$(LD) $(ld_flags) -r -o $@ -T $(ksyms-lds) $(dummy-object);\
|
||||
rm $(dummy-object) $(ksyms-lds)
|
||||
|
||||
$(obj)/lib-ksyms.o: $(lib-target) FORCE
|
||||
$(call if_changed,export_list)
|
||||
|
||||
targets += $(obj)/lib-ksyms.o
|
||||
|
||||
endif
|
||||
|
||||
# NOTE:
|
||||
|
@ -30,7 +30,6 @@ subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn))
|
||||
__clean-files := $(extra-y) $(extra-m) $(extra-) \
|
||||
$(always) $(always-y) $(always-m) $(always-) $(targets) $(clean-files) \
|
||||
$(hostprogs) $(hostprogs-y) $(hostprogs-m) $(hostprogs-) \
|
||||
$(hostlibs-y) $(hostlibs-m) $(hostlibs-) \
|
||||
$(hostcxxlibs-y) $(hostcxxlibs-m)
|
||||
|
||||
__clean-files := $(filter-out $(no-clean-files), $(__clean-files))
|
||||
|
@ -49,6 +49,7 @@ KBUILD_CFLAGS += -Wno-format
|
||||
KBUILD_CFLAGS += -Wno-sign-compare
|
||||
KBUILD_CFLAGS += -Wno-format-zero-length
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, pointer-to-enum-cast)
|
||||
KBUILD_CFLAGS += -Wno-tautological-constant-out-of-range-compare
|
||||
endif
|
||||
|
||||
endif
|
||||
|
@ -39,7 +39,6 @@ $(obj)/%.tab.c $(obj)/%.tab.h: $(src)/%.y FORCE
|
||||
# They are linked as C++ code to the executable qconf
|
||||
|
||||
__hostprogs := $(sort $(hostprogs))
|
||||
host-cshlib := $(sort $(hostlibs-y) $(hostlibs-m))
|
||||
host-cxxshlib := $(sort $(hostcxxlibs-y) $(hostcxxlibs-m))
|
||||
|
||||
# C code
|
||||
@ -63,7 +62,6 @@ host-cxxmulti := $(foreach m,$(__hostprogs),$(if $($(m)-cxxobjs),$(m)))
|
||||
host-cxxobjs := $(sort $(foreach m,$(host-cxxmulti),$($(m)-cxxobjs)))
|
||||
|
||||
# Object (.o) files used by the shared libaries
|
||||
host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs))))
|
||||
host-cxxshobjs := $(sort $(foreach m,$(host-cxxshlib),$($(m:.so=-objs))))
|
||||
|
||||
host-csingle := $(addprefix $(obj)/,$(host-csingle))
|
||||
@ -71,9 +69,7 @@ host-cmulti := $(addprefix $(obj)/,$(host-cmulti))
|
||||
host-cobjs := $(addprefix $(obj)/,$(host-cobjs))
|
||||
host-cxxmulti := $(addprefix $(obj)/,$(host-cxxmulti))
|
||||
host-cxxobjs := $(addprefix $(obj)/,$(host-cxxobjs))
|
||||
host-cshlib := $(addprefix $(obj)/,$(host-cshlib))
|
||||
host-cxxshlib := $(addprefix $(obj)/,$(host-cxxshlib))
|
||||
host-cshobjs := $(addprefix $(obj)/,$(host-cshobjs))
|
||||
host-cxxshobjs := $(addprefix $(obj)/,$(host-cxxshobjs))
|
||||
|
||||
#####
|
||||
@ -140,13 +136,6 @@ quiet_cmd_host-cxxobjs = HOSTCXX $@
|
||||
$(host-cxxobjs): $(obj)/%.o: $(src)/%.cc FORCE
|
||||
$(call if_changed_dep,host-cxxobjs)
|
||||
|
||||
# Compile .c file, create position independent .o file
|
||||
# host-cshobjs -> .o
|
||||
quiet_cmd_host-cshobjs = HOSTCC -fPIC $@
|
||||
cmd_host-cshobjs = $(HOSTCC) $(hostc_flags) -fPIC -c -o $@ $<
|
||||
$(host-cshobjs): $(obj)/%.o: $(src)/%.c FORCE
|
||||
$(call if_changed_dep,host-cshobjs)
|
||||
|
||||
# Compile .c file, create position independent .o file
|
||||
# Note that plugin capable gcc versions can be either C or C++ based
|
||||
# therefore plugin source files have to be compilable in both C and C++ mode.
|
||||
@ -157,16 +146,6 @@ quiet_cmd_host-cxxshobjs = HOSTCXX -fPIC $@
|
||||
$(host-cxxshobjs): $(obj)/%.o: $(src)/%.c FORCE
|
||||
$(call if_changed_dep,host-cxxshobjs)
|
||||
|
||||
# Link a shared library, based on position independent .o files
|
||||
# *.o -> .so shared library (host-cshlib)
|
||||
quiet_cmd_host-cshlib = HOSTLLD -shared $@
|
||||
cmd_host-cshlib = $(HOSTCC) $(KBUILD_HOSTLDFLAGS) -shared -o $@ \
|
||||
$(addprefix $(obj)/, $($(target-stem)-objs)) \
|
||||
$(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(target-stem).so)
|
||||
$(host-cshlib): FORCE
|
||||
$(call if_changed,host-cshlib)
|
||||
$(call multi_depend, $(host-cshlib), .so, -objs)
|
||||
|
||||
# Link a shared library, based on position independent .o files
|
||||
# *.o -> .so shared library (host-cxxshlib)
|
||||
quiet_cmd_host-cxxshlib = HOSTLLD -shared $@
|
||||
@ -178,4 +157,4 @@ $(host-cxxshlib): FORCE
|
||||
$(call multi_depend, $(host-cxxshlib), .so, -objs)
|
||||
|
||||
targets += $(host-csingle) $(host-cmulti) $(host-cobjs)\
|
||||
$(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs) $(host-cxxshlib) $(host-cxxshobjs)
|
||||
$(host-cxxmulti) $(host-cxxobjs) $(host-cxxshlib) $(host-cxxshobjs)
|
||||
|
91
scripts/dummy-tools/gcc
Executable file
91
scripts/dummy-tools/gcc
Executable file
@ -0,0 +1,91 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# Staring v4.18, Kconfig evaluates compiler capabilities, and hides CONFIG
|
||||
# options your compiler does not support. This works well if you configure and
|
||||
# build the kernel on the same host machine.
|
||||
#
|
||||
# It is inconvenient if you prepare the .config that is carried to a different
|
||||
# build environment (typically this happens when you package the kernel for
|
||||
# distros) because using a different compiler potentially produces different
|
||||
# CONFIG options than the real build environment. So, you probably want to make
|
||||
# as many options visible as possible. In other words, you need to create a
|
||||
# super-set of CONFIG options that cover any build environment. If some of the
|
||||
# CONFIG options turned out to be unsupported on the build machine, they are
|
||||
# automatically disabled by the nature of Kconfig.
|
||||
#
|
||||
# However, it is not feasible to get a full-featured compiler for every arch.
|
||||
# Hence these dummy toolchains to make all compiler tests pass.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# From the top directory of the source tree, run
|
||||
#
|
||||
# $ make CROSS_COMPILE=scripts/dummy-tools/ oldconfig
|
||||
#
|
||||
# Most of compiler features are tested by cc-option, which simply checks the
|
||||
# exit code of $(CC). This script does nothing and just exits with 0 in most
|
||||
# cases. So, $(cc-option, ...) is evaluated as 'y'.
|
||||
#
|
||||
# This scripts caters to more checks; handle --version and pre-process __GNUC__
|
||||
# etc. to pretend to be GCC, and also do right things to satisfy some scripts.
|
||||
|
||||
# Check if the first parameter appears in the rest. Succeeds if found.
|
||||
# This helper is useful if a particular option was passed to this script.
|
||||
# Typically used like this:
|
||||
# arg_contain <word-you-are-searching-for> "$@"
|
||||
arg_contain ()
|
||||
{
|
||||
search="$1"
|
||||
shift
|
||||
|
||||
while [ $# -gt 0 ]
|
||||
do
|
||||
if [ "$search" = "$1" ]; then
|
||||
return 0
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
# To set CONFIG_CC_IS_GCC=y
|
||||
if arg_contain --version "$@"; then
|
||||
echo "gcc (scripts/dummy-tools/gcc)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if arg_contain -E "$@"; then
|
||||
# For scripts/gcc-version.sh; This emulates GCC 20.0.0
|
||||
if arg_contain - "$@"; then
|
||||
sed 's/^__GNUC__$/20/; s/^__GNUC_MINOR__$/0/; s/^__GNUC_PATCHLEVEL__$/0/'
|
||||
exit 0
|
||||
else
|
||||
echo "no input files" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if arg_contain -S "$@"; then
|
||||
# For scripts/gcc-x86-*-has-stack-protector.sh
|
||||
if arg_contain -fstack-protector "$@"; then
|
||||
echo "%gs"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# For scripts/gcc-plugin.sh
|
||||
if arg_contain -print-file-name=plugin "$@"; then
|
||||
plugin_dir=$(mktemp -d)
|
||||
|
||||
sed -n 's/.*#include "\(.*\)"/\1/p' $(dirname $0)/../gcc-plugins/gcc-common.h |
|
||||
while read header
|
||||
do
|
||||
mkdir -p $plugin_dir/include/$(dirname $header)
|
||||
touch $plugin_dir/include/$header
|
||||
done
|
||||
|
||||
echo $plugin_dir
|
||||
exit 0
|
||||
fi
|
30
scripts/dummy-tools/ld
Executable file
30
scripts/dummy-tools/ld
Executable file
@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
# Dummy script that always succeeds.
|
||||
|
||||
# Check if the first parameter appears in the rest. Succeeds if found.
|
||||
# This helper is useful if a particular option was passed to this script.
|
||||
# Typically used like this:
|
||||
# arg_contain <word-you-are-searching-for> "$@"
|
||||
arg_contain ()
|
||||
{
|
||||
search="$1"
|
||||
shift
|
||||
|
||||
while [ $# -gt 0 ]
|
||||
do
|
||||
if [ "$search" = "$1" ]; then
|
||||
return 0
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
if arg_contain --version "$@" || arg_contain -v "$@"; then
|
||||
progname=$(basename $0)
|
||||
echo "GNU $progname (scripts/dummy-tools/$progname) 2.50"
|
||||
exit 0
|
||||
fi
|
1
scripts/dummy-tools/nm
Symbolic link
1
scripts/dummy-tools/nm
Symbolic link
@ -0,0 +1 @@
|
||||
ld
|
1
scripts/dummy-tools/objcopy
Symbolic link
1
scripts/dummy-tools/objcopy
Symbolic link
@ -0,0 +1 @@
|
||||
ld
|
@ -1,49 +1,14 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
set -e
|
||||
|
||||
srctree=$(dirname "$0")
|
||||
|
||||
SHOW_ERROR=
|
||||
if [ "$1" = "--show-error" ] ; then
|
||||
SHOW_ERROR=1
|
||||
shift || true
|
||||
fi
|
||||
|
||||
gccplugins_dir=$($3 -print-file-name=plugin)
|
||||
plugincc=$($1 -E -x c++ - -o /dev/null -I"${srctree}"/gcc-plugins -I"${gccplugins_dir}"/include 2>&1 <<EOF
|
||||
#include "gcc-common.h"
|
||||
#if BUILDING_GCC_VERSION >= 4008 || defined(ENABLE_BUILD_WITH_CXX)
|
||||
#warning $2 CXX
|
||||
#else
|
||||
#warning $1 CC
|
||||
#endif
|
||||
EOF
|
||||
)
|
||||
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
if [ -n "$SHOW_ERROR" ] ; then
|
||||
echo "${plugincc}" >&2
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$plugincc" in
|
||||
*"$1 CC"*)
|
||||
echo "$1"
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*"$2 CXX"*)
|
||||
# the c++ compiler needs another test, see below
|
||||
;;
|
||||
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
gccplugins_dir=$($* -print-file-name=plugin)
|
||||
|
||||
# we need a c++ compiler that supports the designated initializer GNU extension
|
||||
plugincc=$($2 -c -x c++ -std=gnu++98 - -fsyntax-only -I"${srctree}"/gcc-plugins -I"${gccplugins_dir}"/include 2>&1 <<EOF
|
||||
$HOSTCC -c -x c++ -std=gnu++98 - -fsyntax-only -I $srctree/gcc-plugins -I $gccplugins_dir/include 2>/dev/null <<EOF
|
||||
#include "gcc-common.h"
|
||||
class test {
|
||||
public:
|
||||
@ -52,15 +17,3 @@ public:
|
||||
.test = 1
|
||||
};
|
||||
EOF
|
||||
)
|
||||
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo "$2"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -n "$SHOW_ERROR" ] ; then
|
||||
echo "${plugincc}" >&2
|
||||
fi
|
||||
exit 1
|
||||
|
@ -1,13 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
preferred-plugin-hostcc := $(if-success,[ $(gcc-version) -ge 40800 ],$(HOSTCXX),$(HOSTCC))
|
||||
|
||||
config PLUGIN_HOSTCC
|
||||
string
|
||||
default "$(shell,$(srctree)/scripts/gcc-plugin.sh "$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")" if CC_IS_GCC
|
||||
help
|
||||
Host compiler used to build GCC plugins. This can be $(HOSTCXX),
|
||||
$(HOSTCC), or a null string if GCC plugin is unsupported.
|
||||
|
||||
config HAVE_GCC_PLUGINS
|
||||
bool
|
||||
help
|
||||
@ -17,7 +8,8 @@ config HAVE_GCC_PLUGINS
|
||||
menuconfig GCC_PLUGINS
|
||||
bool "GCC plugins"
|
||||
depends on HAVE_GCC_PLUGINS
|
||||
depends on PLUGIN_HOSTCC != ""
|
||||
depends on CC_IS_GCC && GCC_VERSION >= 40800
|
||||
depends on $(success,$(srctree)/scripts/gcc-plugin.sh $(CC))
|
||||
default y
|
||||
help
|
||||
GCC plugins are loadable modules that provide extra features to the
|
||||
|
@ -1,18 +1,9 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
PLUGINCC := $(CONFIG_PLUGIN_HOSTCC:"%"=%)
|
||||
GCC_PLUGINS_DIR := $(shell $(CC) -print-file-name=plugin)
|
||||
|
||||
ifeq ($(PLUGINCC),$(HOSTCC))
|
||||
HOSTLIBS := hostlibs
|
||||
HOST_EXTRACFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu99 -ggdb
|
||||
export HOST_EXTRACFLAGS
|
||||
else
|
||||
HOSTLIBS := hostcxxlibs
|
||||
HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++98 -fno-rtti
|
||||
HOST_EXTRACXXFLAGS += -fno-exceptions -fasynchronous-unwind-tables -ggdb
|
||||
HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable -Wno-c++11-compat
|
||||
export HOST_EXTRACXXFLAGS
|
||||
endif
|
||||
HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++98 -fno-rtti
|
||||
HOST_EXTRACXXFLAGS += -fno-exceptions -fasynchronous-unwind-tables -ggdb
|
||||
HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable -Wno-c++11-compat
|
||||
|
||||
$(obj)/randomize_layout_plugin.o: $(objtree)/$(obj)/randomize_layout_seed.h
|
||||
quiet_cmd_create_randomize_layout_seed = GENSEED $@
|
||||
@ -22,9 +13,9 @@ $(objtree)/$(obj)/randomize_layout_seed.h: FORCE
|
||||
$(call if_changed,create_randomize_layout_seed)
|
||||
targets = randomize_layout_seed.h randomize_layout_hash.h
|
||||
|
||||
$(HOSTLIBS)-y := $(foreach p,$(GCC_PLUGIN),$(if $(findstring /,$(p)),,$(p)))
|
||||
always-y := $($(HOSTLIBS)-y)
|
||||
hostcxxlibs-y := $(foreach p,$(GCC_PLUGIN),$(if $(findstring /,$(p)),,$(p)))
|
||||
always-y := $(hostcxxlibs-y)
|
||||
|
||||
$(foreach p,$($(HOSTLIBS)-y:%.so=%),$(eval $(p)-objs := $(p).o))
|
||||
$(foreach p,$(hostcxxlibs-y:%.so=%),$(eval $(p)-objs := $(p).o))
|
||||
|
||||
clean-files += *.so
|
||||
|
@ -154,9 +154,9 @@ void ConfigItem::updateMenu(void)
|
||||
|
||||
if (!sym_is_changeable(sym) && list->optMode == normalOpt) {
|
||||
setPixmap(promptColIdx, QIcon());
|
||||
setText(noColIdx, QString::null);
|
||||
setText(modColIdx, QString::null);
|
||||
setText(yesColIdx, QString::null);
|
||||
setText(noColIdx, QString());
|
||||
setText(modColIdx, QString());
|
||||
setText(yesColIdx, QString());
|
||||
break;
|
||||
}
|
||||
expr = sym_get_tristate_value(sym);
|
||||
@ -276,7 +276,7 @@ void ConfigLineEdit::show(ConfigItem* i)
|
||||
if (sym_get_string_value(item->menu->sym))
|
||||
setText(QString::fromLocal8Bit(sym_get_string_value(item->menu->sym)));
|
||||
else
|
||||
setText(QString::null);
|
||||
setText(QString());
|
||||
Parent::show();
|
||||
setFocus();
|
||||
}
|
||||
@ -316,7 +316,10 @@ ConfigList::ConfigList(ConfigView* p, const char *name)
|
||||
setVerticalScrollMode(ScrollPerPixel);
|
||||
setHorizontalScrollMode(ScrollPerPixel);
|
||||
|
||||
setHeaderLabels(QStringList() << "Option" << "Name" << "N" << "M" << "Y" << "Value");
|
||||
if (mode == symbolMode)
|
||||
setHeaderLabels(QStringList() << "Item" << "Name" << "N" << "M" << "Y" << "Value");
|
||||
else
|
||||
setHeaderLabels(QStringList() << "Option" << "Name" << "N" << "M" << "Y" << "Value");
|
||||
|
||||
connect(this, SIGNAL(itemSelectionChanged(void)),
|
||||
SLOT(updateSelection(void)));
|
||||
@ -397,6 +400,11 @@ void ConfigList::updateSelection(void)
|
||||
struct menu *menu;
|
||||
enum prop_type type;
|
||||
|
||||
if (mode == symbolMode)
|
||||
setHeaderLabels(QStringList() << "Item" << "Name" << "N" << "M" << "Y" << "Value");
|
||||
else
|
||||
setHeaderLabels(QStringList() << "Option" << "Name" << "N" << "M" << "Y" << "Value");
|
||||
|
||||
if (selectedItems().count() == 0)
|
||||
return;
|
||||
|
||||
@ -625,7 +633,7 @@ void ConfigList::updateMenuList(ConfigItem *parent, struct menu* menu)
|
||||
last = item;
|
||||
continue;
|
||||
}
|
||||
hide:
|
||||
hide:
|
||||
if (item && item->menu == child) {
|
||||
last = parent->firstChild();
|
||||
if (last == item)
|
||||
@ -690,7 +698,7 @@ void ConfigList::updateMenuList(ConfigList *parent, struct menu* menu)
|
||||
last = item;
|
||||
continue;
|
||||
}
|
||||
hide:
|
||||
hide:
|
||||
if (item && item->menu == child) {
|
||||
last = (ConfigItem*)parent->topLevelItem(0);
|
||||
if (last == item)
|
||||
@ -734,7 +742,10 @@ void ConfigList::keyPressEvent(QKeyEvent* ev)
|
||||
type = menu->prompt ? menu->prompt->type : P_UNKNOWN;
|
||||
if (type == P_MENU && rootEntry != menu &&
|
||||
mode != fullMode && mode != menuMode) {
|
||||
emit menuSelected(menu);
|
||||
if (mode == menuMode)
|
||||
emit menuSelected(menu);
|
||||
else
|
||||
emit itemSelected(menu);
|
||||
break;
|
||||
}
|
||||
case Qt::Key_Space:
|
||||
@ -826,7 +837,7 @@ void ConfigList::mouseMoveEvent(QMouseEvent* e)
|
||||
|
||||
void ConfigList::mouseDoubleClickEvent(QMouseEvent* e)
|
||||
{
|
||||
QPoint p = e->pos(); // TODO: Check if this works(was contentsToViewport).
|
||||
QPoint p = e->pos();
|
||||
ConfigItem* item = (ConfigItem*)itemAt(p);
|
||||
struct menu *menu;
|
||||
enum prop_type ptype;
|
||||
@ -841,9 +852,12 @@ void ConfigList::mouseDoubleClickEvent(QMouseEvent* e)
|
||||
if (!menu)
|
||||
goto skip;
|
||||
ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN;
|
||||
if (ptype == P_MENU && (mode == singleMode || mode == symbolMode))
|
||||
emit menuSelected(menu);
|
||||
else if (menu->sym)
|
||||
if (ptype == P_MENU) {
|
||||
if (mode == singleMode)
|
||||
emit itemSelected(menu);
|
||||
else if (mode == symbolMode)
|
||||
emit menuSelected(menu);
|
||||
} else if (menu->sym)
|
||||
changeValue(item);
|
||||
|
||||
skip:
|
||||
@ -1223,10 +1237,11 @@ QMenu* ConfigInfoView::createStandardContextMenu(const QPoint & pos)
|
||||
{
|
||||
QMenu* popup = Parent::createStandardContextMenu(pos);
|
||||
QAction* action = new QAction("Show Debug Info", popup);
|
||||
action->setCheckable(true);
|
||||
connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool)));
|
||||
connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool)));
|
||||
action->setChecked(showDebug());
|
||||
|
||||
action->setCheckable(true);
|
||||
connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool)));
|
||||
connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool)));
|
||||
action->setChecked(showDebug());
|
||||
popup->addSeparator();
|
||||
popup->addAction(action);
|
||||
return popup;
|
||||
@ -1352,21 +1367,32 @@ ConfigMainWindow::ConfigMainWindow(void)
|
||||
if ((x.isValid())&&(y.isValid()))
|
||||
move(x.toInt(), y.toInt());
|
||||
|
||||
split1 = new QSplitter(this);
|
||||
split1->setOrientation(Qt::Horizontal);
|
||||
setCentralWidget(split1);
|
||||
QWidget *widget = new QWidget(this);
|
||||
QVBoxLayout *layout = new QVBoxLayout(widget);
|
||||
setCentralWidget(widget);
|
||||
|
||||
menuView = new ConfigView(split1, "menu");
|
||||
split1 = new QSplitter(widget);
|
||||
split1->setOrientation(Qt::Horizontal);
|
||||
split1->setChildrenCollapsible(false);
|
||||
|
||||
menuView = new ConfigView(widget, "menu");
|
||||
menuList = menuView->list;
|
||||
|
||||
split2 = new QSplitter(split1);
|
||||
split2 = new QSplitter(widget);
|
||||
split2->setChildrenCollapsible(false);
|
||||
split2->setOrientation(Qt::Vertical);
|
||||
|
||||
// create config tree
|
||||
configView = new ConfigView(split2, "config");
|
||||
configView = new ConfigView(widget, "config");
|
||||
configList = configView->list;
|
||||
|
||||
helpText = new ConfigInfoView(split2, "help");
|
||||
helpText = new ConfigInfoView(widget, "help");
|
||||
|
||||
layout->addWidget(split2);
|
||||
split2->addWidget(split1);
|
||||
split1->addWidget(configView);
|
||||
split1->addWidget(menuView);
|
||||
split2->addWidget(helpText);
|
||||
|
||||
setTabOrder(configList, helpText);
|
||||
configList->setFocus();
|
||||
@ -1484,6 +1510,8 @@ ConfigMainWindow::ConfigMainWindow(void)
|
||||
helpText, SLOT(setInfo(struct menu *)));
|
||||
connect(configList, SIGNAL(menuSelected(struct menu *)),
|
||||
SLOT(changeMenu(struct menu *)));
|
||||
connect(configList, SIGNAL(itemSelected(struct menu *)),
|
||||
SLOT(changeItens(struct menu *)));
|
||||
connect(configList, SIGNAL(parentSelected()),
|
||||
SLOT(goBack()));
|
||||
connect(menuList, SIGNAL(menuChanged(struct menu *)),
|
||||
@ -1580,15 +1608,26 @@ void ConfigMainWindow::searchConfig(void)
|
||||
searchWindow->show();
|
||||
}
|
||||
|
||||
void ConfigMainWindow::changeMenu(struct menu *menu)
|
||||
void ConfigMainWindow::changeItens(struct menu *menu)
|
||||
{
|
||||
configList->setRootMenu(menu);
|
||||
|
||||
if (configList->rootEntry->parent == &rootmenu)
|
||||
backAction->setEnabled(false);
|
||||
else
|
||||
backAction->setEnabled(true);
|
||||
}
|
||||
|
||||
void ConfigMainWindow::changeMenu(struct menu *menu)
|
||||
{
|
||||
menuList->setRootMenu(menu);
|
||||
|
||||
if (menuList->rootEntry->parent == &rootmenu)
|
||||
backAction->setEnabled(false);
|
||||
else
|
||||
backAction->setEnabled(true);
|
||||
}
|
||||
|
||||
void ConfigMainWindow::setMenuLink(struct menu *menu)
|
||||
{
|
||||
struct menu *parent;
|
||||
@ -1698,14 +1737,14 @@ void ConfigMainWindow::showSplitView(void)
|
||||
fullViewAction->setEnabled(true);
|
||||
fullViewAction->setChecked(false);
|
||||
|
||||
configList->mode = symbolMode;
|
||||
configList->mode = menuMode;
|
||||
if (configList->rootEntry == &rootmenu)
|
||||
configList->updateListAll();
|
||||
else
|
||||
configList->setRootMenu(&rootmenu);
|
||||
configList->setAllOpen(true);
|
||||
configApp->processEvents();
|
||||
menuList->mode = menuMode;
|
||||
menuList->mode = symbolMode;
|
||||
menuList->setRootMenu(&rootmenu);
|
||||
menuList->setAllOpen(true);
|
||||
menuView->show();
|
||||
@ -1733,7 +1772,6 @@ void ConfigMainWindow::showFullView(void)
|
||||
|
||||
/*
|
||||
* ask for saving configuration before quitting
|
||||
* TODO ask only when something changed
|
||||
*/
|
||||
void ConfigMainWindow::closeEvent(QCloseEvent* e)
|
||||
{
|
||||
|
@ -71,6 +71,7 @@ public slots:
|
||||
signals:
|
||||
void menuChanged(struct menu *menu);
|
||||
void menuSelected(struct menu *menu);
|
||||
void itemSelected(struct menu *menu);
|
||||
void parentSelected(void);
|
||||
void gotFocus(struct menu *);
|
||||
|
||||
@ -298,6 +299,7 @@ public:
|
||||
ConfigMainWindow(void);
|
||||
public slots:
|
||||
void changeMenu(struct menu *);
|
||||
void changeItens(struct menu *);
|
||||
void setMenuLink(struct menu *);
|
||||
void listFocusChanged(void);
|
||||
void goBack(void);
|
||||
|
@ -7,6 +7,7 @@ SMP=$3
|
||||
PREEMPT=$4
|
||||
PREEMPT_RT=$5
|
||||
CC=$6
|
||||
LD=$7
|
||||
|
||||
vecho() { [ "${quiet}" = "silent_" ] || echo "$@" ; }
|
||||
|
||||
@ -61,7 +62,10 @@ UTS_VERSION="$(echo $UTS_VERSION $CONFIG_FLAGS $TIMESTAMP | cut -b -$UTS_LEN)"
|
||||
printf '#define LINUX_COMPILE_BY "%s"\n' "$LINUX_COMPILE_BY"
|
||||
echo \#define LINUX_COMPILE_HOST \"$LINUX_COMPILE_HOST\"
|
||||
|
||||
echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | grep ' version ' | sed 's/[[:space:]]*$//'`\"
|
||||
CC_VERSION=$($CC -v 2>&1 | grep ' version ' | sed 's/[[:space:]]*$//')
|
||||
LD_VERSION=$($LD -v | head -n1 | sed 's/(compatible with [^)]*)//' \
|
||||
| sed 's/[[:space:]]*$//')
|
||||
printf '#define LINUX_COMPILER "%s"\n' "$CC_VERSION, $LD_VERSION"
|
||||
} > .tmpcompile
|
||||
|
||||
# Only replace the real compile.h if the new one is different,
|
||||
|
@ -3,9 +3,15 @@ include ../scripts/Makefile.include
|
||||
include ../scripts/Makefile.arch
|
||||
|
||||
# always use the host compiler
|
||||
ifneq ($(LLVM),)
|
||||
HOSTAR ?= llvm-ar
|
||||
HOSTCC ?= clang
|
||||
HOSTLD ?= ld.lld
|
||||
else
|
||||
HOSTAR ?= ar
|
||||
HOSTCC ?= gcc
|
||||
HOSTLD ?= ld
|
||||
endif
|
||||
AR = $(HOSTAR)
|
||||
CC = $(HOSTCC)
|
||||
LD = $(HOSTLD)
|
||||
|
@ -93,7 +93,7 @@ no-header-test += asm-generic/%
|
||||
|
||||
extra-y := $(patsubst $(obj)/%.h,%.hdrtest, $(shell find $(obj) -name '*.h' 2>/dev/null))
|
||||
|
||||
# Include the header to detect missing include guard.
|
||||
# Include the header twice to detect missing include guard.
|
||||
quiet_cmd_hdrtest = HDRTEST $<
|
||||
cmd_hdrtest = \
|
||||
$(CC) $(c_flags) -S -o /dev/null -x c /dev/null \
|
||||
|
Loading…
Reference in New Issue
Block a user