[PATCH 1/3] drm/i915/gvt: remove the vgpu->released and its sanity check

Zhenyu Wang zhenyuw at linux.intel.com
Tue Nov 8 06:19:57 UTC 2022


On 2022.11.04 14:56:50 +0000, Zhi Wang wrote:
> The life cycle of a vGPU, which is represented by a vfio_device, has been
> managed by the VFIO core logic. Remove the vgpu->released, which was used
> for a sanity check on the removal path of the vGPU instance. The sanity
> check has already been covered in the VFIO core logic.
> 
> Cc: Zhenyu Wang <zhenyuw at linux.intel.com>
> Cc: Kevin Tian <kevin.tian at intel.com>
> Cc: Jason Gunthorpe <jgg at nvidia.com>
> Cc: intel-gvt-dev at lists.freedesktop.org
> Suggested-by: Alex Williamson <alex.williamson at redhat.com>
> Signed-off-by: Zhi Wang <zhi.a.wang at intel.com>
> ---
>  drivers/gpu/drm/i915/gvt/gvt.h   | 2 --
>  drivers/gpu/drm/i915/gvt/kvmgt.c | 4 ----
>  2 files changed, 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b/drivers/gpu/drm/i915/gvt/gvt.h
> index dbf8d7470b2c..62823c0e13ab 100644
> --- a/drivers/gpu/drm/i915/gvt/gvt.h
> +++ b/drivers/gpu/drm/i915/gvt/gvt.h
> @@ -227,8 +227,6 @@ struct intel_vgpu {
>  	unsigned long nr_cache_entries;
>  	struct mutex cache_lock;
>  
> -	atomic_t released;
> -
>  	struct kvm_page_track_notifier_node track_node;
>  #define NR_BKT (1 << 18)
>  	struct hlist_head ptable[NR_BKT];
> diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
> index 7a45e5360caf..897b6fdbbaed 100644
> --- a/drivers/gpu/drm/i915/gvt/kvmgt.c
> +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
> @@ -684,7 +684,6 @@ static int intel_vgpu_open_device(struct vfio_device *vfio_dev)
>  
>  	intel_gvt_activate_vgpu(vgpu);
>  
> -	atomic_set(&vgpu->released, 0);
>  	return 0;
>  }
>  
> @@ -706,9 +705,6 @@ static void intel_vgpu_close_device(struct vfio_device *vfio_dev)
>  	if (!vgpu->attached)
>  		return;
>  
> -	if (atomic_cmpxchg(&vgpu->released, 0, 1))
> -		return;
> -
>  	intel_gvt_release_vgpu(vgpu);
>  
>  	debugfs_remove(debugfs_lookup(KVMGT_DEBUGFS_FILENAME, vgpu->debugfs));
> -- 
> 2.25.1
> 

Reviewed-by: Zhenyu Wang <zhenyuw at linux.intel.com>
-------------- 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/20221108/89e72d46/attachment.sig>


More information about the intel-gvt-dev mailing list