All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhenyu Wang <zhenyuw@linux.intel.com>
To: Xiaolin Zhang <xiaolin.zhang@intel.com>
Cc: intel-gvt-dev@lists.freedesktop.org, stable@vger.kernel.org
Subject: Re: [PATCH] drm/i915/gvt: fix incorrect cache entry for guest page mapping
Date: Thu, 18 Jul 2019 11:05:41 +0800	[thread overview]
Message-ID: <20190718030541.GC16681@zhen-hp.sh.intel.com> (raw)
In-Reply-To: <1563383424-23315-1-git-send-email-xiaolin.zhang@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1911 bytes --]

On 2019.07.18 01:10:24 +0800, Xiaolin Zhang wrote:
> GPU hang observed during the guest OCL conformance test which is caused
> by THP GTT feature used durning the test.
> 
> It was observed the same GFN with different size (4K and 2M) requested
> from the guest in GVT. So during the guest page dma map stage, it is
> required to unmap first with orginal size and then remap again with
> requested size.
> 
> Fixes: b901b252b6cf ("drm/i915/gvt: Add 2M huge gtt support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Xiaolin Zhang <xiaolin.zhang@intel.com>
> ---

Applied, thanks!

>  drivers/gpu/drm/i915/gvt/kvmgt.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
> index a68addf..4a7cf86 100644
> --- a/drivers/gpu/drm/i915/gvt/kvmgt.c
> +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
> @@ -1911,6 +1911,18 @@ static int kvmgt_dma_map_guest_page(unsigned long handle, unsigned long gfn,
>  		ret = __gvt_cache_add(info->vgpu, gfn, *dma_addr, size);
>  		if (ret)
>  			goto err_unmap;
> +	} else if (entry->size != size) {
> +		/* the same gfn with different size: unmap and re-map */
> +		gvt_dma_unmap_page(vgpu, gfn, entry->dma_addr, entry->size);
> +		__gvt_cache_remove_entry(vgpu, entry);
> +
> +		ret = gvt_dma_map_page(vgpu, gfn, dma_addr, size);
> +		if (ret)
> +			goto err_unlock;
> +
> +		ret = __gvt_cache_add(info->vgpu, gfn, *dma_addr, size);
> +		if (ret)
> +			goto err_unmap;
>  	} else {
>  		kref_get(&entry->ref);
>  		*dma_addr = entry->dma_addr;
> -- 
> 1.8.3.1
> 
> _______________________________________________
> intel-gvt-dev mailing list
> intel-gvt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2019-07-18  3:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-17 17:10 [PATCH] drm/i915/gvt: fix incorrect cache entry for guest page mapping Xiaolin Zhang
2019-07-18  3:05 ` Zhenyu Wang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-07-17 15:56 Xiaolin Zhang
2019-07-17  7:55 ` Greg KH
2019-07-17  8:08   ` Zhang, Xiaolin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190718030541.GC16681@zhen-hp.sh.intel.com \
    --to=zhenyuw@linux.intel.com \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=stable@vger.kernel.org \
    --cc=xiaolin.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.