From patchwork Thu Jan 15 13:18:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 43175 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3C35B20D60 for ; Thu, 15 Jan 2015 13:18:44 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id t10sf7334906eei.2 for ; Thu, 15 Jan 2015 05:18:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=zzVCkqq+GOYj7RkxZlSVb0VFt9worX35oDexUcKIdG0=; b=IacaeRuwbmD/tz/FwZSowBXXtOo+Yah+FZmGNBpJ52dVr4lhAYIvRHPF/HDxcZyX7d WJYYxOkzMn7Eg32GSrOoeuxsTVmgXqz7BuGPFofvuwx3cfcV643HXnkFfVTSjB/lW6fD 5fXLFgnzwuXOqROggJXuRkhlDcaDwWs0FwE6JdI2xlh40RLI7wu84JfeN18I9o2ZXYeE U7qQBwkPsOVS/6FopcUcNOY1pNrwS05j+aXyBGGXrkuvYRU2XiUx2eI5fo9tFxdui+s/ nWxS0XzzcTpilkB5jxBtbbwCklcoCF8aNknLIge3erSjCyzEpnHohqpjC1xtr2/cZJ4T va4w== X-Gm-Message-State: ALoCoQksJF/cD6Pvy9DPa3gnAP3CGnpNIF+9+U0ZE8EzpeRM/rO3gYYzp23G0YpDK6QtwKRtTDJS X-Received: by 10.112.133.98 with SMTP id pb2mr1258281lbb.2.1421327923524; Thu, 15 Jan 2015 05:18:43 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.202.198 with SMTP id kk6ls213317lac.103.gmail; Thu, 15 Jan 2015 05:18:43 -0800 (PST) X-Received: by 10.112.78.39 with SMTP id y7mr10001138lbw.42.1421327923382; Thu, 15 Jan 2015 05:18:43 -0800 (PST) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id xr6si81783lbb.1.2015.01.15.05.18.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 05:18:43 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id hz20so13500092lab.6 for ; Thu, 15 Jan 2015 05:18:43 -0800 (PST) X-Received: by 10.152.8.11 with SMTP id n11mr9544352laa.38.1421327923297; Thu, 15 Jan 2015 05:18:43 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.9.200 with SMTP id c8csp2030671lbb; Thu, 15 Jan 2015 05:18:42 -0800 (PST) X-Received: by 10.180.96.67 with SMTP id dq3mr18816927wib.51.1421327922486; Thu, 15 Jan 2015 05:18:42 -0800 (PST) Received: from mail-we0-f181.google.com (mail-we0-f181.google.com. [74.125.82.181]) by mx.google.com with ESMTPS id fn9si32076693wib.56.2015.01.15.05.18.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 05:18:42 -0800 (PST) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 74.125.82.181 as permitted sender) client-ip=74.125.82.181; Received: by mail-we0-f181.google.com with SMTP id q58so14637024wes.12 for ; Thu, 15 Jan 2015 05:18:42 -0800 (PST) X-Received: by 10.194.191.227 with SMTP id hb3mr18364884wjc.79.1421327922194; Thu, 15 Jan 2015 05:18:42 -0800 (PST) Received: from midway01-04-00.lavalab ([81.128.185.50]) by mx.google.com with ESMTPSA id o2sm7456332wiy.11.2015.01.15.05.18.41 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 05:18:41 -0800 (PST) From: Eric Auger 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: eric.auger@linaro.org, kvmarm@lists.cs.columbia.edu, patches@linaro.org, Bharat.Bhushan@freescale.com, b.reynal@virtualopensystems.com, a.rigo@virtualopensystems.com, a.motakis@virtualopensystems.com, pbonzini@redhat.com, afaerber@suse.de Subject: [PATCH v9 1/7] linux-headers: update VFIO header for VFIO platform/AMBA drivers Date: Thu, 15 Jan 2015 13:18:11 +0000 Message-Id: <1421327897-1698-2-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1421327897-1698-1-git-send-email-eric.auger@linaro.org> References: <1421327897-1698-1-git-send-email-eric.auger@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: eric.auger@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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) */