[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54fb226b-a4b6-92e5-92a8-e3e3f68e0d42@intel.com>
Date: Tue, 1 Aug 2023 14:37:33 +0300
From: "Wang, Zhi A" <zhi.a.wang@...el.com>
To: Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Zhenyu Wang <zhenyuw@...ux.intel.com>
CC: Yan Zhao <yan.y.zhao@...el.com>, <kvm@...r.kernel.org>,
<intel-gfx@...ts.freedesktop.org>, <linux-kernel@...r.kernel.org>,
Yongwei Ma <yongwei.ma@...el.com>,
Ben Gardon <bgardon@...gle.com>,
<intel-gvt-dev@...ts.freedesktop.org>
Subject: Re: [PATCH v4 17/29] drm/i915/gvt: Don't bother removing
write-protection on to-be-deleted slot
On 7/29/2023 4:35 AM, Sean Christopherson wrote:
> 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@...el.com>
> Tested-by: Yongwei Ma <yongwei.ma@...el.com>
> Signed-off-by: Sean Christopherson <seanjc@...gle.com>
> ---
> drivers/gpu/drm/i915/gvt/kvmgt.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> 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);
> }
Reviewed-by: Zhi Wang <zhi.a.wang@...el.com>
Powered by blists - more mailing lists