blob: 44c29c45f04d6fff9b94208c9d91c95055ed53c6 [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 */
Christopher Ferris48af7cb2017-02-21 12:35:09 -080074#define VFIO_DEVICE_API_PCI_STRING "vfio-pci"
75#define VFIO_DEVICE_API_PLATFORM_STRING "vfio-platform"
76#define VFIO_DEVICE_API_AMBA_STRING "vfio-amba"
Ben Cheng655a7c02013-10-16 16:09:24 -070077struct vfio_region_info {
Christopher Ferris48af7cb2017-02-21 12:35:09 -080078/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080079 __u32 argsz;
80 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070081#define VFIO_REGION_INFO_FLAG_READ (1 << 0)
82#define VFIO_REGION_INFO_FLAG_WRITE (1 << 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -070084#define VFIO_REGION_INFO_FLAG_MMAP (1 << 2)
Christopher Ferris106b3a82016-08-24 12:15:38 -070085#define VFIO_REGION_INFO_FLAG_CAPS (1 << 3)
Tao Baod7db5942015-01-28 10:07:51 -080086 __u32 index;
Christopher Ferris106b3a82016-08-24 12:15:38 -070087 __u32 cap_offset;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080089 __u64 size;
Tao Baod7db5942015-01-28 10:07:51 -080090 __u64 offset;
Ben Cheng655a7c02013-10-16 16:09:24 -070091};
Christopher Ferris106b3a82016-08-24 12:15:38 -070092#define VFIO_DEVICE_GET_REGION_INFO _IO(VFIO_TYPE, VFIO_BASE + 8)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070094#define VFIO_REGION_INFO_CAP_SPARSE_MMAP 1
95struct vfio_region_sparse_mmap_area {
96 __u64 offset;
Christopher Ferris106b3a82016-08-24 12:15:38 -070097 __u64 size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070099};
100struct vfio_region_info_cap_sparse_mmap {
101 struct vfio_info_cap_header header;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700102 __u32 nr_areas;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700104 __u32 reserved;
105 struct vfio_region_sparse_mmap_area areas[];
106};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700107#define VFIO_REGION_INFO_CAP_TYPE 2
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700109struct vfio_region_info_cap_type {
110 struct vfio_info_cap_header header;
111 __u32 type;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700112 __u32 subtype;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700114};
115#define VFIO_REGION_TYPE_PCI_VENDOR_TYPE (1 << 31)
116#define VFIO_REGION_TYPE_PCI_VENDOR_MASK (0xffff)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700117#define VFIO_REGION_SUBTYPE_INTEL_IGD_OPREGION (1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700119#define VFIO_REGION_SUBTYPE_INTEL_IGD_HOST_CFG (2)
120#define VFIO_REGION_SUBTYPE_INTEL_IGD_LPC_CFG (3)
121struct vfio_irq_info {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700122 __u32 argsz;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800124 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700125#define VFIO_IRQ_INFO_EVENTFD (1 << 0)
126#define VFIO_IRQ_INFO_MASKABLE (1 << 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700127#define VFIO_IRQ_INFO_AUTOMASKED (1 << 2)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700129#define VFIO_IRQ_INFO_NORESIZE (1 << 3)
Tao Baod7db5942015-01-28 10:07:51 -0800130 __u32 index;
131 __u32 count;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700132};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700134#define VFIO_DEVICE_GET_IRQ_INFO _IO(VFIO_TYPE, VFIO_BASE + 9)
135struct vfio_irq_set {
Tao Baod7db5942015-01-28 10:07:51 -0800136 __u32 argsz;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700137 __u32 flags;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700139#define VFIO_IRQ_SET_DATA_NONE (1 << 0)
140#define VFIO_IRQ_SET_DATA_BOOL (1 << 1)
141#define VFIO_IRQ_SET_DATA_EVENTFD (1 << 2)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700142#define VFIO_IRQ_SET_ACTION_MASK (1 << 3)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700144#define VFIO_IRQ_SET_ACTION_UNMASK (1 << 4)
145#define VFIO_IRQ_SET_ACTION_TRIGGER (1 << 5)
Tao Baod7db5942015-01-28 10:07:51 -0800146 __u32 index;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700147 __u32 start;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800149 __u32 count;
150 __u8 data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700151};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700152#define VFIO_DEVICE_SET_IRQS _IO(VFIO_TYPE, VFIO_BASE + 10)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800154#define VFIO_IRQ_SET_DATA_TYPE_MASK (VFIO_IRQ_SET_DATA_NONE | VFIO_IRQ_SET_DATA_BOOL | VFIO_IRQ_SET_DATA_EVENTFD)
155#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 -0700156#define VFIO_DEVICE_RESET _IO(VFIO_TYPE, VFIO_BASE + 11)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700157enum {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800159 VFIO_PCI_BAR0_REGION_INDEX,
160 VFIO_PCI_BAR1_REGION_INDEX,
161 VFIO_PCI_BAR2_REGION_INDEX,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700162 VFIO_PCI_BAR3_REGION_INDEX,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800164 VFIO_PCI_BAR4_REGION_INDEX,
165 VFIO_PCI_BAR5_REGION_INDEX,
166 VFIO_PCI_ROM_REGION_INDEX,
Tao Baod7db5942015-01-28 10:07:51 -0800167 VFIO_PCI_CONFIG_REGION_INDEX,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800169 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 {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800174 VFIO_PCI_INTX_IRQ_INDEX,
175 VFIO_PCI_MSI_IRQ_INDEX,
176 VFIO_PCI_MSIX_IRQ_INDEX,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700177 VFIO_PCI_ERR_IRQ_INDEX,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800179 VFIO_PCI_REQ_IRQ_INDEX,
Tao Baod7db5942015-01-28 10:07:51 -0800180 VFIO_PCI_NUM_IRQS
Ben Cheng655a7c02013-10-16 16:09:24 -0700181};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700182struct vfio_pci_dependent_device {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800184 __u32 group_id;
185 __u16 segment;
186 __u8 bus;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700187 __u8 devfn;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700189};
190struct vfio_pci_hot_reset_info {
Tao Baod7db5942015-01-28 10:07:51 -0800191 __u32 argsz;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700192 __u32 flags;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800194 __u32 count;
195 struct vfio_pci_dependent_device devices[];
Christopher Ferris38062f92014-07-09 15:33:25 -0700196};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700197#define VFIO_DEVICE_GET_PCI_HOT_RESET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700199struct vfio_pci_hot_reset {
Tao Baod7db5942015-01-28 10:07:51 -0800200 __u32 argsz;
201 __u32 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700202 __u32 count;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800203/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800204 __s32 group_fds[];
Christopher Ferris38062f92014-07-09 15:33:25 -0700205};
206#define VFIO_DEVICE_PCI_HOT_RESET _IO(VFIO_TYPE, VFIO_BASE + 13)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700207struct vfio_iommu_type1_info {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800208/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800209 __u32 argsz;
210 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700211#define VFIO_IOMMU_INFO_PGSIZES (1 << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700212 __u64 iova_pgsizes;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800213/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700214};
Ben Cheng655a7c02013-10-16 16:09:24 -0700215#define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
216struct vfio_iommu_type1_dma_map {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700217 __u32 argsz;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800218/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800219 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700220#define VFIO_DMA_MAP_FLAG_READ (1 << 0)
221#define VFIO_DMA_MAP_FLAG_WRITE (1 << 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700222 __u64 vaddr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800223/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800224 __u64 iova;
225 __u64 size;
Ben Cheng655a7c02013-10-16 16:09:24 -0700226};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700227#define VFIO_IOMMU_MAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 13)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800228/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700229struct vfio_iommu_type1_dma_unmap {
Tao Baod7db5942015-01-28 10:07:51 -0800230 __u32 argsz;
231 __u32 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700232 __u64 iova;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800233/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800234 __u64 size;
Ben Cheng655a7c02013-10-16 16:09:24 -0700235};
236#define VFIO_IOMMU_UNMAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 14)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700237#define VFIO_IOMMU_ENABLE _IO(VFIO_TYPE, VFIO_BASE + 15)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800238/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700239#define VFIO_IOMMU_DISABLE _IO(VFIO_TYPE, VFIO_BASE + 16)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800240struct vfio_iommu_spapr_tce_ddw_info {
241 __u64 pgsizes;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700242 __u32 max_dynamic_windows_supported;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800243/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800244 __u32 levels;
245};
Christopher Ferris38062f92014-07-09 15:33:25 -0700246struct vfio_iommu_spapr_tce_info {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700247 __u32 argsz;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800248/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800249 __u32 flags;
250#define VFIO_IOMMU_SPAPR_INFO_DDW (1 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800251 __u32 dma32_window_start;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700252 __u32 dma32_window_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800253/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800254 struct vfio_iommu_spapr_tce_ddw_info ddw;
Christopher Ferris38062f92014-07-09 15:33:25 -0700255};
256#define VFIO_IOMMU_SPAPR_TCE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700257struct vfio_eeh_pe_err {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800258/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800259 __u32 type;
260 __u32 func;
261 __u64 addr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700262 __u64 mask;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800263/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800264};
Christopher Ferris82d75042015-01-26 10:57:07 -0800265struct vfio_eeh_pe_op {
Tao Baod7db5942015-01-28 10:07:51 -0800266 __u32 argsz;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700267 __u32 flags;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800268/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800269 __u32 op;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800270 union {
271 struct vfio_eeh_pe_err err;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700272 };
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800273/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris82d75042015-01-26 10:57:07 -0800274};
275#define VFIO_EEH_PE_DISABLE 0
276#define VFIO_EEH_PE_ENABLE 1
Christopher Ferris106b3a82016-08-24 12:15:38 -0700277#define VFIO_EEH_PE_UNFREEZE_IO 2
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800278/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris82d75042015-01-26 10:57:07 -0800279#define VFIO_EEH_PE_UNFREEZE_DMA 3
280#define VFIO_EEH_PE_GET_STATE 4
281#define VFIO_EEH_PE_STATE_NORMAL 0
Christopher Ferris106b3a82016-08-24 12:15:38 -0700282#define VFIO_EEH_PE_STATE_RESET 1
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800283/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris82d75042015-01-26 10:57:07 -0800284#define VFIO_EEH_PE_STATE_STOPPED 2
285#define VFIO_EEH_PE_STATE_STOPPED_DMA 4
286#define VFIO_EEH_PE_STATE_UNAVAIL 5
Christopher Ferris106b3a82016-08-24 12:15:38 -0700287#define VFIO_EEH_PE_RESET_DEACTIVATE 5
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800288/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris82d75042015-01-26 10:57:07 -0800289#define VFIO_EEH_PE_RESET_HOT 6
290#define VFIO_EEH_PE_RESET_FUNDAMENTAL 7
291#define VFIO_EEH_PE_CONFIGURE 8
Christopher Ferris106b3a82016-08-24 12:15:38 -0700292#define VFIO_EEH_PE_INJECT_ERR 9
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800293/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris82d75042015-01-26 10:57:07 -0800294#define VFIO_EEH_PE_OP _IO(VFIO_TYPE, VFIO_BASE + 21)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800295struct vfio_iommu_spapr_register_memory {
296 __u32 argsz;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700297 __u32 flags;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800298/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800299 __u64 vaddr;
300 __u64 size;
301};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700302#define VFIO_IOMMU_SPAPR_REGISTER_MEMORY _IO(VFIO_TYPE, VFIO_BASE + 17)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800303/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800304#define VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY _IO(VFIO_TYPE, VFIO_BASE + 18)
305struct vfio_iommu_spapr_tce_create {
306 __u32 argsz;
307 __u32 flags;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800308/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800309 __u32 page_shift;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700310 __u32 __resv1;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800311 __u64 window_size;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700312 __u32 levels;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800313/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700314 __u32 __resv2;
315 __u64 start_addr;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800316};
317#define VFIO_IOMMU_SPAPR_TCE_CREATE _IO(VFIO_TYPE, VFIO_BASE + 19)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800318/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800319struct vfio_iommu_spapr_tce_remove {
320 __u32 argsz;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800321 __u32 flags;
322 __u64 start_addr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800323/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800324};
325#define VFIO_IOMMU_SPAPR_TCE_REMOVE _IO(VFIO_TYPE, VFIO_BASE + 20)
Ben Cheng655a7c02013-10-16 16:09:24 -0700326#endif