summarylogtreecommitdiffstats
path: root/vfio-msi-4.patch
blob: 98417a11613c172155efb7bb7f11b7e1ce5fb70d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Update with proposed ioeventfd API.

Signed-off-by: Alex Williamson <address@hidden>
---
 linux-headers/linux/vfio.h |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h
index 4312e961ffd3..0921994daa6d 100644
--- a/linux-headers/linux/vfio.h
+++ b/linux-headers/linux/vfio.h
@@ -503,6 +503,30 @@ struct vfio_pci_hot_reset {

 #define VFIO_DEVICE_PCI_HOT_RESET      _IO(VFIO_TYPE, VFIO_BASE + 13)

+/**
+ * VFIO_DEVICE_IOEVENTFD - _IOW(VFIO_TYPE, VFIO_BASE + 14,
+ *                              struct vfio_device_ioeventfd)
+ *
+ * Perform a write to the device at the specified device fd offset, with
+ * the specified data and width when the provided eventfd is triggered.
+ *
+ * Return: 0 on success, -errno on failure.
+ */
+struct vfio_device_ioeventfd {
+       __u32   argsz;
+       __u32   flags;
+#define VFIO_DEVICE_IOEVENTFD_8                (1 << 0) /* 1-byte write */
+#define VFIO_DEVICE_IOEVENTFD_16       (1 << 1) /* 2-byte write */
+#define VFIO_DEVICE_IOEVENTFD_32       (1 << 2) /* 4-byte write */
+#define VFIO_DEVICE_IOEVENTFD_64       (1 << 3) /* 8-byte write */
+#define VFIO_DEVICE_IOEVENTFD_SIZE_MASK        (0xf)
+       __u64   offset;                 /* device fd offset of write */
+       __u64   data;                   /* data to be written */
+       __s32   fd;                     /* -1 for de-assignment */
+};
+
+#define VFIO_DEVICE_IOEVENTFD          _IO(VFIO_TYPE, VFIO_BASE + 14)
+
 /* -------- API for Type1 VFIO IOMMU -------- */

 /**