@@ -1289,7 +1289,7 @@ vfio_pci_ioctl_pci_hot_reset_files(struct vfio_pci_core_device *vdev,
return -ENOMEM;
}
- if (copy_from_user(fds, arg->group_fds,
+ if (copy_from_user(fds, arg->fds,
hdr->count * sizeof(*fds))) {
kfree(fds);
kfree(files);
@@ -1297,8 +1297,8 @@ vfio_pci_ioctl_pci_hot_reset_files(struct vfio_pci_core_device *vdev,
}
/*
- * Get the group file for each fd to ensure the group held across
- * the reset
+ * Get the file for each fd to ensure the group/device file
+ * is held across the reset
*/
for (file_idx = 0; file_idx < hdr->count; file_idx++) {
struct file *file = fget(fds[file_idx]);
@@ -2469,7 +2469,8 @@ static int vfio_pci_dev_set_hot_reset(struct vfio_device_set *dev_set,
* cannot race being opened by another user simultaneously.
*
* Otherwise all opened devices in the dev_set must be
- * contained by the set of groups provided by the user.
+ * contained by the set of groups/devices provided by
+ * the user.
*
* If user provides a zero-length array, then all the
* opened devices must be bound to a same iommufd_ctx.
@@ -681,6 +681,7 @@ struct vfio_pci_hot_reset_info {
*
* The ownership can be proved by:
* - An array of group fds
+ * - An array of device fds
* - A zero-length array
*
* In the last case all affected devices which are opened by this user
@@ -694,7 +695,7 @@ struct vfio_pci_hot_reset {
__u32 argsz;
__u32 flags;
__u32 count;
- __s32 group_fds[];
+ __s32 fds[];
};
#define VFIO_DEVICE_PCI_HOT_RESET _IO(VFIO_TYPE, VFIO_BASE + 13)