arm64: mte: Use Normal Tagged attributes for the linear map
authorCatalin Marinas <catalin.marinas@arm.com>
Wed, 27 Nov 2019 09:51:13 +0000 (09:51 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 3 Sep 2020 16:26:31 +0000 (17:26 +0100)
commit0178dc7613684561ff3bb1625cd5504f1e7fbe3d
treee2ecb07f1cab6a6d46e5f7d5c6cfeca88b22b38e
parentc058b1c4a5ea7b88cce4c961c1000acf482ea64b
arm64: mte: Use Normal Tagged attributes for the linear map

Once user space is given access to tagged memory, the kernel must be
able to clear/save/restore tags visible to the user. This is done via
the linear mapping, therefore map it as such. The new MT_NORMAL_TAGGED
index for MAIR_EL1 is initially mapped as Normal memory and later
changed to Normal Tagged via the cpufeature infrastructure. From a
mismatched attribute aliases perspective, the Tagged memory is
considered a permission and it won't lead to undefined behaviour.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Suzuki K Poulose <Suzuki.Poulose@arm.com>
arch/arm64/include/asm/memory.h
arch/arm64/include/asm/pgtable-prot.h
arch/arm64/mm/dump.c
arch/arm64/mm/mmu.c
arch/arm64/mm/proc.S