Commit 188982cd authored by Marc Zyngier's avatar Marc Zyngier

Merge branch kvm-arm64/mmu/mte into kvmarm-master/next

Last minute fix for MTE, making sure the pages are
flagged as MTE before they are released.

* kvm-arm64/mmu/mte:
  KVM: arm64: Set the MTE tag bit before releasing the page
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
parents 9f03db66 98db7259
......@@ -1053,6 +1053,14 @@ long kvm_vm_ioctl_mte_copy_tags(struct kvm *kvm,
} else {
num_tags = mte_copy_tags_from_user(maddr, tags,
MTE_GRANULES_PER_PAGE);
/*
* Set the flag after checking the write
* completed fully
*/
if (num_tags == MTE_GRANULES_PER_PAGE)
set_bit(PG_mte_tagged, &page->flags);
kvm_release_pfn_dirty(pfn);
}
......@@ -1061,10 +1069,6 @@ long kvm_vm_ioctl_mte_copy_tags(struct kvm *kvm,
goto out;
}
/* Set the flag after checking the write completed fully */
if (write)
set_bit(PG_mte_tagged, &page->flags);
gfn++;
tags += num_tags;
length -= PAGE_SIZE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment