[PATCH v2] x86/boot: define CC_HAVE_ASM_GOTO

2018-09-27 Thread ndesaulniers
Early prototypes of Clang with asm goto support produce 6 instances of the following warning: In file included from arch/x86/boot/compressed/misc.h:20: In file included from ./include/linux/elf.h:5: In file included from ./arch/x86/include/asm/elf.h:8: In file included from ./include/linux/thread_

[PATCH] x86/vdso: drop implicit common-page-size linker flag

2018-12-06 Thread ndesaulniers
These are implied by the target architecture and for x86_64 match the max-page-size. The default for non-NaCl x86_64 is 0x1000 (4096). In bfd the common page size is defined as 0x1000 (4096) for non-NaCl x86_64 targets: bfd/elf64-x86-64.c: 4998:#define ELF_COMMONPAGESIZE 0x1000 For g

[PATCH v2] x86/build: Mark per-cpu symbols as absolute

2018-12-19 Thread ndesaulniers
From: Rafael Ávila de Espíndola The kernel has many variables that it wants to have per CPU. It is similar to how each thread wants a copy of a thread local variable. To access such variable, the code has to find the offset of that variable in the per cpu block and add it to the address of the c

[PATCH] x86/um/vdso: Drop implicit common-page-size linker flag

2018-12-10 Thread ndesaulniers
GNU linker's -z common-page-size's default value is based on the target architecture. arch/x86/entry/vdso/Makefile sets it to the architecture default, which is implicit and redundant. Drop it. Link: https://lkml.kernel.org/r/20181206191231.192355-1-ndesaulni...@google.com Signed-off-by: Nick Desa

[PATCH] ARM: VDSO: Drop implicit common-page-size linker flag

2018-12-10 Thread ndesaulniers
GNU linker's -z common-page-size's default value is based on the target architecture. arch/arm/vdso/Makefile sets it to the architecture default, which is implicit and redundant. Drop it. Link: https://lkml.kernel.org/r/20181206191231.192355-1-ndesaulni...@google.com Signed-off-by: Nick Desaulnier

[PATCH] sparc: vdso: Drop implicit common-page-size linker flag

2018-12-10 Thread ndesaulniers
GNU linker's -z common-page-size's default value is based on the target architecture. arch/sparc/vdso/Makefile sets it to the architecture default, which is implicit and redundant. Drop it. Link: https://lkml.kernel.org/r/20181206191231.192355-1-ndesaulni...@google.com Signed-off-by: Nick Desaulni

[PATCH v2] include/linux/compiler*.h: add version detection to asm_volatile_goto

2018-10-31 Thread ndesaulniers
asm_volatile_goto should also be defined for other compilers that support asm goto. Signed-off-by: Nick Desaulniers --- V1 -> V2: drop changes to include/linux/compiler-gcc.h. include/linux/compiler_types.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/compiler_types.h b

[PATCH v3] include/linux/compiler*.h: define asm_volatile_goto

2018-10-31 Thread ndesaulniers
asm_volatile_goto should also be defined for other compilers that support asm goto. Fixes commit 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually exclusive"). Signed-off-by: Nick Desaulniers --- V2 -> V3: update subject line & add reference to fixed commit. V1 -> V2: drop cha

[PATCH] compiler.h: update definition of unreachable()

2018-10-15 Thread ndesaulniers
Fixes the objtool warning seen with Clang: arch/x86/mm/fault.o: warning: objtool: no_context()+0x220: unreachable instruction Fixes commit 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually exclusive") Josh noted that the fallback definition was meant to work around a pre-gcc-4.

[PATCH] compiler-gcc: remove comment about gcc 4.5 from unreachable()

2018-10-15 Thread ndesaulniers
Remove the comment about being unable to detect __builtin_unreachable. __builtin_unreachable was implemented in the GCC 4.5 timeframe. The kernel's minimum supported version of GCC is 4.6 since commit cafa0010cd51 ("Raise the minimum required gcc version to 4.6"). Commit cb984d101b30 ("compiler-gcc

[PATCH] KEYS: trusted: fix -Wvarags warning

2018-10-11 Thread ndesaulniers
by swapping h2 and h3. security/keys/trusted.c:146:17: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs] va_start(argp, h3); ^ security/keys/trusted.c:126:37: note: parameter of type 'unsigned

[PATCH v2] [PATCH] KEYS: trusted: fix -Wvarags warning

2018-10-22 Thread ndesaulniers
Fixes the warning reported by Clang: security/keys/trusted.c:146:17: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs] va_start(argp, h3); ^ security/keys/trusted.c:126:37: note: parameter of ty

[PATCH] lib/raid6: use vdupq_n_u8 to avoid endianness warnings

2019-02-25 Thread ndesaulniers
Clang warns: vector initializers are not compatible with NEON intrinsics in big endian mode [-Wnonportable-vector-initialization] While this is usually the case, it's not an issue for this case since we're initializing the uint8x16_t (16x uint8_t's) with the same value. Instead, use vdupq_n_u8 wh

[PATCH v2 3/4] Makefile: lld: tell clang to use lld

2019-02-11 Thread ndesaulniers
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. Link: https://github.com/ClangBuiltLinux/linux/issues/342 Su

[PATCH v2 1/4] init/Kconfig: add config support for detecting linker

2019-02-11 Thread ndesaulniers
Similar to how we differentiate between CONFIG_CC_IS_GCC and CONFIG_CC_IS_CLANG, add CONFIG_LD_IS_BFD, CONFIG_LD_IS_GOLD, and CONFIG_LD_IS_LLD. This simiplifies patches to Makefiles that need to do different things for different linkers. Cc: Sami Tolvanen Suggested-by: Sedat Dilek Reviewed-by:

[PATCH v2 0/4] Improve kernel LLD support

2019-02-11 Thread ndesaulniers
This patch cleans up a few places in the Makefile to make way for landing LLD support in the kernel. There are still a few arch specific fixes that need to get upstreamed, but this core set of patches should be arch independent. Some very rough numbers: LLD is improving the overall build time of

[PATCH v2 2/4] Makefile: clang: choose GCC_TOOLCHAIN_DIR not on LD

2019-02-11 Thread ndesaulniers
This causes an issue when trying to build with `make LD=ld.lld` if ld.lld and the rest of your cross tools aren't in the same directory (ex. /usr/local/bin) (as is the case for Android's build system), as the GCC_TOOLCHAIN_DIR then gets set based on `which $(LD)` which will point where LLVM tools a

[PATCH v2 4/4] Makefile: lld: set -O2 linker flag when linking with LLD

2019-02-11 Thread ndesaulniers
For arm64: 0.34% size improvement with lld -O2 over lld for vmlinux. 3.3% size improvement with lld -O2 over lld for Image.lz4-dtb. Link: https://github.com/ClangBuiltLinux/linux/issues/343 Suggested-by: Rui Ueyama Suggested-by: Nathan Chancellor Reviewed-by: Nathan Chancellor Tested-by: Nathan

[PATCH 1/4] init/Kconfig: add config support for detecting linker

2019-02-07 Thread ndesaulniers
Similar to how we differentiate between CONFIG_CC_IS_GCC and CONFIG_CC_IS_CLANG, add CONFIG_LD_IS_BFD, CONFIG_LD_IS_GOLD, and CONFIG_LD_IS_LLD. This simiplifies patches to Makefiles that need to do different things for different linkers. Cc: Nathan Chancellor Cc: Sami Tolvanen Signed-off-by: Ni

[PATCH 4/4] Makefile: lld: set -O2 linker flag when linking with LLD

2019-02-07 Thread ndesaulniers
-O2 enables tail merging of string table strings. For arm64: 0.34% size improvement with lld -O2 over lld for vmlinux. 3.30% size improvement with lld -O2 over lld for Image.lz4-dtb. Link: https://github.com/ClangBuiltLinux/linux/issues/343 Suggested-by: Rui Ueyama Suggested-by: Nathan Chancello

[PATCH 3/4] Makefile: lld: tell clang to use lld

2019-02-07 Thread ndesaulniers
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=$(LD). This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. Link: https://github.com/ClangBuiltLinux/linux/issues/342

[PATCH 2/4] Makefile: clang: choose GCC_TOOLCHAIN_DIR not on LD

2019-02-07 Thread ndesaulniers
This causes an issue when trying to build with `make LD=ld.lld` if ld.lld and the rest of your cross tools aren't in the same directory (ex. /usr/local/bin) (as is the case for Android's build system), as the GCC_TOOLCHAIN_DIR then gets set based on `which $(LD)` which will point where LLVM tools a

[PATCH 0/4] Improve kernel LLD support

2019-02-07 Thread ndesaulniers
This patch cleans up a few places in the Makefile to make way for landing LLD support in the kernel. There are still a few arch specific fixes that need to get upstreamed, but this core set of patches should be arch independent. Some very rough numbers: LLD is improving the overall build time of

[PATCH] drm/amd/display: add -msse2 to prevent Clang from emitting libcalls to undefined SW FP routines

2019-01-24 Thread ndesaulniers
arch/x86/Makefile disables SSE and SSE2 for the whole kernel. The AMDGPU drivers modified in this patch re-enable SSE but not SSE2. Turn on SSE2 to support emitting double precision floating point instructions rather than calls to non-existent (usually available from gcc_s or compiler_rt) floatin

[no subject]

2020-06-11 Thread ndesaulniers
Date: Thu, 11 Jun 2020 15:38:38 -0700 From: Nick Desaulniers To: Michael Ellerman , christophe.le...@c-s.fr, seg...@kernel.crashing.org Cc: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , npig...@gmail.com, seg...@kernel.crashing.org, linuxppc-...@list