blob: 01b89568c1c1d51b82da7cc69916e94dc08c76db [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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 Ferris38062f92014-07-09 15:33:25 -070026#define VFIO_SPAPR_TCE_IOMMU 2
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070027#define VFIO_TYPE1v2_IOMMU 3
Elliott Hughes8cb52b02013-11-21 13:43:23 -080028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070029#define VFIO_DMA_CC_IOMMU 4
Christopher Ferris82d75042015-01-26 10:57:07 -080030#define VFIO_EEH 5
31#define VFIO_TYPE1_NESTING_IOMMU 6
Christopher Ferris05d08e92016-02-04 13:16:38 -080032#define VFIO_SPAPR_TCE_v2_IOMMU 7
Christopher Ferris82d75042015-01-26 10:57:07 -080033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070034#define VFIO_NOIOMMU_IOMMU 8
Christopher Ferris05d08e92016-02-04 13:16:38 -080035#define VFIO_TYPE (';')
Christopher Ferris38062f92014-07-09 15:33:25 -070036#define VFIO_BASE 100
Christopher Ferris106b3a82016-08-24 12:15:38 -070037struct vfio_info_cap_header {
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39 __u16 id;
40 __u16 version;
41 __u32 next;
42};
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070044#define VFIO_GET_API_VERSION _IO(VFIO_TYPE, VFIO_BASE + 0)
45#define VFIO_CHECK_EXTENSION _IO(VFIO_TYPE, VFIO_BASE + 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -080046#define VFIO_SET_IOMMU _IO(VFIO_TYPE, VFIO_BASE + 2)
Christopher Ferris38062f92014-07-09 15:33:25 -070047struct vfio_group_status {
Christopher Ferris106b3a82016-08-24 12:15:38 -070048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080049 __u32 argsz;
50 __u32 flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -080051#define VFIO_GROUP_FLAGS_VIABLE (1 << 0)
Christopher Ferris38062f92014-07-09 15:33:25 -070052#define VFIO_GROUP_FLAGS_CONTAINER_SET (1 << 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -070053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070054};
55#define VFIO_GROUP_GET_STATUS _IO(VFIO_TYPE, VFIO_BASE + 3)
Christopher Ferris05d08e92016-02-04 13:16:38 -080056#define VFIO_GROUP_SET_CONTAINER _IO(VFIO_TYPE, VFIO_BASE + 4)
Christopher Ferris38062f92014-07-09 15:33:25 -070057#define VFIO_GROUP_UNSET_CONTAINER _IO(VFIO_TYPE, VFIO_BASE + 5)
Christopher Ferris106b3a82016-08-24 12:15:38 -070058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define VFIO_GROUP_GET_DEVICE_FD _IO(VFIO_TYPE, VFIO_BASE + 6)
60struct vfio_device_info {
Christopher Ferris05d08e92016-02-04 13:16:38 -080061 __u32 argsz;
Tao Baod7db5942015-01-28 10:07:51 -080062 __u32 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -070063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070064#define VFIO_DEVICE_FLAGS_RESET (1 << 0)
65#define VFIO_DEVICE_FLAGS_PCI (1 << 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -080066#define VFIO_DEVICE_FLAGS_PLATFORM (1 << 2)
67#define VFIO_DEVICE_FLAGS_AMBA (1 << 3)
Christopher Ferris106b3a82016-08-24 12:15:38 -070068/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080069 __u32 num_regions;
Tao Baod7db5942015-01-28 10:07:51 -080070 __u32 num_irqs;
Ben Cheng655a7c02013-10-16 16:09:24 -070071};
72#define VFIO_DEVICE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 7)
Christopher Ferris106b3a82016-08-24 12:15:38 -070073/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070074struct vfio_region_info {
Tao Baod7db5942015-01-28 10:07:51 -080075 __u32 argsz;
76 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070077#define VFIO_REGION_INFO_FLAG_READ (1 << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -070078/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070079#define VFIO_REGION_INFO_FLAG_WRITE (1 << 1)
Christopher Ferris38062f92014-07-09 15:33:25 -070080#define VFIO_REGION_INFO_FLAG_MMAP (1 << 2)
Christopher Ferris106b3a82016-08-24 12:15:38 -070081#define VFIO_REGION_INFO_FLAG_CAPS (1 << 3)
Tao Baod7db5942015-01-28 10:07:51 -080082 __u32 index;
Christopher Ferris106b3a82016-08-24 12:15:38 -070083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84 __u32 cap_offset;
Tao Baod7db5942015-01-28 10:07:51 -080085 __u64 size;
Tao Baod7db5942015-01-28 10:07:51 -080086 __u64 offset;
Ben Cheng655a7c02013-10-16 16:09:24 -070087};
Christopher Ferris05d08e92016-02-04 13:16:38 -080088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070089#define VFIO_DEVICE_GET_REGION_INFO _IO(VFIO_TYPE, VFIO_BASE + 8)
90#define VFIO_REGION_INFO_CAP_SPARSE_MMAP 1
91struct vfio_region_sparse_mmap_area {
92 __u64 offset;
93/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94 __u64 size;
95};
96struct vfio_region_info_cap_sparse_mmap {
97 struct vfio_info_cap_header header;
98/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99 __u32 nr_areas;
100 __u32 reserved;
101 struct vfio_region_sparse_mmap_area areas[];
102};
103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104#define VFIO_REGION_INFO_CAP_TYPE 2
105struct vfio_region_info_cap_type {
106 struct vfio_info_cap_header header;
107 __u32 type;
108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109 __u32 subtype;
110};
111#define VFIO_REGION_TYPE_PCI_VENDOR_TYPE (1 << 31)
112#define VFIO_REGION_TYPE_PCI_VENDOR_MASK (0xffff)
113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114#define VFIO_REGION_SUBTYPE_INTEL_IGD_OPREGION (1)
115#define VFIO_REGION_SUBTYPE_INTEL_IGD_HOST_CFG (2)
116#define VFIO_REGION_SUBTYPE_INTEL_IGD_LPC_CFG (3)
117struct vfio_irq_info {
118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119 __u32 argsz;
Tao Baod7db5942015-01-28 10:07:51 -0800120 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700121#define VFIO_IRQ_INFO_EVENTFD (1 << 0)
122#define VFIO_IRQ_INFO_MASKABLE (1 << 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700124#define VFIO_IRQ_INFO_AUTOMASKED (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700125#define VFIO_IRQ_INFO_NORESIZE (1 << 3)
Tao Baod7db5942015-01-28 10:07:51 -0800126 __u32 index;
127 __u32 count;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700129};
Ben Cheng655a7c02013-10-16 16:09:24 -0700130#define VFIO_DEVICE_GET_IRQ_INFO _IO(VFIO_TYPE, VFIO_BASE + 9)
131struct vfio_irq_set {
Tao Baod7db5942015-01-28 10:07:51 -0800132 __u32 argsz;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700134 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700135#define VFIO_IRQ_SET_DATA_NONE (1 << 0)
136#define VFIO_IRQ_SET_DATA_BOOL (1 << 1)
137#define VFIO_IRQ_SET_DATA_EVENTFD (1 << 2)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700139#define VFIO_IRQ_SET_ACTION_MASK (1 << 3)
Ben Cheng655a7c02013-10-16 16:09:24 -0700140#define VFIO_IRQ_SET_ACTION_UNMASK (1 << 4)
141#define VFIO_IRQ_SET_ACTION_TRIGGER (1 << 5)
Tao Baod7db5942015-01-28 10:07:51 -0800142 __u32 index;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700144 __u32 start;
Tao Baod7db5942015-01-28 10:07:51 -0800145 __u32 count;
146 __u8 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700147};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700149#define VFIO_DEVICE_SET_IRQS _IO(VFIO_TYPE, VFIO_BASE + 10)
Tao Baod7db5942015-01-28 10:07:51 -0800150#define VFIO_IRQ_SET_DATA_TYPE_MASK (VFIO_IRQ_SET_DATA_NONE | VFIO_IRQ_SET_DATA_BOOL | VFIO_IRQ_SET_DATA_EVENTFD)
151#define VFIO_IRQ_SET_ACTION_TYPE_MASK (VFIO_IRQ_SET_ACTION_MASK | VFIO_IRQ_SET_ACTION_UNMASK | VFIO_IRQ_SET_ACTION_TRIGGER)
Ben Cheng655a7c02013-10-16 16:09:24 -0700152#define VFIO_DEVICE_RESET _IO(VFIO_TYPE, VFIO_BASE + 11)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700154enum {
Tao Baod7db5942015-01-28 10:07:51 -0800155 VFIO_PCI_BAR0_REGION_INDEX,
156 VFIO_PCI_BAR1_REGION_INDEX,
157 VFIO_PCI_BAR2_REGION_INDEX,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700159 VFIO_PCI_BAR3_REGION_INDEX,
Tao Baod7db5942015-01-28 10:07:51 -0800160 VFIO_PCI_BAR4_REGION_INDEX,
161 VFIO_PCI_BAR5_REGION_INDEX,
162 VFIO_PCI_ROM_REGION_INDEX,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800164 VFIO_PCI_CONFIG_REGION_INDEX,
165 VFIO_PCI_VGA_REGION_INDEX,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700166 VFIO_PCI_NUM_REGIONS = 9
Ben Cheng655a7c02013-10-16 16:09:24 -0700167};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700169enum {
Tao Baod7db5942015-01-28 10:07:51 -0800170 VFIO_PCI_INTX_IRQ_INDEX,
171 VFIO_PCI_MSI_IRQ_INDEX,
172 VFIO_PCI_MSIX_IRQ_INDEX,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700174 VFIO_PCI_ERR_IRQ_INDEX,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800175 VFIO_PCI_REQ_IRQ_INDEX,
Tao Baod7db5942015-01-28 10:07:51 -0800176 VFIO_PCI_NUM_IRQS
Ben Cheng655a7c02013-10-16 16:09:24 -0700177};
Christopher Ferris82d75042015-01-26 10:57:07 -0800178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700179struct vfio_pci_dependent_device {
Tao Baod7db5942015-01-28 10:07:51 -0800180 __u32 group_id;
181 __u16 segment;
182 __u8 bus;
Christopher Ferris82d75042015-01-26 10:57:07 -0800183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700184 __u8 devfn;
Christopher Ferris38062f92014-07-09 15:33:25 -0700185};
186struct vfio_pci_hot_reset_info {
Tao Baod7db5942015-01-28 10:07:51 -0800187 __u32 argsz;
Christopher Ferris82d75042015-01-26 10:57:07 -0800188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700189 __u32 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800190 __u32 count;
191 struct vfio_pci_dependent_device devices[];
Christopher Ferris38062f92014-07-09 15:33:25 -0700192};
Christopher Ferris82d75042015-01-26 10:57:07 -0800193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700194#define VFIO_DEVICE_GET_PCI_HOT_RESET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
Christopher Ferris38062f92014-07-09 15:33:25 -0700195struct vfio_pci_hot_reset {
Tao Baod7db5942015-01-28 10:07:51 -0800196 __u32 argsz;
197 __u32 flags;
Christopher Ferris82d75042015-01-26 10:57:07 -0800198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700199 __u32 count;
Tao Baod7db5942015-01-28 10:07:51 -0800200 __s32 group_fds[];
Christopher Ferris38062f92014-07-09 15:33:25 -0700201};
202#define VFIO_DEVICE_PCI_HOT_RESET _IO(VFIO_TYPE, VFIO_BASE + 13)
Christopher Ferris82d75042015-01-26 10:57:07 -0800203/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700204struct vfio_iommu_type1_info {
Tao Baod7db5942015-01-28 10:07:51 -0800205 __u32 argsz;
206 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700207#define VFIO_IOMMU_INFO_PGSIZES (1 << 0)
Christopher Ferris82d75042015-01-26 10:57:07 -0800208/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700209 __u64 iova_pgsizes;
Christopher Ferris38062f92014-07-09 15:33:25 -0700210};
Ben Cheng655a7c02013-10-16 16:09:24 -0700211#define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
212struct vfio_iommu_type1_dma_map {
Christopher Ferris82d75042015-01-26 10:57:07 -0800213/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700214 __u32 argsz;
Tao Baod7db5942015-01-28 10:07:51 -0800215 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700216#define VFIO_DMA_MAP_FLAG_READ (1 << 0)
217#define VFIO_DMA_MAP_FLAG_WRITE (1 << 1)
Christopher Ferris82d75042015-01-26 10:57:07 -0800218/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700219 __u64 vaddr;
Tao Baod7db5942015-01-28 10:07:51 -0800220 __u64 iova;
221 __u64 size;
Ben Cheng655a7c02013-10-16 16:09:24 -0700222};
Christopher Ferris82d75042015-01-26 10:57:07 -0800223/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700224#define VFIO_IOMMU_MAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 13)
Christopher Ferris38062f92014-07-09 15:33:25 -0700225struct vfio_iommu_type1_dma_unmap {
Tao Baod7db5942015-01-28 10:07:51 -0800226 __u32 argsz;
227 __u32 flags;
Christopher Ferris82d75042015-01-26 10:57:07 -0800228/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700229 __u64 iova;
Tao Baod7db5942015-01-28 10:07:51 -0800230 __u64 size;
Ben Cheng655a7c02013-10-16 16:09:24 -0700231};
232#define VFIO_IOMMU_UNMAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 14)
Christopher Ferris82d75042015-01-26 10:57:07 -0800233/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700234#define VFIO_IOMMU_ENABLE _IO(VFIO_TYPE, VFIO_BASE + 15)
Christopher Ferris38062f92014-07-09 15:33:25 -0700235#define VFIO_IOMMU_DISABLE _IO(VFIO_TYPE, VFIO_BASE + 16)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800236struct vfio_iommu_spapr_tce_ddw_info {
237 __u64 pgsizes;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800238/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700239 __u32 max_dynamic_windows_supported;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800240 __u32 levels;
241};
Christopher Ferris38062f92014-07-09 15:33:25 -0700242struct vfio_iommu_spapr_tce_info {
Christopher Ferris82d75042015-01-26 10:57:07 -0800243/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700244 __u32 argsz;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800245 __u32 flags;
246#define VFIO_IOMMU_SPAPR_INFO_DDW (1 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800247 __u32 dma32_window_start;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800248/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700249 __u32 dma32_window_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800250 struct vfio_iommu_spapr_tce_ddw_info ddw;
Christopher Ferris38062f92014-07-09 15:33:25 -0700251};
252#define VFIO_IOMMU_SPAPR_TCE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
Christopher Ferris82d75042015-01-26 10:57:07 -0800253/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700254struct vfio_eeh_pe_err {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800255 __u32 type;
256 __u32 func;
257 __u64 addr;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800258/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700259 __u64 mask;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800260};
Christopher Ferris82d75042015-01-26 10:57:07 -0800261struct vfio_eeh_pe_op {
Tao Baod7db5942015-01-28 10:07:51 -0800262 __u32 argsz;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800263/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700264 __u32 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800265 __u32 op;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800266 union {
267 struct vfio_eeh_pe_err err;
Christopher Ferris82d75042015-01-26 10:57:07 -0800268/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700269 };
Christopher Ferris82d75042015-01-26 10:57:07 -0800270};
271#define VFIO_EEH_PE_DISABLE 0
272#define VFIO_EEH_PE_ENABLE 1
Christopher Ferris82d75042015-01-26 10:57:07 -0800273/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700274#define VFIO_EEH_PE_UNFREEZE_IO 2
Christopher Ferris82d75042015-01-26 10:57:07 -0800275#define VFIO_EEH_PE_UNFREEZE_DMA 3
276#define VFIO_EEH_PE_GET_STATE 4
277#define VFIO_EEH_PE_STATE_NORMAL 0
Christopher Ferris82d75042015-01-26 10:57:07 -0800278/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700279#define VFIO_EEH_PE_STATE_RESET 1
Christopher Ferris82d75042015-01-26 10:57:07 -0800280#define VFIO_EEH_PE_STATE_STOPPED 2
281#define VFIO_EEH_PE_STATE_STOPPED_DMA 4
282#define VFIO_EEH_PE_STATE_UNAVAIL 5
Christopher Ferris82d75042015-01-26 10:57:07 -0800283/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700284#define VFIO_EEH_PE_RESET_DEACTIVATE 5
Christopher Ferris82d75042015-01-26 10:57:07 -0800285#define VFIO_EEH_PE_RESET_HOT 6
286#define VFIO_EEH_PE_RESET_FUNDAMENTAL 7
287#define VFIO_EEH_PE_CONFIGURE 8
Christopher Ferris05d08e92016-02-04 13:16:38 -0800288/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700289#define VFIO_EEH_PE_INJECT_ERR 9
Christopher Ferris82d75042015-01-26 10:57:07 -0800290#define VFIO_EEH_PE_OP _IO(VFIO_TYPE, VFIO_BASE + 21)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800291struct vfio_iommu_spapr_register_memory {
292 __u32 argsz;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800293/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700294 __u32 flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800295 __u64 vaddr;
296 __u64 size;
297};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800298/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700299#define VFIO_IOMMU_SPAPR_REGISTER_MEMORY _IO(VFIO_TYPE, VFIO_BASE + 17)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800300#define VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY _IO(VFIO_TYPE, VFIO_BASE + 18)
301struct vfio_iommu_spapr_tce_create {
302 __u32 argsz;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700303/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800304 __u32 flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800305 __u32 page_shift;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700306 __u32 __resv1;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800307 __u64 window_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800308/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700309 __u32 levels;
310 __u32 __resv2;
311 __u64 start_addr;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800312};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700313/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800314#define VFIO_IOMMU_SPAPR_TCE_CREATE _IO(VFIO_TYPE, VFIO_BASE + 19)
315struct vfio_iommu_spapr_tce_remove {
316 __u32 argsz;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800317 __u32 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700318/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800319 __u64 start_addr;
320};
321#define VFIO_IOMMU_SPAPR_TCE_REMOVE _IO(VFIO_TYPE, VFIO_BASE + 20)
Ben Cheng655a7c02013-10-16 16:09:24 -0700322#endif
Christopher Ferris106b3a82016-08-24 12:15:38 -0700323/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */