Skip to contentSkip to conversation

drm/i915/gvt: throw error on unhandled vfio ioctls

PATCH Applied Gerd Hoffmann 3 participants 3 messages Mar 21, 2018 – Mar 22, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 drm/i915/gvt: throw error on unhandled vfio ioctls

On unknown/unhandled ioctls the driver should return an error, so userspace knows it tried to use something unsupported.

---
 drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/gvt/kvmgt.c +1 -1
index 021f722e24..f34d7f1e6c 100644
@@ -1284,7 +1284,7 @@ static long intel_vgpu_ioctl(struct mdev_device *mdev, unsigned int cmd,
 
 	}
 
-	return 0;
+	return -ENOTTY;
 }
 
 static ssize_t
Signature · 6 lines
2.9.3

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v3 1/1
#1 lore raw
Quoted 14 lines · On Wed, 21 Mar 2018 15:08:47 +0100 Gerd Hoffmann <[email protected]> wrote:

On unknown/unhandled ioctls the driver should return an error, so userspace knows it tried to use something unsupported.

---
 drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/gvt/kvmgt.c +0 -0
index 021f722e24..f34d7f1e6c 100644

drivers/gpu/drm/i915/gvt/kvmgt.c static long intel_vgpu_ioctl(struct mdev_device *mdev, unsigned int cmd, · line 1290

Quoted 8 lines
drivers/gpu/drm/i915/gvt/kvmgt.c +1 -1
@@ -1284,7 +1284,7 @@ static long intel_vgpu_ioctl(struct mdev_device *mdev, unsigned int cmd,
 
 	}
 
-	return 0;
+	return -ENOTTY;
 }
 
 static ssize_t

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Applied
#2 lore raw
Quoted 20 lines · Alex Williamson
Quoted 17 lines · On Wed, 21 Mar 2018 15:08:47 +0100 Gerd Hoffmann <[email protected]> wrote:

On unknown/unhandled ioctls the driver should return an error, so userspace knows it tried to use something unsupported.

---
 drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/gvt/kvmgt.c +0 -0
index 021f722e24..f34d7f1e6c 100644
@@ -1284,7 +1284,7 @@ static long intel_vgpu_ioctl(struct mdev_device *mdev, unsigned int cmd,
 
 	}
 
Quoted 7 lines

drivers/gpu/drm/i915/gvt/kvmgt.c static long intel_vgpu_ioctl(struct mdev_device *mdev, unsigned int cmd, · line 1290

Quoted 5 lines
drivers/gpu/drm/i915/gvt/kvmgt.c +1 -1
-	return 0;
+	return -ENOTTY;
 }
 
 static ssize_t

Applied, thanks!

Signature · 3 lines
Open Source Technology Center, Intel ltd.

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

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel