summaryrefslogtreecommitdiff
path: root/include/uapi/linux/vfio.h
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2014-09-29 20:06:19 +0400
committerAlex Williamson <alex.williamson@redhat.com>2014-09-29 20:06:19 +0400
commitf5c9ecebaf2a2c9381973798e389cc019dd983e0 (patch)
tree0668589b668a32145609cde83473824fbd4cfe30 /include/uapi/linux/vfio.h
parentc02607aad2f9ed478eb288bcec1c00cd9df38b3c (diff)
downloadlinux-f5c9ecebaf2a2c9381973798e389cc019dd983e0.tar.xz
vfio/iommu_type1: add new VFIO_TYPE1_NESTING_IOMMU IOMMU type
VFIO allows devices to be safely handed off to userspace by putting them behind an IOMMU configured to ensure DMA and interrupt isolation. This enables userspace KVM clients, such as kvmtool and qemu, to further map the device into a virtual machine. With IOMMUs such as the ARM SMMU, it is then possible to provide SMMU translation services to the guest operating system, which are nested with the existing translation installed by VFIO. However, enabling this feature means that the IOMMU driver must be informed that the VFIO domain is being created for the purposes of nested translation. This patch adds a new IOMMU type (VFIO_TYPE1_NESTING_IOMMU) to the VFIO type-1 driver. The new IOMMU type acts identically to the VFIO_TYPE1v2_IOMMU type, but additionally sets the DOMAIN_ATTR_NESTING attribute on its IOMMU domains. Cc: Joerg Roedel <joro@8bytes.org> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'include/uapi/linux/vfio.h')
-rw-r--r--include/uapi/linux/vfio.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
index 6612974c64bf..29715d27548f 100644
--- a/include/uapi/linux/vfio.h
+++ b/include/uapi/linux/vfio.h
@@ -33,6 +33,9 @@
/* Check if EEH is supported */
#define VFIO_EEH 5
+/* Two-stage IOMMU */
+#define VFIO_TYPE1_NESTING_IOMMU 6 /* Implies v2 */
+
/*
* The IOCTL interface is designed for extensibility by embedding the
* structure length (argsz) and flags into structures passed between