Skip to content

Commit

Permalink
KVM: arm64: permit all VM_MTE_ALLOWED mappings with MTE enabled
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Peter Collingbourne authored and Marc Zyngier committed Nov 29, 2022
1 parent d89585f commit c911f0d
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions arch/arm64/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1110,14 +1110,6 @@ static void sanitise_mte_tags(struct kvm *kvm, kvm_pfn_t pfn,

static bool kvm_vma_mte_allowed(struct vm_area_struct *vma)
{
/*
* VM_SHARED mappings are not allowed with MTE to avoid races
* when updating the PG_mte_tagged page flag, see
* sanitise_mte_tags for more details.
*/
if (vma->vm_flags & VM_SHARED)
return false;

return vma->vm_flags & VM_MTE_ALLOWED;
}

Expand Down

0 comments on commit c911f0d

Please sign in to comment.