Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

vfio/cdx: Provide a get_region_info op

Change the signature of vfio_cdx_ioctl_get_region_info() and hook it to
the op.

Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Pranjal Shrivastava <praan@google.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/11-v2-2a9e24d62f1b+e10a-vfio_get_region_info_op_jgg@nvidia.com
Signed-off-by: Alex Williamson <alex@shazbot.org>

authored by

Jason Gunthorpe and committed by
Alex Williamson
b9827eff 6cdae5d0

+4 -3
+4 -3
drivers/vfio/cdx/main.c
··· 129 129 return copy_to_user(arg, &info, minsz) ? -EFAULT : 0; 130 130 } 131 131 132 - static int vfio_cdx_ioctl_get_region_info(struct vfio_cdx_device *vdev, 132 + static int vfio_cdx_ioctl_get_region_info(struct vfio_device *core_vdev, 133 133 struct vfio_region_info __user *arg) 134 134 { 135 + struct vfio_cdx_device *vdev = 136 + container_of(core_vdev, struct vfio_cdx_device, vdev); 135 137 unsigned long minsz = offsetofend(struct vfio_region_info, offset); 136 138 struct cdx_device *cdx_dev = to_cdx_device(vdev->vdev.dev); 137 139 struct vfio_region_info info; ··· 221 219 switch (cmd) { 222 220 case VFIO_DEVICE_GET_INFO: 223 221 return vfio_cdx_ioctl_get_info(vdev, uarg); 224 - case VFIO_DEVICE_GET_REGION_INFO: 225 - return vfio_cdx_ioctl_get_region_info(vdev, uarg); 226 222 case VFIO_DEVICE_GET_IRQ_INFO: 227 223 return vfio_cdx_ioctl_get_irq_info(vdev, uarg); 228 224 case VFIO_DEVICE_SET_IRQS: ··· 284 284 .open_device = vfio_cdx_open_device, 285 285 .close_device = vfio_cdx_close_device, 286 286 .ioctl = vfio_cdx_ioctl, 287 + .get_region_info = vfio_cdx_ioctl_get_region_info, 287 288 .device_feature = vfio_cdx_ioctl_feature, 288 289 .mmap = vfio_cdx_mmap, 289 290 .bind_iommufd = vfio_iommufd_physical_bind,