mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-27 17:35:35 +00:00
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. Link: https://lkml.kernel.org/r/d03d1157124ea3532eaeb77507988733f5734986.1606161801.git.andreyknvl@google.com Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Signed-off-by: Andrey Konovalov <andreyknvl@google.com> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Reviewed-by: Alexander Potapenko <glider@google.com> Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com> Cc: Branislav Rankov <Branislav.Rankov@arm.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: Evgenii Stepanov <eugenis@google.com> Cc: Kevin Brodsky <kevin.brodsky@arm.com> Cc: Marco Elver <elver@google.com> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: Will Deacon <will.deacon@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
6a63a63ff1
commit
f469c032c0
2 changed files with 9 additions and 0 deletions
|
@ -1571,6 +1571,9 @@ endmenu
|
||||||
|
|
||||||
menu "ARMv8.5 architectural features"
|
menu "ARMv8.5 architectural features"
|
||||||
|
|
||||||
|
config AS_HAS_ARMV8_5
|
||||||
|
def_bool $(cc-option,-Wa$(comma)-march=armv8.5-a)
|
||||||
|
|
||||||
config ARM64_BTI
|
config ARM64_BTI
|
||||||
bool "Branch Target Identification support"
|
bool "Branch Target Identification support"
|
||||||
default y
|
default y
|
||||||
|
@ -1645,6 +1648,7 @@ config ARM64_MTE
|
||||||
bool "Memory Tagging Extension support"
|
bool "Memory Tagging Extension support"
|
||||||
default y
|
default y
|
||||||
depends on ARM64_AS_HAS_MTE && ARM64_TAGGED_ADDR_ABI
|
depends on ARM64_AS_HAS_MTE && ARM64_TAGGED_ADDR_ABI
|
||||||
|
depends on AS_HAS_ARMV8_5
|
||||||
select ARCH_USES_HIGH_VMA_FLAGS
|
select ARCH_USES_HIGH_VMA_FLAGS
|
||||||
help
|
help
|
||||||
Memory Tagging (part of the ARMv8.5 Extensions) provides
|
Memory Tagging (part of the ARMv8.5 Extensions) provides
|
||||||
|
|
|
@ -96,6 +96,11 @@ ifeq ($(CONFIG_AS_HAS_ARMV8_4), y)
|
||||||
asm-arch := armv8.4-a
|
asm-arch := armv8.4-a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_AS_HAS_ARMV8_5), y)
|
||||||
|
# make sure to pass the newest target architecture to -march.
|
||||||
|
asm-arch := armv8.5-a
|
||||||
|
endif
|
||||||
|
|
||||||
ifdef asm-arch
|
ifdef asm-arch
|
||||||
KBUILD_CFLAGS += -Wa,-march=$(asm-arch) \
|
KBUILD_CFLAGS += -Wa,-march=$(asm-arch) \
|
||||||
-DARM64_ASM_ARCH='"$(asm-arch)"'
|
-DARM64_ASM_ARCH='"$(asm-arch)"'
|
||||||
|
|
Loading…
Add table
Reference in a new issue