]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: arm64: Update stale comment for sanitise_mte_tags()
authorAlexandru Elisei <alexandru.elisei@arm.com>
Mon, 15 Sep 2025 15:52:34 +0000 (16:52 +0100)
committerMarc Zyngier <maz@kernel.org>
Mon, 15 Sep 2025 16:51:38 +0000 (17:51 +0100)
commit597f41e1743882db32f99dde062adbec29104586
treefe11cb3e6e0de61f3efdb0bb9a8fb3f392f51734
parent27d2b47eef033f1fc6c0452dc1017e43dad5fe14
KVM: arm64: Update stale comment for sanitise_mte_tags()

Commit c911f0d46879 ("KVM: arm64: permit all VM_MTE_ALLOWED mappings
with MTE enabled") allowed VM_SHARED VMAs in a VM with MTE enabled, so
remove the comment to the contrary.

Commit d77e59a8fccd ("arm64: mte: Lock a page for MTE tag initialisation")
removed the race that can lead to tags being zeroed more than once when
multiple threads attempt initialisation at the same time, so remove the
comment about mmap_lock too. Note that sanitise_mte_tags() was never called
with the mmap_lock held from user_mem_abort() and the race was prevented by
kvm->mmu_lock.

However, the function still requires to have the kvm->mmu_lock held to
ensure that the memory remains mapped in the userspace process while the
tags are zeroed. Document this in a comment.

CC: Peter Collingbourne <pcc@google.com>
CC: Catalin Marinas <catalin.marinas@arm.com>
CC: Steven Price <steven.price@arm.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/mmu.c