[PATCH] i916/gvt: throw error on unhandled vfio ioctls

Zhenyu Wang zhenyuw at linux.intel.com
Wed Mar 21 08:42:51 UTC 2018


Hi, Gerd, pls change patch title as "drm/i915/gvt: ...".

On 2018.03.21 09:12:48 +0100, Gerd Hoffmann wrote:
> On unknown/unhandled ioctls the driver should return an error, so
> userspace knows it tried to use something unsupported.
>
yeah, agree.

> Cc: linux-stable at vger.kernel.org
Shouldn't that be stable at vger.kernel.org?
                                                
> Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
> ---
>  drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
> index 021f722e24..be881d53c2 100644
> --- a/drivers/gpu/drm/i915/gvt/kvmgt.c
> +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
> @@ -1284,7 +1284,7 @@ static long intel_vgpu_ioctl(struct mdev_device *mdev, unsigned int cmd,
>  
>  	}
>  
> -	return 0;
> +	return -EINVAL;

I think better to use -ENOTTY to align with vfio for unhandled ioctl?

>  }
>  
>  static ssize_t
> -- 
> 2.9.3
> 

-- 
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/20180321/c1d7f231/attachment.sig>


More information about the intel-gvt-dev mailing list