[PATCH] drm/i915/gvt: addressed vGPU hang during OCL conformance test
Zhenyu Wang
zhenyuw at linux.intel.com
Wed Jul 17 06:52:37 UTC 2019
Better change title on the driver issue this fixes.
On 2019.07.17 22:06:00 +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 quest 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.
>
> Signed-off-by: Xiaolin Zhang <xiaolin.zhang at intel.com>
> ---
> 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;
looks good to me. This should deserve to cc stable kernel.
Reviewed-by: Zhenyu Wang <zhenyuw at linux.intel.com>
> } else {
> kref_get(&entry->ref);
> *dma_addr = entry->dma_addr;
> --
> 1.8.3.1
>
> _______________________________________________
> intel-gvt-dev mailing list
> intel-gvt-dev at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20190717/276c21e6/attachment.sig>
More information about the intel-gvt-dev
mailing list