]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
arm64: Report address tag when FEAT_MTE_TAGGED_FAR is supported
authorYeoreum Yun <yeoreum.yun@arm.com>
Wed, 18 Jun 2025 08:45:05 +0000 (09:45 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 2 Jul 2025 16:44:17 +0000 (17:44 +0100)
commit7c7f55039b8d69567acc953964b656a8b126c30a
tree9827d41ae6a7eb0d7ab3163eaba3d2fd0ada0bbb
parent66984536899f49d388424cf9b158b0a664217cf6
arm64: Report address tag when FEAT_MTE_TAGGED_FAR is supported

If FEAT_MTE_TAGGED_FAR (Armv8.9) is supported, bits 63:60 of the fault address
are preserved in response to synchronous tag check faults (SEGV_MTESERR).

This patch modifies below to support this feature:
  - Use the original FAR_EL1 value when an MTE tag check fault occurs,
    if ARM64_MTE_FAR is supported so that not only logical tag
    (bits 59:56) but also address tag (bits 63:60] being reported too.

  - Add HWCAP for mtefar to let user know bits 63:60 includes
    address tag information when when FEAT_MTE_TAGGED_FAR is supported.

Applications that require this information should install
a signal handler with the SA_EXPOSE_TAGBITS flag.
While this introduces a minor ABI change,
most applications do not set this flag and therefore will not be affected.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
Link: https://lore.kernel.org/r/20250618084513.1761345-3-yeoreum.yun@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Documentation/arch/arm64/elf_hwcaps.rst
Documentation/arch/arm64/tagged-pointers.rst
arch/arm64/include/asm/hwcap.h
arch/arm64/include/uapi/asm/hwcap.h
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/cpuinfo.c
arch/arm64/mm/fault.c