Skip to content

Commit 2555d4c

Browse files
committed
arm64: drop binutils version checks
Now that gcc-8 and binutils-2.30 are the minimum versions, a lot of the individual feature checks can go away for simplification. Acked-by: Mark Rutland <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 5f5305d commit 2555d4c

File tree

5 files changed

+5
-60
lines changed

5 files changed

+5
-60
lines changed

arch/arm64/Kconfig

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -642,9 +642,6 @@ config ARM64_ERRATUM_843419
642642

643643
If unsure, say Y.
644644

645-
config ARM64_LD_HAS_FIX_ERRATUM_843419
646-
def_bool $(ld-option,--fix-cortex-a53-843419)
647-
648645
config ARM64_ERRATUM_1024718
649646
bool "Cortex-A55: 1024718: Update of DBM/AP bits without break before make might result in incorrect update"
650647
default y
@@ -1890,13 +1887,9 @@ config ARM64_PAN
18901887
The feature is detected at runtime, and will remain as a 'nop'
18911888
instruction if the cpu does not implement the feature.
18921889

1893-
config AS_HAS_LSE_ATOMICS
1894-
def_bool $(as-instr,.arch_extension lse)
1895-
18961890
config ARM64_LSE_ATOMICS
18971891
bool
18981892
default ARM64_USE_LSE_ATOMICS
1899-
depends on AS_HAS_LSE_ATOMICS
19001893

19011894
config ARM64_USE_LSE_ATOMICS
19021895
bool "Atomic instructions"
@@ -1908,20 +1901,12 @@ config ARM64_USE_LSE_ATOMICS
19081901

19091902
Say Y here to make use of these instructions for the in-kernel
19101903
atomic routines. This incurs a small overhead on CPUs that do
1911-
not support these instructions and requires the kernel to be
1912-
built with binutils >= 2.25 in order for the new instructions
1913-
to be used.
1904+
not support these instructions.
19141905

19151906
endmenu # "ARMv8.1 architectural features"
19161907

19171908
menu "ARMv8.2 architectural features"
19181909

1919-
config AS_HAS_ARMV8_2
1920-
def_bool $(cc-option,-Wa$(comma)-march=armv8.2-a)
1921-
1922-
config AS_HAS_SHA3
1923-
def_bool $(as-instr,.arch armv8.2-a+sha3)
1924-
19251910
config ARM64_PMEM
19261911
bool "Enable support for persistent memory"
19271912
select ARCH_HAS_PMEM_API
@@ -1995,7 +1980,6 @@ config ARM64_PTR_AUTH_KERNEL
19951980
bool "Use pointer authentication for kernel"
19961981
default y
19971982
depends on ARM64_PTR_AUTH
1998-
depends on (CC_HAS_SIGN_RETURN_ADDRESS || CC_HAS_BRANCH_PROT_PAC_RET) && AS_HAS_ARMV8_3
19991983
# Modern compilers insert a .note.gnu.property section note for PAC
20001984
# which is only understood by binutils starting with version 2.33.1.
20011985
depends on LD_IS_LLD || LD_VERSION >= 23301 || (CC_IS_GCC && GCC_VERSION < 90100)
@@ -2016,19 +2000,10 @@ config CC_HAS_BRANCH_PROT_PAC_RET
20162000
# GCC 9 or later, clang 8 or later
20172001
def_bool $(cc-option,-mbranch-protection=pac-ret+leaf)
20182002

2019-
config CC_HAS_SIGN_RETURN_ADDRESS
2020-
# GCC 7, 8
2021-
def_bool $(cc-option,-msign-return-address=all)
2022-
2023-
config AS_HAS_ARMV8_3
2024-
def_bool $(cc-option,-Wa$(comma)-march=armv8.3-a)
2025-
20262003
config AS_HAS_CFI_NEGATE_RA_STATE
2004+
# binutils 2.34+
20272005
def_bool $(as-instr,.cfi_startproc\n.cfi_negate_ra_state\n.cfi_endproc\n)
20282006

2029-
config AS_HAS_LDAPR
2030-
def_bool $(as-instr,.arch_extension rcpc)
2031-
20322007
endmenu # "ARMv8.3 architectural features"
20332008

20342009
menu "ARMv8.4 architectural features"
@@ -2056,20 +2031,13 @@ config ARM64_AMU_EXTN
20562031
correctly reflect reality. Most commonly, the value read will be 0,
20572032
indicating that the counter is not enabled.
20582033

2059-
config AS_HAS_ARMV8_4
2060-
def_bool $(cc-option,-Wa$(comma)-march=armv8.4-a)
2061-
20622034
config ARM64_TLB_RANGE
20632035
bool "Enable support for tlbi range feature"
20642036
default y
2065-
depends on AS_HAS_ARMV8_4
20662037
help
20672038
ARMv8.4-TLBI provides TLBI invalidation instruction that apply to a
20682039
range of input addresses.
20692040

2070-
The feature introduces new assembly instructions, and they were
2071-
support when binutils >= 2.30.
2072-
20732041
endmenu # "ARMv8.4 architectural features"
20742042

20752043
menu "ARMv8.5 architectural features"
@@ -2145,7 +2113,6 @@ config ARM64_MTE
21452113
default y
21462114
depends on ARM64_AS_HAS_MTE && ARM64_TAGGED_ADDR_ABI
21472115
depends on AS_HAS_ARMV8_5
2148-
depends on AS_HAS_LSE_ATOMICS
21492116
# Required for tag checking in the uaccess routines
21502117
select ARM64_PAN
21512118
select ARCH_HAS_SUBPAGE_FAULTS

arch/arm64/Makefile

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,11 @@ ifeq ($(CONFIG_RELOCATABLE), y)
1616
# Pass --no-apply-dynamic-relocs to restore pre-binutils-2.27 behaviour
1717
# for relative relocs, since this leads to better Image compression
1818
# with the relocation offsets always being zero.
19-
LDFLAGS_vmlinux += -shared -Bsymbolic -z notext \
20-
$(call ld-option, --no-apply-dynamic-relocs)
19+
LDFLAGS_vmlinux += -shared -Bsymbolic -z notext --no-apply-dynamic-relocs
2120
endif
2221

2322
ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
24-
ifeq ($(CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419),y)
2523
LDFLAGS_vmlinux += --fix-cortex-a53-843419
26-
endif
2724
endif
2825

2926
cc_has_k_constraint := $(call try-run,echo \
@@ -105,12 +102,8 @@ endif
105102
# hardware.
106103
ifeq ($(CONFIG_AS_HAS_ARMV8_5), y)
107104
asm-arch := armv8.5-a
108-
else ifeq ($(CONFIG_AS_HAS_ARMV8_4), y)
105+
else
109106
asm-arch := armv8.4-a
110-
else ifeq ($(CONFIG_AS_HAS_ARMV8_3), y)
111-
asm-arch := armv8.3-a
112-
else ifeq ($(CONFIG_AS_HAS_ARMV8_2), y)
113-
asm-arch := armv8.2-a
114107
endif
115108

116109
ifdef asm-arch
@@ -201,16 +194,6 @@ install zinstall:
201194

202195
archprepare:
203196
$(Q)$(MAKE) $(build)=arch/arm64/tools kapi
204-
ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
205-
ifneq ($(CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419),y)
206-
@echo "warning: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum" >&2
207-
endif
208-
endif
209-
ifeq ($(CONFIG_ARM64_USE_LSE_ATOMICS),y)
210-
ifneq ($(CONFIG_ARM64_LSE_ATOMICS),y)
211-
@echo "warning: LSE atomics not supported by binutils" >&2
212-
endif
213-
endif
214197

215198
ifeq ($(KBUILD_EXTMOD),)
216199
# We need to generate vdso-offsets.h before compiling certain files in kernel/.

arch/arm64/include/asm/rwonce.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,12 @@
1212

1313
#ifndef BUILD_VDSO
1414

15-
#ifdef CONFIG_AS_HAS_LDAPR
1615
#define __LOAD_RCPC(sfx, regs...) \
1716
ALTERNATIVE( \
1817
"ldar" #sfx "\t" #regs, \
1918
".arch_extension rcpc\n" \
2019
"ldapr" #sfx "\t" #regs, \
2120
ARM64_HAS_LDAPR)
22-
#else
23-
#define __LOAD_RCPC(sfx, regs...) "ldar" #sfx "\t" #regs
24-
#endif /* CONFIG_AS_HAS_LDAPR */
2521

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

arch/arm64/kvm/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ if VIRTUALIZATION
1919

2020
menuconfig KVM
2121
bool "Kernel-based Virtual Machine (KVM) support"
22-
depends on AS_HAS_ARMV8_4
2322
select KVM_COMMON
2423
select KVM_GENERIC_HARDWARE_ENABLING
2524
select KVM_GENERIC_MMU_NOTIFIER

arch/arm64/lib/xor-neon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ static void xor_arm64_eor3_5(unsigned long bytes,
319319

320320
static int __init xor_neon_init(void)
321321
{
322-
if (IS_ENABLED(CONFIG_AS_HAS_SHA3) && cpu_have_named_feature(SHA3)) {
322+
if (cpu_have_named_feature(SHA3)) {
323323
xor_block_inner_neon.do_3 = xor_arm64_eor3_3;
324324
xor_block_inner_neon.do_4 = xor_arm64_eor3_4;
325325
xor_block_inner_neon.do_5 = xor_arm64_eor3_5;

0 commit comments

Comments
 (0)