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 <[email protected]> Reviewed-by: Catalin Marinas <[email protected]> Reviewed-by: Steven Price <[email protected]> Reviewed-by: Cornelia Huck <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d89585f commit c911f0d

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

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)