Skip to content

Commit 2ee05a4

Browse files
sean-jcbonzini
authored andcommitted
drm/i915/gvt: Don't bother removing write-protection on to-be-deleted slot
When handling a slot "flush", don't call back into KVM to drop write protection for gfns in the slot. Now that KVM rejects attempts to move memory slots while KVMGT is attached, the only time a slot is "flushed" is when it's being removed, i.e. the memslot and all its write-tracking metadata is about to be deleted. Reviewed-by: Yan Zhao <yan.y.zhao@intel.com> Tested-by: Yongwei Ma <yongwei.ma@intel.com> Reviewed-by: Zhi Wang <zhi.a.wang@intel.com> Link: https://lore.kernel.org/r/20230729013535.1070024-18-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent c70934e commit 2ee05a4

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

drivers/gpu/drm/i915/gvt/kvmgt.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,14 +1630,8 @@ static void kvmgt_page_track_flush_slot(struct kvm *kvm,
16301630

16311631
for (i = 0; i < slot->npages; i++) {
16321632
gfn = slot->base_gfn + i;
1633-
if (kvmgt_gfn_is_write_protected(info, gfn)) {
1634-
write_lock(&kvm->mmu_lock);
1635-
kvm_slot_page_track_remove_page(kvm, slot, gfn,
1636-
KVM_PAGE_TRACK_WRITE);
1637-
write_unlock(&kvm->mmu_lock);
1638-
1633+
if (kvmgt_gfn_is_write_protected(info, gfn))
16391634
kvmgt_protect_table_del(info, gfn);
1640-
}
16411635
}
16421636
mutex_unlock(&info->vgpu_lock);
16431637
}

0 commit comments

Comments
 (0)