Skip to content

Commit c911f0d

Browse files
pccMarc Zyngier
authored andcommitted
KVM: arm64: permit all VM_MTE_ALLOWED mappings with MTE enabled
Certain VMMs such as crosvm have features (e.g. sandboxing) that depend on being able to map guest memory as MAP_SHARED. The current restriction on sharing MAP_SHARED pages with the guest is preventing the use of those features with MTE. Now that the races between tasks concurrently clearing tags on the same page have been fixed, remove this restriction. Note that this is a relaxation of the ABI. Signed-off-by: Peter Collingbourne <pcc@google.com> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20221104011041.290951-8-pcc@google.com
1 parent d89585f commit c911f0d

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

arch/arm64/kvm/mmu.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,14 +1110,6 @@ static void sanitise_mte_tags(struct kvm *kvm, kvm_pfn_t pfn,
11101110

11111111
static bool kvm_vma_mte_allowed(struct vm_area_struct *vma)
11121112
{
1113-
/*
1114-
* VM_SHARED mappings are not allowed with MTE to avoid races
1115-
* when updating the PG_mte_tagged page flag, see
1116-
* sanitise_mte_tags for more details.
1117-
*/
1118-
if (vma->vm_flags & VM_SHARED)
1119-
return false;
1120-
11211113
return vma->vm_flags & VM_MTE_ALLOWED;
11221114
}
11231115

0 commit comments

Comments
 (0)