From f97859503859fd217d27fc4496f294955e197eaf Mon Sep 17 00:00:00 2001 From: Jason Gunthorpe Date: Fri, 7 Nov 2025 13:41:30 -0400 Subject: [PATCH] vfio: Require drivers to implement get_region_info Remove the fallback through the ioctl callback, no drivers use this now. Reviewed-by: Kevin Tian Reviewed-by: Pranjal Shrivastava Reviewed-by: Mostafa Saleh Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/14-v2-2a9e24d62f1b+e10a-vfio_get_region_info_op_jgg@nvidia.com Signed-off-by: Alex Williamson --- drivers/vfio/vfio_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c index a390163ce706c..f056e82ba3507 100644 --- a/drivers/vfio/vfio_main.c +++ b/drivers/vfio/vfio_main.c @@ -1297,13 +1297,13 @@ static long vfio_device_fops_unl_ioctl(struct file *filep, break; case VFIO_DEVICE_GET_REGION_INFO: - if (!device->ops->get_region_info) - goto ioctl_fallback; - ret = device->ops->get_region_info(device, uptr); + if (unlikely(!device->ops->get_region_info)) + ret = -EINVAL; + else + ret = device->ops->get_region_info(device, uptr); break; default: -ioctl_fallback: if (unlikely(!device->ops->ioctl)) ret = -EINVAL; else -- 2.47.3