aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm/mte-def.h
diff options
context:
space:
mode:
authorSteven Price <steven.price@arm.com>2021-06-21 12:17:15 +0100
committerMarc Zyngier <maz@kernel.org>2021-06-22 14:08:06 +0100
commitf0376edb1ddcab19a473b4bf1fbd5b6bbed3705b (patch)
tree34470ac344cda4f7e8353e0b1392c089bbb3123e /arch/arm64/include/asm/mte-def.h
parentKVM: arm64: Expose KVM_ARM_CAP_MTE (diff)
downloadlinux-dev-f0376edb1ddcab19a473b4bf1fbd5b6bbed3705b.tar.xz
linux-dev-f0376edb1ddcab19a473b4bf1fbd5b6bbed3705b.zip
KVM: arm64: Add ioctl to fetch/store tags in a guest
The VMM may not wish to have it's own mapping of guest memory mapped with PROT_MTE because this causes problems if the VMM has tag checking enabled (the guest controls the tags in physical RAM and it's unlikely the tags are correct for the VMM). Instead add a new ioctl which allows the VMM to easily read/write the tags from guest memory, allowing the VMM's mapping to be non-PROT_MTE while the VMM can still read/write the tags for the purpose of migration. Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Steven Price <steven.price@arm.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20210621111716.37157-6-steven.price@arm.com
Diffstat (limited to 'arch/arm64/include/asm/mte-def.h')
-rw-r--r--arch/arm64/include/asm/mte-def.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/mte-def.h b/arch/arm64/include/asm/mte-def.h
index cf241b0f0a42..626d359b396e 100644
--- a/arch/arm64/include/asm/mte-def.h
+++ b/arch/arm64/include/asm/mte-def.h
@@ -7,6 +7,7 @@
#define MTE_GRANULE_SIZE UL(16)
#define MTE_GRANULE_MASK (~(MTE_GRANULE_SIZE - 1))
+#define MTE_GRANULES_PER_PAGE (PAGE_SIZE / MTE_GRANULE_SIZE)
#define MTE_TAG_SHIFT 56
#define MTE_TAG_SIZE 4
#define MTE_TAG_MASK GENMASK((MTE_TAG_SHIFT + (MTE_TAG_SIZE - 1)), MTE_TAG_SHIFT)