From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBkJy-0000aI-UX for qemu-devel@nongnu.org; Thu, 15 Jan 2015 08:18:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YBkJu-0007lC-Tj for qemu-devel@nongnu.org; Thu, 15 Jan 2015 08:18:46 -0500 Received: from mail-we0-f182.google.com ([74.125.82.182]:55450) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBkJu-0007kz-Nx for qemu-devel@nongnu.org; Thu, 15 Jan 2015 08:18:42 -0500 Received: by mail-we0-f182.google.com with SMTP id w62so14561475wes.13 for ; Thu, 15 Jan 2015 05:18:42 -0800 (PST) From: Eric Auger Date: Thu, 15 Jan 2015 13:18:11 +0000 Message-Id: <1421327897-1698-2-git-send-email-eric.auger@linaro.org> In-Reply-To: <1421327897-1698-1-git-send-email-eric.auger@linaro.org> References: <1421327897-1698-1-git-send-email-eric.auger@linaro.org> Subject: [Qemu-devel] [PATCH v9 1/7] linux-headers: update VFIO header for VFIO platform/AMBA drivers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: eric.auger@st.com, christoffer.dall@linaro.org, qemu-devel@nongnu.org, kim.phillips@freescale.com, alex.williamson@redhat.com, agraf@suse.de, peter.maydell@linaro.org Cc: b.reynal@virtualopensystems.com, patches@linaro.org, eric.auger@linaro.org, a.rigo@virtualopensystems.com, afaerber@suse.de, Bharat.Bhushan@freescale.com, pbonzini@redhat.com, a.motakis@virtualopensystems.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_v6_integrated_official_release Signed-off-by: Eric Auger --- v8 -> v9: - rewording of the commit message --- linux-headers/linux/vfio.h | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h index 0f21aa6..58f549c 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,8 @@ 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 */ +#define VFIO_DEVICE_FLAGS_AMBA (1 << 3) /* vfio-amba device */ __u32 num_regions; /* Max region index + 1 */ __u32 num_irqs; /* Max IRQ index + 1 */ }; @@ -398,12 +399,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