From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33186) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YM7E0-0005Ix-Oz for qemu-devel@nongnu.org; Thu, 12 Feb 2015 22:47:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YM7Dw-0004Y4-5n for qemu-devel@nongnu.org; Thu, 12 Feb 2015 22:47:28 -0500 Received: from mail-wg0-f46.google.com ([74.125.82.46]:49159) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YM7Dv-0004Xz-Vr for qemu-devel@nongnu.org; Thu, 12 Feb 2015 22:47:24 -0500 Received: by mail-wg0-f46.google.com with SMTP id a1so14196121wgh.5 for ; Thu, 12 Feb 2015 19:47:23 -0800 (PST) From: Eric Auger Date: Fri, 13 Feb 2015 03:47:06 +0000 Message-Id: <1423799232-10816-2-git-send-email-eric.auger@linaro.org> In-Reply-To: <1423799232-10816-1-git-send-email-eric.auger@linaro.org> References: <1423799232-10816-1-git-send-email-eric.auger@linaro.org> Subject: [Qemu-devel] [PATCH v10 1/7] linux-headers: update VFIO header for VFIO platform drivers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: eric.auger@st.com, eric.auger@linaro.org, christoffer.dall@linaro.org, qemu-devel@nongnu.org, alex.williamson@redhat.com, peter.maydell@linaro.org, agraf@suse.de, b.reynal@virtualopensystems.com, feng.wu@intel.com Cc: kim.phillips@freescale.com, patches@linaro.org, a.rigo@virtualopensystems.com, afaerber@suse.de, Bharat.Bhushan@freescale.com, a.motakis@virtualopensystems.com, pbonzini@redhat.com, kvmarm@lists.cs.columbia.edu Update according to vfio.h header found in http://git.linaro.org/people/eric.auger/linux.git branch irqfd_integ_v9 Signed-off-by: Eric Auger --- v9 -> v10: - AMBA removed v8 -> v9: - rewording of the commit message --- linux-headers/linux/vfio.h | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h index 0f21aa6..2ef4485 100644 --- a/linux-headers/linux/vfio.h +++ b/linux-headers/linux/vfio.h @@ -19,22 +19,21 @@ /* Kernel & User level defines for VFIO IOCTLs. */ -/* Extensions */ - -#define VFIO_TYPE1_IOMMU 1 -#define VFIO_SPAPR_TCE_IOMMU 2 -#define VFIO_TYPE1v2_IOMMU 3 /* - * IOMMU enforces DMA cache coherence (ex. PCIe NoSnoop stripping). This - * capability is subject to change as groups are added or removed. + * Capabilities exposed by the VFIO IOMMU driver. Some capabilities are subject + * to change as groups are added or removed. */ -#define VFIO_DMA_CC_IOMMU 4 - -/* Check if EEH is supported */ -#define VFIO_EEH 5 +enum vfio_iommu_cap { + VFIO_TYPE1_IOMMU = 1, + VFIO_SPAPR_TCE_IOMMU = 2, + VFIO_TYPE1v2_IOMMU = 3, + VFIO_DMA_CC_IOMMU = 4, /* IOMMU enforces DMA cache coherence + (ex. PCIe NoSnoop stripping) */ + VFIO_EEH = 5, /* Check if EEH is supported */ + VFIO_TYPE1_NESTING_IOMMU = 6, /* Two-stage IOMMU, implies v2 */ + VFIO_DMA_NOEXEC_IOMMU = 7, +}; -/* Two-stage IOMMU */ -#define VFIO_TYPE1_NESTING_IOMMU 6 /* Implies v2 */ /* * The IOCTL interface is designed for extensibility by embedding the @@ -160,6 +159,7 @@ struct vfio_device_info { __u32 flags; #define VFIO_DEVICE_FLAGS_RESET (1 << 0) /* Device supports reset */ #define VFIO_DEVICE_FLAGS_PCI (1 << 1) /* vfio-pci device */ +#define VFIO_DEVICE_FLAGS_PLATFORM (1 << 2) /* vfio-platform device */ __u32 num_regions; /* Max region index + 1 */ __u32 num_irqs; /* Max IRQ index + 1 */ }; @@ -398,12 +398,17 @@ struct vfio_iommu_type1_info { * * Map process virtual addresses to IO virtual addresses using the * provided struct vfio_dma_map. Caller sets argsz. READ &/ WRITE required. + * + * To use the VFIO_DMA_MAP_FLAG_NOEXEC flag, the container must support the + * VFIO_DMA_NOEXEC_IOMMU capability. If mappings are created using this flag, + * any groups subsequently added to the container must support this capability. */ struct vfio_iommu_type1_dma_map { __u32 argsz; __u32 flags; #define VFIO_DMA_MAP_FLAG_READ (1 << 0) /* readable from device */ #define VFIO_DMA_MAP_FLAG_WRITE (1 << 1) /* writable from device */ +#define VFIO_DMA_MAP_FLAG_NOEXEC (1 << 2) /* not executable from device */ __u64 vaddr; /* Process virtual address */ __u64 iova; /* IO virtual address */ __u64 size; /* Size of mapping (bytes) */ -- 1.8.3.2