Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
| 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef _UAPIVFIO_H |
| 20 | #define _UAPIVFIO_H |
| 21 | #include <linux/types.h> |
| 22 | #include <linux/ioctl.h> |
| 23 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 24 | #define VFIO_API_VERSION 0 |
| 25 | #define VFIO_TYPE1_IOMMU 1 |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 26 | #define VFIO_SPAPR_TCE_IOMMU 2 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 27 | #define VFIO_TYPE (';') |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 28 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 29 | #define VFIO_BASE 100 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 30 | #define VFIO_GET_API_VERSION _IO(VFIO_TYPE, VFIO_BASE + 0) |
| 31 | #define VFIO_CHECK_EXTENSION _IO(VFIO_TYPE, VFIO_BASE + 1) |
| 32 | #define VFIO_SET_IOMMU _IO(VFIO_TYPE, VFIO_BASE + 2) |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 33 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 34 | struct vfio_group_status { |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 35 | __u32 argsz; |
| 36 | __u32 flags; |
| 37 | #define VFIO_GROUP_FLAGS_VIABLE (1 << 0) |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 38 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 39 | #define VFIO_GROUP_FLAGS_CONTAINER_SET (1 << 1) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 40 | }; |
| 41 | #define VFIO_GROUP_GET_STATUS _IO(VFIO_TYPE, VFIO_BASE + 3) |
| 42 | #define VFIO_GROUP_SET_CONTAINER _IO(VFIO_TYPE, VFIO_BASE + 4) |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 43 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 44 | #define VFIO_GROUP_UNSET_CONTAINER _IO(VFIO_TYPE, VFIO_BASE + 5) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 45 | #define VFIO_GROUP_GET_DEVICE_FD _IO(VFIO_TYPE, VFIO_BASE + 6) |
| 46 | struct vfio_device_info { |
| 47 | __u32 argsz; |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 48 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 49 | __u32 flags; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 50 | #define VFIO_DEVICE_FLAGS_RESET (1 << 0) |
| 51 | #define VFIO_DEVICE_FLAGS_PCI (1 << 1) |
| 52 | __u32 num_regions; |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 53 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 54 | __u32 num_irqs; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 55 | }; |
| 56 | #define VFIO_DEVICE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 7) |
| 57 | struct vfio_region_info { |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 58 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 59 | __u32 argsz; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 60 | __u32 flags; |
| 61 | #define VFIO_REGION_INFO_FLAG_READ (1 << 0) |
| 62 | #define VFIO_REGION_INFO_FLAG_WRITE (1 << 1) |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 63 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 64 | #define VFIO_REGION_INFO_FLAG_MMAP (1 << 2) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 65 | __u32 index; |
| 66 | __u32 resv; |
| 67 | __u64 size; |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 68 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 69 | __u64 offset; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 70 | }; |
| 71 | #define VFIO_DEVICE_GET_REGION_INFO _IO(VFIO_TYPE, VFIO_BASE + 8) |
| 72 | struct vfio_irq_info { |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 73 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 74 | __u32 argsz; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 75 | __u32 flags; |
| 76 | #define VFIO_IRQ_INFO_EVENTFD (1 << 0) |
| 77 | #define VFIO_IRQ_INFO_MASKABLE (1 << 1) |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 78 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 79 | #define VFIO_IRQ_INFO_AUTOMASKED (1 << 2) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 80 | #define VFIO_IRQ_INFO_NORESIZE (1 << 3) |
| 81 | __u32 index; |
| 82 | __u32 count; |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 83 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 84 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 85 | #define VFIO_DEVICE_GET_IRQ_INFO _IO(VFIO_TYPE, VFIO_BASE + 9) |
| 86 | struct vfio_irq_set { |
| 87 | __u32 argsz; |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 88 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 89 | __u32 flags; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 90 | #define VFIO_IRQ_SET_DATA_NONE (1 << 0) |
| 91 | #define VFIO_IRQ_SET_DATA_BOOL (1 << 1) |
| 92 | #define VFIO_IRQ_SET_DATA_EVENTFD (1 << 2) |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 93 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 94 | #define VFIO_IRQ_SET_ACTION_MASK (1 << 3) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 95 | #define VFIO_IRQ_SET_ACTION_UNMASK (1 << 4) |
| 96 | #define VFIO_IRQ_SET_ACTION_TRIGGER (1 << 5) |
| 97 | __u32 index; |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 98 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 99 | __u32 start; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 100 | __u32 count; |
| 101 | __u8 data[]; |
| 102 | }; |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 103 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 104 | #define VFIO_DEVICE_SET_IRQS _IO(VFIO_TYPE, VFIO_BASE + 10) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 105 | #define VFIO_IRQ_SET_DATA_TYPE_MASK (VFIO_IRQ_SET_DATA_NONE | VFIO_IRQ_SET_DATA_BOOL | VFIO_IRQ_SET_DATA_EVENTFD) |
| 106 | #define VFIO_IRQ_SET_ACTION_TYPE_MASK (VFIO_IRQ_SET_ACTION_MASK | VFIO_IRQ_SET_ACTION_UNMASK | VFIO_IRQ_SET_ACTION_TRIGGER) |
| 107 | #define VFIO_DEVICE_RESET _IO(VFIO_TYPE, VFIO_BASE + 11) |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 108 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 109 | enum { |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 110 | VFIO_PCI_BAR0_REGION_INDEX, |
| 111 | VFIO_PCI_BAR1_REGION_INDEX, |
| 112 | VFIO_PCI_BAR2_REGION_INDEX, |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 113 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 114 | VFIO_PCI_BAR3_REGION_INDEX, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 115 | VFIO_PCI_BAR4_REGION_INDEX, |
| 116 | VFIO_PCI_BAR5_REGION_INDEX, |
| 117 | VFIO_PCI_ROM_REGION_INDEX, |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 118 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 119 | VFIO_PCI_CONFIG_REGION_INDEX, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 120 | VFIO_PCI_VGA_REGION_INDEX, |
| 121 | VFIO_PCI_NUM_REGIONS |
| 122 | }; |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 123 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 124 | enum { |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 125 | VFIO_PCI_INTX_IRQ_INDEX, |
| 126 | VFIO_PCI_MSI_IRQ_INDEX, |
| 127 | VFIO_PCI_MSIX_IRQ_INDEX, |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 128 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 129 | VFIO_PCI_ERR_IRQ_INDEX, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 130 | VFIO_PCI_NUM_IRQS |
| 131 | }; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 132 | struct vfio_pci_dependent_device { |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 133 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 134 | __u32 group_id; |
| 135 | __u16 segment; |
| 136 | __u8 bus; |
| 137 | __u8 devfn; |
| 138 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 139 | }; |
| 140 | struct vfio_pci_hot_reset_info { |
| 141 | __u32 argsz; |
| 142 | __u32 flags; |
| 143 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 144 | __u32 count; |
| 145 | struct vfio_pci_dependent_device devices[]; |
| 146 | }; |
| 147 | #define VFIO_DEVICE_GET_PCI_HOT_RESET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12) |
| 148 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 149 | struct vfio_pci_hot_reset { |
| 150 | __u32 argsz; |
| 151 | __u32 flags; |
| 152 | __u32 count; |
| 153 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 154 | __s32 group_fds[]; |
| 155 | }; |
| 156 | #define VFIO_DEVICE_PCI_HOT_RESET _IO(VFIO_TYPE, VFIO_BASE + 13) |
| 157 | struct vfio_iommu_type1_info { |
| 158 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 159 | __u32 argsz; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 160 | __u32 flags; |
| 161 | #define VFIO_IOMMU_INFO_PGSIZES (1 << 0) |
| 162 | __u64 iova_pgsizes; |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 163 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 164 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 165 | #define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12) |
| 166 | struct vfio_iommu_type1_dma_map { |
| 167 | __u32 argsz; |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 168 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 169 | __u32 flags; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 170 | #define VFIO_DMA_MAP_FLAG_READ (1 << 0) |
| 171 | #define VFIO_DMA_MAP_FLAG_WRITE (1 << 1) |
| 172 | __u64 vaddr; |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 173 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 174 | __u64 iova; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 175 | __u64 size; |
| 176 | }; |
| 177 | #define VFIO_IOMMU_MAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 13) |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 178 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 179 | struct vfio_iommu_type1_dma_unmap { |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 180 | __u32 argsz; |
| 181 | __u32 flags; |
| 182 | __u64 iova; |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 183 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 184 | __u64 size; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 185 | }; |
| 186 | #define VFIO_IOMMU_UNMAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 14) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame^] | 187 | #define VFIO_IOMMU_ENABLE _IO(VFIO_TYPE, VFIO_BASE + 15) |
| 188 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 189 | #define VFIO_IOMMU_DISABLE _IO(VFIO_TYPE, VFIO_BASE + 16) |
| 190 | struct vfio_iommu_spapr_tce_info { |
| 191 | __u32 argsz; |
| 192 | __u32 flags; |
| 193 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 194 | __u32 dma32_window_start; |
| 195 | __u32 dma32_window_size; |
| 196 | }; |
| 197 | #define VFIO_IOMMU_SPAPR_TCE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12) |
| 198 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 199 | #endif |