[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b88e5ced-f7f4-5fc7-b7bb-df0201697444@intel.com>
Date: Tue, 1 Aug 2023 14:18:43 +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: <kvm@...r.kernel.org>, <intel-gvt-dev@...ts.freedesktop.org>,
<intel-gfx@...ts.freedesktop.org>, <linux-kernel@...r.kernel.org>,
Yan Zhao <yan.y.zhao@...el.com>,
Yongwei Ma <yongwei.ma@...el.com>,
Ben Gardon <bgardon@...gle.com>
Subject: Re: [PATCH v4 04/29] drm/i915/gvt: Don't try to unpin an empty page
range
On 7/29/2023 4:35 AM, Sean Christopherson wrote:
> From: Yan Zhao <yan.y.zhao@...el.com>
>
> Attempt to unpin pages in the error path of gvt_pin_guest_page() if and
> only if at least one page was successfully pinned. Unpinning doesn't
> cause functional problems, but vfio_device_container_unpin_pages()
> rightfully warns about being asked to unpin zero pages.
>
> Signed-off-by: Yan Zhao <yan.y.zhao@...el.com>
> [sean: write changelog]
> Signed-off-by: Sean Christopherson <seanjc@...gle.com>
> ---
> drivers/gpu/drm/i915/gvt/kvmgt.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
> index 429f0f993a13..0366a699baf5 100644
> --- a/drivers/gpu/drm/i915/gvt/kvmgt.c
> +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
> @@ -172,7 +172,8 @@ static int gvt_pin_guest_page(struct intel_vgpu *vgpu, unsigned long gfn,
> *page = base_page;
> return 0;
> err:
> - gvt_unpin_guest_page(vgpu, gfn, npage * PAGE_SIZE);
> + if (npage)
> + gvt_unpin_guest_page(vgpu, gfn, npage * PAGE_SIZE);
> return ret;
> }
>
Reviewed-by: Zhi Wang <zhi.a.wang@...el.com>
Powered by blists - more mailing lists