Commit 264edd81 authored by Vincenzo Frascino's avatar Vincenzo Frascino Committed by Stephen Rothwell
Browse files

arm64: enable armv8.5-a asm-arch option

Hardware tag-based KASAN relies on Memory Tagging Extension (MTE) which is
an armv8.5-a architecture extension.

Enable the correct asm option when the compiler supports it in order to
allow the usage of ALTERNATIVE()s with MTE instructions.


Signed-off-by: Vincenzo Frascino's avatarVincenzo Frascino <>
Signed-off-by: default avatarAndrey Konovalov <>
Reviewed-by: Catalin Marinas's avatarCatalin Marinas <>
Reviewed-by: default avatarAlexander Potapenko <>
Tested-by: Vincenzo Frascino's avatarVincenzo Frascino <>
Cc: Andrey Ryabinin <>
Cc: Branislav Rankov <>
Cc: Dmitry Vyukov <>
Cc: Evgenii Stepanov <>
Cc: Kevin Brodsky <>
Cc: Marco Elver <>
Cc: Vasily Gorbik <>
Cc: Will Deacon <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarStephen Rothwell <>
parent 8ba6defb
......@@ -1591,6 +1591,9 @@ endmenu
menu "ARMv8.5 architectural features"
config AS_HAS_ARMV8_5
def_bool $(cc-option,-Wa$(comma)-march=armv8.5-a)
config ARM64_BTI
bool "Branch Target Identification support"
default y
......@@ -1665,6 +1668,7 @@ config ARM64_MTE
bool "Memory Tagging Extension support"
default y
depends on AS_HAS_ARMV8_5
Memory Tagging (part of the ARMv8.5 Extensions) provides
......@@ -100,6 +100,11 @@ ifeq ($(CONFIG_AS_HAS_ARMV8_4), y)
asm-arch := armv8.4-a
ifeq ($(CONFIG_AS_HAS_ARMV8_5), y)
# make sure to pass the newest target architecture to -march.
asm-arch := armv8.5-a
ifdef asm-arch
KBUILD_CFLAGS += -Wa,-march=$(asm-arch) \
Supports Markdown
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