#include <linux/types.h>
#include <linux/ioctl.h>
Go to the source code of this file.
|
#define | VFIO_API_VERSION 0 |
|
#define | VFIO_TYPE1_IOMMU 1 |
|
#define | VFIO_TYPE (';') |
|
#define | VFIO_BASE 100 |
|
#define | VFIO_GET_API_VERSION _IO(VFIO_TYPE, VFIO_BASE + 0) |
|
#define | VFIO_CHECK_EXTENSION _IO(VFIO_TYPE, VFIO_BASE + 1) |
|
#define | VFIO_SET_IOMMU _IO(VFIO_TYPE, VFIO_BASE + 2) |
|
#define | VFIO_GROUP_FLAGS_VIABLE (1 << 0) |
|
#define | VFIO_GROUP_FLAGS_CONTAINER_SET (1 << 1) |
|
#define | VFIO_GROUP_GET_STATUS _IO(VFIO_TYPE, VFIO_BASE + 3) |
|
#define | VFIO_GROUP_SET_CONTAINER _IO(VFIO_TYPE, VFIO_BASE + 4) |
|
#define | VFIO_GROUP_UNSET_CONTAINER _IO(VFIO_TYPE, VFIO_BASE + 5) |
|
#define | VFIO_GROUP_GET_DEVICE_FD _IO(VFIO_TYPE, VFIO_BASE + 6) |
|
#define | VFIO_DEVICE_FLAGS_RESET (1 << 0) /* Device supports reset */ |
|
#define | VFIO_DEVICE_FLAGS_PCI (1 << 1) /* vfio-pci device */ |
|
#define | VFIO_DEVICE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 7) |
|
#define | VFIO_REGION_INFO_FLAG_READ (1 << 0) /* Region supports read */ |
|
#define | VFIO_REGION_INFO_FLAG_WRITE (1 << 1) /* Region supports write */ |
|
#define | VFIO_REGION_INFO_FLAG_MMAP (1 << 2) /* Region supports mmap */ |
|
#define | VFIO_DEVICE_GET_REGION_INFO _IO(VFIO_TYPE, VFIO_BASE + 8) |
|
#define | VFIO_IRQ_INFO_EVENTFD (1 << 0) |
|
#define | VFIO_IRQ_INFO_MASKABLE (1 << 1) |
|
#define | VFIO_IRQ_INFO_AUTOMASKED (1 << 2) |
|
#define | VFIO_IRQ_INFO_NORESIZE (1 << 3) |
|
#define | VFIO_DEVICE_GET_IRQ_INFO _IO(VFIO_TYPE, VFIO_BASE + 9) |
|
#define | VFIO_IRQ_SET_DATA_NONE (1 << 0) /* Data not present */ |
|
#define | VFIO_IRQ_SET_DATA_BOOL (1 << 1) /* Data is bool (u8) */ |
|
#define | VFIO_IRQ_SET_DATA_EVENTFD (1 << 2) /* Data is eventfd (s32) */ |
|
#define | VFIO_IRQ_SET_ACTION_MASK (1 << 3) /* Mask interrupt */ |
|
#define | VFIO_IRQ_SET_ACTION_UNMASK (1 << 4) /* Unmask interrupt */ |
|
#define | VFIO_IRQ_SET_ACTION_TRIGGER (1 << 5) /* Trigger interrupt */ |
|
#define | VFIO_DEVICE_SET_IRQS _IO(VFIO_TYPE, VFIO_BASE + 10) |
|
#define | VFIO_IRQ_SET_DATA_TYPE_MASK |
|
#define | VFIO_IRQ_SET_ACTION_TYPE_MASK |
|
#define | VFIO_DEVICE_RESET _IO(VFIO_TYPE, VFIO_BASE + 11) |
|
#define | VFIO_IOMMU_INFO_PGSIZES (1 << 0) /* supported page sizes info */ |
|
#define | VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12) |
|
#define | VFIO_DMA_MAP_FLAG_READ (1 << 0) /* readable from device */ |
|
#define | VFIO_DMA_MAP_FLAG_WRITE (1 << 1) /* writable from device */ |
|
#define | VFIO_IOMMU_MAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 13) |
|
#define | VFIO_IOMMU_UNMAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 14) |
|
|
enum | {
VFIO_PCI_BAR0_REGION_INDEX,
VFIO_PCI_BAR1_REGION_INDEX,
VFIO_PCI_BAR2_REGION_INDEX,
VFIO_PCI_BAR3_REGION_INDEX,
VFIO_PCI_BAR4_REGION_INDEX,
VFIO_PCI_BAR5_REGION_INDEX,
VFIO_PCI_ROM_REGION_INDEX,
VFIO_PCI_CONFIG_REGION_INDEX,
VFIO_PCI_NUM_REGIONS
} |
|
enum | { VFIO_PCI_INTX_IRQ_INDEX,
VFIO_PCI_MSI_IRQ_INDEX,
VFIO_PCI_MSIX_IRQ_INDEX,
VFIO_PCI_NUM_IRQS
} |
|
#define VFIO_API_VERSION 0 |
VFIO_CHECK_EXTENSION - _IOW(VFIO_TYPE, VFIO_BASE + 1, __u32)
Check whether an extension is supported. Return: 0 if not supported, 1 (or some other positive integer) if supported. Availability: Always
Definition at line 60 of file vfio.h.
#define VFIO_DEVICE_FLAGS_PCI (1 << 1) /* vfio-pci device */ |
#define VFIO_DEVICE_FLAGS_RESET (1 << 0) /* Device supports reset */ |
VFIO_DEVICE_RESET - _IO(VFIO_TYPE, VFIO_BASE + 11)
Reset a device.
Definition at line 289 of file vfio.h.
VFIO_GET_API_VERSION - _IO(VFIO_TYPE, VFIO_BASE + 0)
Report the version of the VFIO API. This allows us to bump the entire API version should we later need to add or change features in incompatible ways. Return: VFIO_API_VERSION Availability: Always
Definition at line 51 of file vfio.h.
#define VFIO_GROUP_FLAGS_CONTAINER_SET (1 << 1) |
#define VFIO_GROUP_FLAGS_VIABLE (1 << 0) |
VFIO_GROUP_GET_DEVICE_FD - _IOW(VFIO_TYPE, VFIO_BASE + 6, char)
Return a new file descriptor for the device object described by the provided string. The string should match a device listed in the devices subdirectory of the IOMMU group sysfs entry. The group containing the device must already be added to this context. Return: new file descriptor on success, -errno on failure. Availability: When attached to container
Definition at line 133 of file vfio.h.
VFIO_GROUP_SET_CONTAINER - _IOW(VFIO_TYPE, VFIO_BASE + 4, __s32)
Set the container for the VFIO group to the open VFIO file descriptor provided. Groups may only belong to a single container. Containers may, at their discretion, support multiple groups. Only when a container is set are all of the interfaces of the VFIO file descriptor and the VFIO group file descriptor available to the user. Return: 0 on success, -errno on failure. Availability: Always
Definition at line 106 of file vfio.h.
VFIO_GROUP_UNSET_CONTAINER - _IO(VFIO_TYPE, VFIO_BASE + 5)
Remove the group from the attached container. This is the opposite of the SET_CONTAINER call and returns the group to an initial state. All device file descriptors must be released prior to calling this interface. When removing the last group from a container, the IOMMU will be disabled and all state lost, effectively also returning the VFIO file descriptor to an initial state. Return: 0 on success, -errno on failure. Availability: When attached to container
Definition at line 121 of file vfio.h.
#define VFIO_IOMMU_INFO_PGSIZES (1 << 0) /* supported page sizes info */ |
#define VFIO_IRQ_INFO_AUTOMASKED (1 << 2) |
#define VFIO_IRQ_INFO_EVENTFD (1 << 0) |
#define VFIO_IRQ_INFO_MASKABLE (1 << 1) |
#define VFIO_IRQ_INFO_NORESIZE (1 << 3) |
#define VFIO_IRQ_SET_ACTION_MASK (1 << 3) /* Mask interrupt */ |
#define VFIO_IRQ_SET_ACTION_TRIGGER (1 << 5) /* Trigger interrupt */ |
#define VFIO_IRQ_SET_ACTION_TYPE_MASK |
Value:
VFIO_IRQ_SET_ACTION_UNMASK | \
VFIO_IRQ_SET_ACTION_TRIGGER)
Definition at line 281 of file vfio.h.
#define VFIO_IRQ_SET_ACTION_UNMASK (1 << 4) /* Unmask interrupt */ |
#define VFIO_IRQ_SET_DATA_BOOL (1 << 1) /* Data is bool (u8) */ |
#define VFIO_IRQ_SET_DATA_EVENTFD (1 << 2) /* Data is eventfd (s32) */ |
#define VFIO_IRQ_SET_DATA_NONE (1 << 0) /* Data not present */ |
#define VFIO_IRQ_SET_DATA_TYPE_MASK |
Value:
VFIO_IRQ_SET_DATA_BOOL | \
VFIO_IRQ_SET_DATA_EVENTFD)
Definition at line 278 of file vfio.h.
#define VFIO_REGION_INFO_FLAG_MMAP (1 << 2) /* Region supports mmap */ |
#define VFIO_REGION_INFO_FLAG_READ (1 << 0) /* Region supports read */ |
#define VFIO_REGION_INFO_FLAG_WRITE (1 << 1) /* Region supports write */ |
VFIO_SET_IOMMU - _IOW(VFIO_TYPE, VFIO_BASE + 2, __s32)
Set the iommu to the given type. The type must be supported by an iommu driver as verified by calling CHECK_EXTENSION using the same type. A group must be set to this file descriptor before this ioctl is available. The IOMMU interfaces enabled by this call are specific to the value set. Return: 0 on success, -errno on failure Availability: When VFIO group attached
Definition at line 73 of file vfio.h.
#define VFIO_TYPE1_IOMMU 1 |
- Enumerator:
VFIO_PCI_BAR0_REGION_INDEX |
|
VFIO_PCI_BAR1_REGION_INDEX |
|
VFIO_PCI_BAR2_REGION_INDEX |
|
VFIO_PCI_BAR3_REGION_INDEX |
|
VFIO_PCI_BAR4_REGION_INDEX |
|
VFIO_PCI_BAR5_REGION_INDEX |
|
VFIO_PCI_ROM_REGION_INDEX |
|
VFIO_PCI_CONFIG_REGION_INDEX |
|
VFIO_PCI_NUM_REGIONS |
|
Definition at line 297 of file vfio.h.
- Enumerator:
VFIO_PCI_INTX_IRQ_INDEX |
|
VFIO_PCI_MSI_IRQ_INDEX |
|
VFIO_PCI_MSIX_IRQ_INDEX |
|
VFIO_PCI_NUM_IRQS |
|
Definition at line 309 of file vfio.h.