[PATCH v2 1/2] drm/i915/gvt: Fix possible recursive locking issue

Zhenyu Wang zhenyuw at linux.intel.com
Fri Jun 23 06:51:00 UTC 2017


On 2017.06.21 10:29:57 +0800, Chuanxiao Dong wrote:
> @@ -482,6 +513,7 @@ static int intel_vgpu_iommu_notifier(struct notifier_block *nb,
>  	struct intel_vgpu *vgpu = container_of(nb,
>  					struct intel_vgpu,
>  					vdev.iommu_notifier);
> +	bool sched_unmap = false;
>  
>  	if (action == VFIO_IOMMU_NOTIFY_DMA_UNMAP) {
>  		struct vfio_iommu_type1_dma_unmap *unmap = data;
> @@ -491,7 +523,10 @@ static int intel_vgpu_iommu_notifier(struct notifier_block *nb,
>  		end_gfn = gfn + unmap->size / PAGE_SIZE;
>  
>  		while (gfn < end_gfn)
> -			gvt_cache_remove(vgpu, gfn++);
> +			sched_unmap |= gvt_cache_mark(vgpu, gfn++);
> +
> +		if (sched_unmap)
> +			schedule_work(&vgpu->vdev.unpin_work);
>  	}
>  

And might just check list_empty(unpin_list) here if require to
schedule unpin work, pls resend this with those change.

-- 
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/20170623/0380d1e5/attachment.sig>


More information about the intel-gvt-dev mailing list