vfio/pci: Allow passing zero-length fd array in VFIO_DEVICE_PCI_HOT_RESET
authorYi Liu <yi.l.liu@intel.com>
Tue, 18 Jul 2023 10:55:42 +0000 (03:55 -0700)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 25 Jul 2023 16:18:13 +0000 (10:18 -0600)
commit71791b9246c7339f0d151e853546acc653522e2f
tree17ceb6e1a31b0924b07dbb5cb53c210d2e0c907e
parentb56b7aabcf3cfde57559d3ab06567b94f348f13c
vfio/pci: Allow passing zero-length fd array in VFIO_DEVICE_PCI_HOT_RESET

This is the way user to invoke hot-reset for the devices opened by cdev
interface. User should check the flag VFIO_PCI_HOT_RESET_FLAG_DEV_ID_OWNED
in the output of VFIO_DEVICE_GET_PCI_HOT_RESET_INFO ioctl before doing
hot-reset for cdev devices.

Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Tested-by: Yanting Jiang <yanting.jiang@intel.com>
Tested-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Link: https://lore.kernel.org/r/20230718105542.4138-11-yi.l.liu@intel.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/pci/vfio_pci_core.c
include/uapi/linux/vfio.h