arm64: mte: Add asymmetric mode support
authorVincenzo Frascino <vincenzo.frascino@arm.com>
Wed, 6 Oct 2021 15:47:50 +0000 (16:47 +0100)
committerWill Deacon <will@kernel.org>
Thu, 7 Oct 2021 08:30:24 +0000 (09:30 +0100)
commitec0288369f0cc6d85837a18f1c4c65451c94477b
tree7f102511697c947cd6e96c1438f7e50ad05e6d13
parentd73c162e073376dd207d716cb4b9cfc809be7e80
arm64: mte: Add asymmetric mode support

MTE provides an asymmetric mode for detecting tag exceptions. In
particular, when such a mode is present, the CPU triggers a fault
on a tag mismatch during a load operation and asynchronously updates
a register when a tag mismatch is detected during a store operation.

Add support for MTE asymmetric mode.

Note: If the CPU does not support MTE asymmetric mode the kernel falls
back on synchronous mode which is the default for kasan=on.

Cc: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Andrey Konovalov <andreyknvl@gmail.com>
Link: https://lore.kernel.org/r/20211006154751.4463-5-vincenzo.frascino@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/memory.h
arch/arm64/include/asm/mte-kasan.h
arch/arm64/include/asm/mte.h
arch/arm64/include/asm/uaccess.h
arch/arm64/kernel/mte.c