arm64: enable tlbi range instructions
authorZhenyu Ye <yezhenyu2@huawei.com>
Wed, 15 Jul 2020 07:19:44 +0000 (15:19 +0800)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 15 Jul 2020 15:01:01 +0000 (16:01 +0100)
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 <yezhenyu2@huawei.com>
Link: https://lore.kernel.org/r/20200715071945.897-3-yezhenyu2@huawei.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/Kconfig
arch/arm64/Makefile

index 66dc41fd49f23b6d67ed218690b49ef5bb1ac119..0f39468dbc607d13b8f3127499d1f3b56c376931 100644 (file)
@@ -1596,6 +1596,20 @@ config ARM64_AMU_EXTN
          correctly reflect reality. Most commonly, the value read will be 0,
          indicating that the counter is not enabled.
 
+config AS_HAS_ARMV8_4
+       def_bool $(cc-option,-Wa$(comma)-march=armv8.4-a)
+
+config ARM64_TLB_RANGE
+       bool "Enable support for tlbi range feature"
+       default y
+       depends on AS_HAS_ARMV8_4
+       help
+         ARMv8.4-TLBI provides TLBI invalidation instruction that apply to a
+         range of input addresses.
+
+         The feature introduces new assembly instructions, and they were
+         support when binutils >= 2.30.
+
 endmenu
 
 menu "ARMv8.5 architectural features"
index a0d94d063fa81c2701c7bcc4c8d415819a5fa843..4e823b97c92e0bc0720172af6704373942a22482 100644 (file)
@@ -82,11 +82,18 @@ endif
 # compiler to generate them and consequently to break the single image contract
 # we pass it only to the assembler. This option is utilized only in case of non
 # integrated assemblers.
+ifneq ($(CONFIG_AS_HAS_ARMV8_4), y)
 branch-prot-flags-$(CONFIG_AS_HAS_PAC) += -Wa,-march=armv8.3-a
 endif
+endif
 
 KBUILD_CFLAGS += $(branch-prot-flags-y)
 
+ifeq ($(CONFIG_AS_HAS_ARMV8_4), y)
+# make sure to pass the newest target architecture to -march.
+KBUILD_CFLAGS  += -Wa,-march=armv8.4-a
+endif
+
 ifeq ($(CONFIG_SHADOW_CALL_STACK), y)
 KBUILD_CFLAGS  += -ffixed-x18
 endif