Skip to content

Commit 7c78f67

Browse files
Zhenyu Yectmarinas
authored andcommitted
arm64: enable tlbi range instructions
TLBI RANGE feature instoduces new assembly instructions and only support by binutils >= 2.30. Add necessary Kconfig logic to allow this to be enabled and pass '-march=armv8.4-a' to KBUILD_CFLAGS. Signed-off-by: Zhenyu Ye <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent b620ba5 commit 7c78f67

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

arch/arm64/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,6 +1596,20 @@ config ARM64_AMU_EXTN
15961596
correctly reflect reality. Most commonly, the value read will be 0,
15971597
indicating that the counter is not enabled.
15981598

1599+
config AS_HAS_ARMV8_4
1600+
def_bool $(cc-option,-Wa$(comma)-march=armv8.4-a)
1601+
1602+
config ARM64_TLB_RANGE
1603+
bool "Enable support for tlbi range feature"
1604+
default y
1605+
depends on AS_HAS_ARMV8_4
1606+
help
1607+
ARMv8.4-TLBI provides TLBI invalidation instruction that apply to a
1608+
range of input addresses.
1609+
1610+
The feature introduces new assembly instructions, and they were
1611+
support when binutils >= 2.30.
1612+
15991613
endmenu
16001614

16011615
menu "ARMv8.5 architectural features"

arch/arm64/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,18 @@ endif
8282
# compiler to generate them and consequently to break the single image contract
8383
# we pass it only to the assembler. This option is utilized only in case of non
8484
# integrated assemblers.
85+
ifneq ($(CONFIG_AS_HAS_ARMV8_4), y)
8586
branch-prot-flags-$(CONFIG_AS_HAS_PAC) += -Wa,-march=armv8.3-a
8687
endif
88+
endif
8789

8890
KBUILD_CFLAGS += $(branch-prot-flags-y)
8991

92+
ifeq ($(CONFIG_AS_HAS_ARMV8_4), y)
93+
# make sure to pass the newest target architecture to -march.
94+
KBUILD_CFLAGS += -Wa,-march=armv8.4-a
95+
endif
96+
9097
ifeq ($(CONFIG_SHADOW_CALL_STACK), y)
9198
KBUILD_CFLAGS += -ffixed-x18
9299
endif

0 commit comments

Comments
 (0)