Commit 395af861 authored by Catalin Marinas's avatar Catalin Marinas Committed by Will Deacon

arm64: Move the LSE gas support detection to Kconfig

As the Kconfig syntax gained support for $(as-instr) tests, move the LSE
gas support detection from Makefile to the main arm64 Kconfig and remove
the additional CONFIG_AS_LSE definition and check.

Cc: Will Deacon <will@kernel.org>
Reviewed-by: default avatarVladimir Murzin <vladimir.murzin@arm.com>
Tested-by: default avatarVladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent 42d519e3
...@@ -1363,6 +1363,11 @@ config ARM64_PAN ...@@ -1363,6 +1363,11 @@ config ARM64_PAN
instruction if the cpu does not implement the feature. instruction if the cpu does not implement the feature.
config ARM64_LSE_ATOMICS config ARM64_LSE_ATOMICS
bool
default ARM64_USE_LSE_ATOMICS
depends on $(as-instr,.arch_extension lse)
config ARM64_USE_LSE_ATOMICS
bool "Atomic instructions" bool "Atomic instructions"
depends on JUMP_LABEL depends on JUMP_LABEL
default y default y
......
...@@ -30,11 +30,8 @@ LDFLAGS_vmlinux += --fix-cortex-a53-843419 ...@@ -30,11 +30,8 @@ LDFLAGS_vmlinux += --fix-cortex-a53-843419
endif endif
endif endif
# Check for binutils support for specific extensions ifeq ($(CONFIG_ARM64_USE_LSE_ATOMICS), y)
lseinstr := $(call as-instr,.arch_extension lse,-DCONFIG_AS_LSE=1) ifneq ($(CONFIG_ARM64_LSE_ATOMICS), y)
ifeq ($(CONFIG_ARM64_LSE_ATOMICS), y)
ifeq ($(lseinstr),)
$(warning LSE atomics not supported by binutils) $(warning LSE atomics not supported by binutils)
endif endif
endif endif
...@@ -53,11 +50,11 @@ $(warning Detected assembler with broken .inst; disassembly will be unreliable) ...@@ -53,11 +50,11 @@ $(warning Detected assembler with broken .inst; disassembly will be unreliable)
endif endif
endif endif
KBUILD_CFLAGS += -mgeneral-regs-only $(lseinstr) $(brokengasinst) \ KBUILD_CFLAGS += -mgeneral-regs-only $(brokengasinst) \
$(compat_vdso) $(cc_has_k_constraint) $(compat_vdso) $(cc_has_k_constraint)
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
KBUILD_CFLAGS += $(call cc-disable-warning, psabi) KBUILD_CFLAGS += $(call cc-disable-warning, psabi)
KBUILD_AFLAGS += $(lseinstr) $(brokengasinst) $(compat_vdso) KBUILD_AFLAGS += $(brokengasinst) $(compat_vdso)
KBUILD_CFLAGS += $(call cc-option,-mabi=lp64) KBUILD_CFLAGS += $(call cc-option,-mabi=lp64)
KBUILD_AFLAGS += $(call cc-option,-mabi=lp64) KBUILD_AFLAGS += $(call cc-option,-mabi=lp64)
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <linux/stringify.h> #include <linux/stringify.h>
#if IS_ENABLED(CONFIG_ARM64_LSE_ATOMICS) && IS_ENABLED(CONFIG_AS_LSE) #ifdef CONFIG_ARM64_LSE_ATOMICS
#define __LL_SC_FALLBACK(asm_ops) \ #define __LL_SC_FALLBACK(asm_ops) \
" b 3f\n" \ " b 3f\n" \
" .subsection 1\n" \ " .subsection 1\n" \
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <asm/atomic_ll_sc.h> #include <asm/atomic_ll_sc.h>
#if defined(CONFIG_AS_LSE) && defined(CONFIG_ARM64_LSE_ATOMICS) #ifdef CONFIG_ARM64_LSE_ATOMICS
#include <linux/compiler_types.h> #include <linux/compiler_types.h>
#include <linux/export.h> #include <linux/export.h>
...@@ -36,7 +36,7 @@ static inline bool system_uses_lse_atomics(void) ...@@ -36,7 +36,7 @@ static inline bool system_uses_lse_atomics(void)
#define ARM64_LSE_ATOMIC_INSN(llsc, lse) \ #define ARM64_LSE_ATOMIC_INSN(llsc, lse) \
ALTERNATIVE(llsc, lse, ARM64_HAS_LSE_ATOMICS) ALTERNATIVE(llsc, lse, ARM64_HAS_LSE_ATOMICS)
#else /* CONFIG_AS_LSE && CONFIG_ARM64_LSE_ATOMICS */ #else /* CONFIG_ARM64_LSE_ATOMICS */
static inline bool system_uses_lse_atomics(void) { return false; } static inline bool system_uses_lse_atomics(void) { return false; }
...@@ -44,5 +44,5 @@ static inline bool system_uses_lse_atomics(void) { return false; } ...@@ -44,5 +44,5 @@ static inline bool system_uses_lse_atomics(void) { return false; }
#define ARM64_LSE_ATOMIC_INSN(llsc, lse) llsc #define ARM64_LSE_ATOMIC_INSN(llsc, lse) llsc
#endif /* CONFIG_AS_LSE && CONFIG_ARM64_LSE_ATOMICS */ #endif /* CONFIG_ARM64_LSE_ATOMICS */
#endif /* __ASM_LSE_H */ #endif /* __ASM_LSE_H */
...@@ -1291,7 +1291,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = { ...@@ -1291,7 +1291,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
.cpu_enable = cpu_enable_pan, .cpu_enable = cpu_enable_pan,
}, },
#endif /* CONFIG_ARM64_PAN */ #endif /* CONFIG_ARM64_PAN */
#if defined(CONFIG_AS_LSE) && defined(CONFIG_ARM64_LSE_ATOMICS) #ifdef CONFIG_ARM64_LSE_ATOMICS
{ {
.desc = "LSE atomic instructions", .desc = "LSE atomic instructions",
.capability = ARM64_HAS_LSE_ATOMICS, .capability = ARM64_HAS_LSE_ATOMICS,
...@@ -1302,7 +1302,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = { ...@@ -1302,7 +1302,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
.sign = FTR_UNSIGNED, .sign = FTR_UNSIGNED,
.min_field_value = 2, .min_field_value = 2,
}, },
#endif /* CONFIG_AS_LSE && CONFIG_ARM64_LSE_ATOMICS */ #endif /* CONFIG_ARM64_LSE_ATOMICS */
{ {
.desc = "Software prefetching using PRFM", .desc = "Software prefetching using PRFM",
.capability = ARM64_HAS_NO_HW_PREFETCH, .capability = ARM64_HAS_NO_HW_PREFETCH,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment