From: Sean Christopherson Date: Sat, 29 Jul 2023 01:35:23 +0000 (-0700) Subject: drm/i915/gvt: Don't bother removing write-protection on to-be-deleted slot X-Git-Tag: v6.6.17~3972^2^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2ee05a4c275a54d9b64599bcbf7117a9490c9e43;p=platform%2Fkernel%2Flinux-rpi.git 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 Tested-by: Yongwei Ma Reviewed-by: Zhi Wang Link: https://lore.kernel.org/r/20230729013535.1070024-18-seanjc@google.com Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini --- diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c index e9276500435d..3ea3cb9eb599 100644 --- a/drivers/gpu/drm/i915/gvt/kvmgt.c +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c @@ -1630,14 +1630,8 @@ static void kvmgt_page_track_flush_slot(struct kvm *kvm, for (i = 0; i < slot->npages; i++) { gfn = slot->base_gfn + i; - if (kvmgt_gfn_is_write_protected(info, gfn)) { - write_lock(&kvm->mmu_lock); - kvm_slot_page_track_remove_page(kvm, slot, gfn, - KVM_PAGE_TRACK_WRITE); - write_unlock(&kvm->mmu_lock); - + if (kvmgt_gfn_is_write_protected(info, gfn)) kvmgt_protect_table_del(info, gfn); - } } mutex_unlock(&info->vgpu_lock); }