aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/vfio.h
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2013-09-04 13:28:04 -0400
committerAlex Williamson <alex.williamson@redhat.com>2013-09-04 13:28:04 -0400
commit8b27ee60bfd6bbb84d2df28fa706c5c5081066ca (patch)
tree1fab334bc5bfdc157df746cda06ad328cc1a5208 /include/uapi/linux/vfio.h
parent3bc4f3993b93dbf1f6402e2034a2e20eb07db807 (diff)
vfio-pci: PCI hot reset interface
The current VFIO_DEVICE_RESET interface only maps to PCI use cases where we can isolate the reset to the individual PCI function. This means the device must support FLR (PCIe or AF), PM reset on D3hot->D0 transition, device specific reset, or be a singleton device on a bus for a secondary bus reset. FLR does not have widespread support, PM reset is not very reliable, and bus topology is dictated by the system and device design. We need to provide a means for a user to induce a bus reset in cases where the existing mechanisms are not available or not reliable. This device specific extension to VFIO provides the user with this ability. Two new ioctls are introduced: - VFIO_DEVICE_PCI_GET_HOT_RESET_INFO - VFIO_DEVICE_PCI_HOT_RESET The first provides the user with information about the extent of devices affected by a hot reset. This is essentially a list of devices and the IOMMU groups they belong to. The user may then initiate a hot reset by calling the second ioctl. We must be careful that the user has ownership of all the affected devices found via the first ioctl, so the second ioctl takes a list of file descriptors for the VFIO groups affected by the reset. Each group must have IOMMU protection established for the ioctl to succeed. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'include/uapi/linux/vfio.h')
-rw-r--r--include/uapi/linux/vfio.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
index 916e444e6f74..0fd47f5bc146 100644
--- a/include/uapi/linux/vfio.h
+++ b/include/uapi/linux/vfio.h
@@ -324,6 +324,44 @@ enum {
324 VFIO_PCI_NUM_IRQS 324 VFIO_PCI_NUM_IRQS
325}; 325};
326 326
327/**
328 * VFIO_DEVICE_GET_PCI_HOT_RESET_INFO - _IORW(VFIO_TYPE, VFIO_BASE + 12,
329 * struct vfio_pci_hot_reset_info)
330 *
331 * Return: 0 on success, -errno on failure:
332 * -enospc = insufficient buffer, -enodev = unsupported for device.
333 */
334struct vfio_pci_dependent_device {
335 __u32 group_id;
336 __u16 segment;
337 __u8 bus;
338 __u8 devfn; /* Use PCI_SLOT/PCI_FUNC */
339};
340
341struct vfio_pci_hot_reset_info {
342 __u32 argsz;
343 __u32 flags;
344 __u32 count;
345 struct vfio_pci_dependent_device devices[];
346};
347
348#define VFIO_DEVICE_GET_PCI_HOT_RESET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
349
350/**
351 * VFIO_DEVICE_PCI_HOT_RESET - _IOW(VFIO_TYPE, VFIO_BASE + 13,
352 * struct vfio_pci_hot_reset)
353 *
354 * Return: 0 on success, -errno on failure.
355 */
356struct vfio_pci_hot_reset {
357 __u32 argsz;
358 __u32 flags;
359 __u32 count;
360 __s32 group_fds[];
361};
362
363#define VFIO_DEVICE_PCI_HOT_RESET _IO(VFIO_TYPE, VFIO_BASE + 13)
364
327/* -------- API for Type1 VFIO IOMMU -------- */ 365/* -------- API for Type1 VFIO IOMMU -------- */
328 366
329/** 367/**