blob: b947abce24423b5718b0ff8c07588271767f99e0 [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>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define VFIO_API_VERSION 0
24#define VFIO_TYPE1_IOMMU 1
Christopher Ferris38062f92014-07-09 15:33:25 -070025#define VFIO_SPAPR_TCE_IOMMU 2
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070026#define VFIO_TYPE1v2_IOMMU 3
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070027#define VFIO_DMA_CC_IOMMU 4
Christopher Ferris82d75042015-01-26 10:57:07 -080028#define VFIO_EEH 5
29#define VFIO_TYPE1_NESTING_IOMMU 6
Christopher Ferris05d08e92016-02-04 13:16:38 -080030#define VFIO_SPAPR_TCE_v2_IOMMU 7
Christopher Ferris106b3a82016-08-24 12:15:38 -070031#define VFIO_NOIOMMU_IOMMU 8
Christopher Ferris05d08e92016-02-04 13:16:38 -080032#define VFIO_TYPE (';')
Christopher Ferris38062f92014-07-09 15:33:25 -070033#define VFIO_BASE 100
Christopher Ferris106b3a82016-08-24 12:15:38 -070034struct vfio_info_cap_header {
Christopher Ferris106b3a82016-08-24 12:15:38 -070035 __u16 id;
36 __u16 version;
37 __u32 next;
38};
Ben Cheng655a7c02013-10-16 16:09:24 -070039#define VFIO_GET_API_VERSION _IO(VFIO_TYPE, VFIO_BASE + 0)
40#define VFIO_CHECK_EXTENSION _IO(VFIO_TYPE, VFIO_BASE + 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -080041#define VFIO_SET_IOMMU _IO(VFIO_TYPE, VFIO_BASE + 2)
Christopher Ferris38062f92014-07-09 15:33:25 -070042struct vfio_group_status {
Tao Baod7db5942015-01-28 10:07:51 -080043 __u32 argsz;
44 __u32 flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -080045#define VFIO_GROUP_FLAGS_VIABLE (1 << 0)
Christopher Ferris38062f92014-07-09 15:33:25 -070046#define VFIO_GROUP_FLAGS_CONTAINER_SET (1 << 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070047};
48#define VFIO_GROUP_GET_STATUS _IO(VFIO_TYPE, VFIO_BASE + 3)
Christopher Ferris05d08e92016-02-04 13:16:38 -080049#define VFIO_GROUP_SET_CONTAINER _IO(VFIO_TYPE, VFIO_BASE + 4)
Christopher Ferris38062f92014-07-09 15:33:25 -070050#define VFIO_GROUP_UNSET_CONTAINER _IO(VFIO_TYPE, VFIO_BASE + 5)
Ben Cheng655a7c02013-10-16 16:09:24 -070051#define VFIO_GROUP_GET_DEVICE_FD _IO(VFIO_TYPE, VFIO_BASE + 6)
52struct vfio_device_info {
Christopher Ferris05d08e92016-02-04 13:16:38 -080053 __u32 argsz;
Tao Baod7db5942015-01-28 10:07:51 -080054 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070055#define VFIO_DEVICE_FLAGS_RESET (1 << 0)
56#define VFIO_DEVICE_FLAGS_PCI (1 << 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -080057#define VFIO_DEVICE_FLAGS_PLATFORM (1 << 2)
58#define VFIO_DEVICE_FLAGS_AMBA (1 << 3)
Christopher Ferris525ce912017-07-26 13:12:53 -070059#define VFIO_DEVICE_FLAGS_CCW (1 << 4)
Christopher Ferris86a48372019-01-10 14:14:59 -080060#define VFIO_DEVICE_FLAGS_AP (1 << 5)
Christopher Ferris05d08e92016-02-04 13:16:38 -080061 __u32 num_regions;
Tao Baod7db5942015-01-28 10:07:51 -080062 __u32 num_irqs;
Ben Cheng655a7c02013-10-16 16:09:24 -070063};
64#define VFIO_DEVICE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 7)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080065#define VFIO_DEVICE_API_PCI_STRING "vfio-pci"
66#define VFIO_DEVICE_API_PLATFORM_STRING "vfio-platform"
67#define VFIO_DEVICE_API_AMBA_STRING "vfio-amba"
Christopher Ferris525ce912017-07-26 13:12:53 -070068#define VFIO_DEVICE_API_CCW_STRING "vfio-ccw"
Christopher Ferris86a48372019-01-10 14:14:59 -080069#define VFIO_DEVICE_API_AP_STRING "vfio-ap"
Ben Cheng655a7c02013-10-16 16:09:24 -070070struct vfio_region_info {
Tao Baod7db5942015-01-28 10:07:51 -080071 __u32 argsz;
72 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070073#define VFIO_REGION_INFO_FLAG_READ (1 << 0)
74#define VFIO_REGION_INFO_FLAG_WRITE (1 << 1)
Christopher Ferris38062f92014-07-09 15:33:25 -070075#define VFIO_REGION_INFO_FLAG_MMAP (1 << 2)
Christopher Ferris106b3a82016-08-24 12:15:38 -070076#define VFIO_REGION_INFO_FLAG_CAPS (1 << 3)
Tao Baod7db5942015-01-28 10:07:51 -080077 __u32 index;
Christopher Ferris106b3a82016-08-24 12:15:38 -070078 __u32 cap_offset;
Tao Baod7db5942015-01-28 10:07:51 -080079 __u64 size;
Tao Baod7db5942015-01-28 10:07:51 -080080 __u64 offset;
Ben Cheng655a7c02013-10-16 16:09:24 -070081};
Christopher Ferris106b3a82016-08-24 12:15:38 -070082#define VFIO_DEVICE_GET_REGION_INFO _IO(VFIO_TYPE, VFIO_BASE + 8)
83#define VFIO_REGION_INFO_CAP_SPARSE_MMAP 1
84struct vfio_region_sparse_mmap_area {
85 __u64 offset;
Christopher Ferris106b3a82016-08-24 12:15:38 -070086 __u64 size;
87};
88struct vfio_region_info_cap_sparse_mmap {
89 struct vfio_info_cap_header header;
Christopher Ferris106b3a82016-08-24 12:15:38 -070090 __u32 nr_areas;
91 __u32 reserved;
92 struct vfio_region_sparse_mmap_area areas[];
93};
Christopher Ferris106b3a82016-08-24 12:15:38 -070094#define VFIO_REGION_INFO_CAP_TYPE 2
95struct vfio_region_info_cap_type {
96 struct vfio_info_cap_header header;
97 __u32 type;
Christopher Ferris106b3a82016-08-24 12:15:38 -070098 __u32 subtype;
99};
100#define VFIO_REGION_TYPE_PCI_VENDOR_TYPE (1 << 31)
101#define VFIO_REGION_TYPE_PCI_VENDOR_MASK (0xffff)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700102#define VFIO_REGION_SUBTYPE_INTEL_IGD_OPREGION (1)
103#define VFIO_REGION_SUBTYPE_INTEL_IGD_HOST_CFG (2)
104#define VFIO_REGION_SUBTYPE_INTEL_IGD_LPC_CFG (3)
Christopher Ferris86a48372019-01-10 14:14:59 -0800105#define VFIO_REGION_TYPE_GFX (1)
106#define VFIO_REGION_SUBTYPE_GFX_EDID (1)
107struct vfio_region_gfx_edid {
108 __u32 edid_offset;
109 __u32 edid_max_size;
110 __u32 edid_size;
111 __u32 max_xres;
112 __u32 max_yres;
113 __u32 link_state;
114#define VFIO_DEVICE_GFX_LINK_STATE_UP 1
115#define VFIO_DEVICE_GFX_LINK_STATE_DOWN 2
116};
Christopher Ferrisd842e432019-03-07 10:21:59 -0800117#define VFIO_REGION_SUBTYPE_NVIDIA_NVLINK2_RAM (1)
118#define VFIO_REGION_SUBTYPE_IBM_NVLINK2_ATSD (1)
Christopher Ferris76a1d452018-06-27 14:12:29 -0700119#define VFIO_REGION_INFO_CAP_MSIX_MAPPABLE 3
Christopher Ferrisd842e432019-03-07 10:21:59 -0800120#define VFIO_REGION_INFO_CAP_NVLINK2_SSATGT 4
121struct vfio_region_info_cap_nvlink2_ssatgt {
122 struct vfio_info_cap_header header;
123 __u64 tgt;
124};
125#define VFIO_REGION_INFO_CAP_NVLINK2_LNKSPD 5
126struct vfio_region_info_cap_nvlink2_lnkspd {
127 struct vfio_info_cap_header header;
128 __u32 link_speed;
129 __u32 __pad;
130};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700131struct vfio_irq_info {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700132 __u32 argsz;
Tao Baod7db5942015-01-28 10:07:51 -0800133 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700134#define VFIO_IRQ_INFO_EVENTFD (1 << 0)
135#define VFIO_IRQ_INFO_MASKABLE (1 << 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700136#define VFIO_IRQ_INFO_AUTOMASKED (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700137#define VFIO_IRQ_INFO_NORESIZE (1 << 3)
Tao Baod7db5942015-01-28 10:07:51 -0800138 __u32 index;
139 __u32 count;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700140};
Ben Cheng655a7c02013-10-16 16:09:24 -0700141#define VFIO_DEVICE_GET_IRQ_INFO _IO(VFIO_TYPE, VFIO_BASE + 9)
142struct vfio_irq_set {
Tao Baod7db5942015-01-28 10:07:51 -0800143 __u32 argsz;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700144 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700145#define VFIO_IRQ_SET_DATA_NONE (1 << 0)
146#define VFIO_IRQ_SET_DATA_BOOL (1 << 1)
147#define VFIO_IRQ_SET_DATA_EVENTFD (1 << 2)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700148#define VFIO_IRQ_SET_ACTION_MASK (1 << 3)
Ben Cheng655a7c02013-10-16 16:09:24 -0700149#define VFIO_IRQ_SET_ACTION_UNMASK (1 << 4)
150#define VFIO_IRQ_SET_ACTION_TRIGGER (1 << 5)
Tao Baod7db5942015-01-28 10:07:51 -0800151 __u32 index;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700152 __u32 start;
Tao Baod7db5942015-01-28 10:07:51 -0800153 __u32 count;
154 __u8 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700155};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700156#define VFIO_DEVICE_SET_IRQS _IO(VFIO_TYPE, VFIO_BASE + 10)
Tao Baod7db5942015-01-28 10:07:51 -0800157#define VFIO_IRQ_SET_DATA_TYPE_MASK (VFIO_IRQ_SET_DATA_NONE | VFIO_IRQ_SET_DATA_BOOL | VFIO_IRQ_SET_DATA_EVENTFD)
158#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 -0700159#define VFIO_DEVICE_RESET _IO(VFIO_TYPE, VFIO_BASE + 11)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700160enum {
Tao Baod7db5942015-01-28 10:07:51 -0800161 VFIO_PCI_BAR0_REGION_INDEX,
162 VFIO_PCI_BAR1_REGION_INDEX,
163 VFIO_PCI_BAR2_REGION_INDEX,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700164 VFIO_PCI_BAR3_REGION_INDEX,
Tao Baod7db5942015-01-28 10:07:51 -0800165 VFIO_PCI_BAR4_REGION_INDEX,
166 VFIO_PCI_BAR5_REGION_INDEX,
167 VFIO_PCI_ROM_REGION_INDEX,
Tao Baod7db5942015-01-28 10:07:51 -0800168 VFIO_PCI_CONFIG_REGION_INDEX,
169 VFIO_PCI_VGA_REGION_INDEX,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700170 VFIO_PCI_NUM_REGIONS = 9
Ben Cheng655a7c02013-10-16 16:09:24 -0700171};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700172enum {
Tao Baod7db5942015-01-28 10:07:51 -0800173 VFIO_PCI_INTX_IRQ_INDEX,
174 VFIO_PCI_MSI_IRQ_INDEX,
175 VFIO_PCI_MSIX_IRQ_INDEX,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700176 VFIO_PCI_ERR_IRQ_INDEX,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800177 VFIO_PCI_REQ_IRQ_INDEX,
Tao Baod7db5942015-01-28 10:07:51 -0800178 VFIO_PCI_NUM_IRQS
Ben Cheng655a7c02013-10-16 16:09:24 -0700179};
Christopher Ferris525ce912017-07-26 13:12:53 -0700180enum {
181 VFIO_CCW_CONFIG_REGION_INDEX,
182 VFIO_CCW_NUM_REGIONS
183};
184enum {
185 VFIO_CCW_IO_IRQ_INDEX,
186 VFIO_CCW_NUM_IRQS
187};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700188struct vfio_pci_dependent_device {
Tao Baod7db5942015-01-28 10:07:51 -0800189 __u32 group_id;
190 __u16 segment;
191 __u8 bus;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700192 __u8 devfn;
Christopher Ferris38062f92014-07-09 15:33:25 -0700193};
194struct vfio_pci_hot_reset_info {
Tao Baod7db5942015-01-28 10:07:51 -0800195 __u32 argsz;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700196 __u32 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800197 __u32 count;
198 struct vfio_pci_dependent_device devices[];
Christopher Ferris38062f92014-07-09 15:33:25 -0700199};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700200#define VFIO_DEVICE_GET_PCI_HOT_RESET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
Christopher Ferris38062f92014-07-09 15:33:25 -0700201struct vfio_pci_hot_reset {
Tao Baod7db5942015-01-28 10:07:51 -0800202 __u32 argsz;
203 __u32 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700204 __u32 count;
Tao Baod7db5942015-01-28 10:07:51 -0800205 __s32 group_fds[];
Christopher Ferris38062f92014-07-09 15:33:25 -0700206};
207#define VFIO_DEVICE_PCI_HOT_RESET _IO(VFIO_TYPE, VFIO_BASE + 13)
Christopher Ferris76a1d452018-06-27 14:12:29 -0700208struct vfio_device_gfx_plane_info {
209 __u32 argsz;
210 __u32 flags;
211#define VFIO_GFX_PLANE_TYPE_PROBE (1 << 0)
212#define VFIO_GFX_PLANE_TYPE_DMABUF (1 << 1)
213#define VFIO_GFX_PLANE_TYPE_REGION (1 << 2)
214 __u32 drm_plane_type;
215 __u32 drm_format;
216 __u64 drm_format_mod;
217 __u32 width;
218 __u32 height;
219 __u32 stride;
220 __u32 size;
221 __u32 x_pos;
222 __u32 y_pos;
223 __u32 x_hot;
224 __u32 y_hot;
225 union {
226 __u32 region_index;
227 __u32 dmabuf_id;
228 };
229};
230#define VFIO_DEVICE_QUERY_GFX_PLANE _IO(VFIO_TYPE, VFIO_BASE + 14)
231#define VFIO_DEVICE_GET_GFX_DMABUF _IO(VFIO_TYPE, VFIO_BASE + 15)
232struct vfio_device_ioeventfd {
233 __u32 argsz;
234 __u32 flags;
235#define VFIO_DEVICE_IOEVENTFD_8 (1 << 0)
236#define VFIO_DEVICE_IOEVENTFD_16 (1 << 1)
237#define VFIO_DEVICE_IOEVENTFD_32 (1 << 2)
238#define VFIO_DEVICE_IOEVENTFD_64 (1 << 3)
239#define VFIO_DEVICE_IOEVENTFD_SIZE_MASK (0xf)
240 __u64 offset;
241 __u64 data;
242 __s32 fd;
243};
244#define VFIO_DEVICE_IOEVENTFD _IO(VFIO_TYPE, VFIO_BASE + 16)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700245struct vfio_iommu_type1_info {
Tao Baod7db5942015-01-28 10:07:51 -0800246 __u32 argsz;
247 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700248#define VFIO_IOMMU_INFO_PGSIZES (1 << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700249 __u64 iova_pgsizes;
Christopher Ferris38062f92014-07-09 15:33:25 -0700250};
Ben Cheng655a7c02013-10-16 16:09:24 -0700251#define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
252struct vfio_iommu_type1_dma_map {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700253 __u32 argsz;
Tao Baod7db5942015-01-28 10:07:51 -0800254 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700255#define VFIO_DMA_MAP_FLAG_READ (1 << 0)
256#define VFIO_DMA_MAP_FLAG_WRITE (1 << 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700257 __u64 vaddr;
Tao Baod7db5942015-01-28 10:07:51 -0800258 __u64 iova;
259 __u64 size;
Ben Cheng655a7c02013-10-16 16:09:24 -0700260};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700261#define VFIO_IOMMU_MAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 13)
Christopher Ferris38062f92014-07-09 15:33:25 -0700262struct vfio_iommu_type1_dma_unmap {
Tao Baod7db5942015-01-28 10:07:51 -0800263 __u32 argsz;
264 __u32 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700265 __u64 iova;
Tao Baod7db5942015-01-28 10:07:51 -0800266 __u64 size;
Ben Cheng655a7c02013-10-16 16:09:24 -0700267};
268#define VFIO_IOMMU_UNMAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 14)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700269#define VFIO_IOMMU_ENABLE _IO(VFIO_TYPE, VFIO_BASE + 15)
Christopher Ferris38062f92014-07-09 15:33:25 -0700270#define VFIO_IOMMU_DISABLE _IO(VFIO_TYPE, VFIO_BASE + 16)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800271struct vfio_iommu_spapr_tce_ddw_info {
272 __u64 pgsizes;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700273 __u32 max_dynamic_windows_supported;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800274 __u32 levels;
275};
Christopher Ferris38062f92014-07-09 15:33:25 -0700276struct vfio_iommu_spapr_tce_info {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700277 __u32 argsz;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800278 __u32 flags;
279#define VFIO_IOMMU_SPAPR_INFO_DDW (1 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800280 __u32 dma32_window_start;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700281 __u32 dma32_window_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800282 struct vfio_iommu_spapr_tce_ddw_info ddw;
Christopher Ferris38062f92014-07-09 15:33:25 -0700283};
284#define VFIO_IOMMU_SPAPR_TCE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700285struct vfio_eeh_pe_err {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800286 __u32 type;
287 __u32 func;
288 __u64 addr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700289 __u64 mask;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800290};
Christopher Ferris82d75042015-01-26 10:57:07 -0800291struct vfio_eeh_pe_op {
Tao Baod7db5942015-01-28 10:07:51 -0800292 __u32 argsz;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700293 __u32 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800294 __u32 op;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800295 union {
296 struct vfio_eeh_pe_err err;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700297 };
Christopher Ferris82d75042015-01-26 10:57:07 -0800298};
299#define VFIO_EEH_PE_DISABLE 0
300#define VFIO_EEH_PE_ENABLE 1
Christopher Ferris106b3a82016-08-24 12:15:38 -0700301#define VFIO_EEH_PE_UNFREEZE_IO 2
Christopher Ferris82d75042015-01-26 10:57:07 -0800302#define VFIO_EEH_PE_UNFREEZE_DMA 3
303#define VFIO_EEH_PE_GET_STATE 4
304#define VFIO_EEH_PE_STATE_NORMAL 0
Christopher Ferris106b3a82016-08-24 12:15:38 -0700305#define VFIO_EEH_PE_STATE_RESET 1
Christopher Ferris82d75042015-01-26 10:57:07 -0800306#define VFIO_EEH_PE_STATE_STOPPED 2
307#define VFIO_EEH_PE_STATE_STOPPED_DMA 4
308#define VFIO_EEH_PE_STATE_UNAVAIL 5
Christopher Ferris106b3a82016-08-24 12:15:38 -0700309#define VFIO_EEH_PE_RESET_DEACTIVATE 5
Christopher Ferris82d75042015-01-26 10:57:07 -0800310#define VFIO_EEH_PE_RESET_HOT 6
311#define VFIO_EEH_PE_RESET_FUNDAMENTAL 7
312#define VFIO_EEH_PE_CONFIGURE 8
Christopher Ferris106b3a82016-08-24 12:15:38 -0700313#define VFIO_EEH_PE_INJECT_ERR 9
Christopher Ferris82d75042015-01-26 10:57:07 -0800314#define VFIO_EEH_PE_OP _IO(VFIO_TYPE, VFIO_BASE + 21)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800315struct vfio_iommu_spapr_register_memory {
316 __u32 argsz;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700317 __u32 flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800318 __u64 vaddr;
319 __u64 size;
320};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700321#define VFIO_IOMMU_SPAPR_REGISTER_MEMORY _IO(VFIO_TYPE, VFIO_BASE + 17)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800322#define VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY _IO(VFIO_TYPE, VFIO_BASE + 18)
323struct vfio_iommu_spapr_tce_create {
324 __u32 argsz;
325 __u32 flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800326 __u32 page_shift;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700327 __u32 __resv1;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800328 __u64 window_size;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700329 __u32 levels;
330 __u32 __resv2;
331 __u64 start_addr;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800332};
333#define VFIO_IOMMU_SPAPR_TCE_CREATE _IO(VFIO_TYPE, VFIO_BASE + 19)
334struct vfio_iommu_spapr_tce_remove {
335 __u32 argsz;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800336 __u32 flags;
337 __u64 start_addr;
338};
339#define VFIO_IOMMU_SPAPR_TCE_REMOVE _IO(VFIO_TYPE, VFIO_BASE + 20)
Ben Cheng655a7c02013-10-16 16:09:24 -0700340#endif