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/nvgrace: Convert to the get_region_info op

Change the signature of nvgrace_gpu_ioctl_get_region_info()

Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Ankit Agrawal <ankita@nvidia.com>
Reviewed-by: Pranjal Shrivastava <praan@google.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/4-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
5ac72064 c044eefa

+6 -9
+6 -9
drivers/vfio/pci/nvgrace-gpu/main.c
··· 205 205 return 0; 206 206 } 207 207 208 - static long 208 + static int 209 209 nvgrace_gpu_ioctl_get_region_info(struct vfio_device *core_vdev, 210 - unsigned long arg) 210 + struct vfio_region_info __user *arg) 211 211 { 212 212 struct nvgrace_gpu_pci_core_device *nvdev = 213 213 container_of(core_vdev, struct nvgrace_gpu_pci_core_device, ··· 220 220 u32 size; 221 221 int ret; 222 222 223 - if (copy_from_user(&info, (void __user *)arg, minsz)) 223 + if (copy_from_user(&info, arg, minsz)) 224 224 return -EFAULT; 225 225 226 226 if (info.argsz < minsz) ··· 232 232 */ 233 233 memregion = nvgrace_gpu_memregion(info.index, nvdev); 234 234 if (!memregion) 235 - return vfio_pci_core_ioctl(core_vdev, 236 - VFIO_DEVICE_GET_REGION_INFO, arg); 235 + return vfio_pci_ioctl_get_region_info(core_vdev, arg); 237 236 238 237 size = struct_size(sparse, areas, 1); 239 238 ··· 284 285 } 285 286 kfree(caps.buf); 286 287 } 287 - return copy_to_user((void __user *)arg, &info, minsz) ? 288 - -EFAULT : 0; 288 + return copy_to_user(arg, &info, minsz) ? -EFAULT : 0; 289 289 } 290 290 291 291 static long nvgrace_gpu_ioctl(struct vfio_device *core_vdev, 292 292 unsigned int cmd, unsigned long arg) 293 293 { 294 294 switch (cmd) { 295 - case VFIO_DEVICE_GET_REGION_INFO: 296 - return nvgrace_gpu_ioctl_get_region_info(core_vdev, arg); 297 295 case VFIO_DEVICE_IOEVENTFD: 298 296 return -ENOTTY; 299 297 case VFIO_DEVICE_RESET: ··· 686 690 .open_device = nvgrace_gpu_open_device, 687 691 .close_device = nvgrace_gpu_close_device, 688 692 .ioctl = nvgrace_gpu_ioctl, 693 + .get_region_info = nvgrace_gpu_ioctl_get_region_info, 689 694 .device_feature = vfio_pci_core_ioctl_feature, 690 695 .read = nvgrace_gpu_read, 691 696 .write = nvgrace_gpu_write,