From patchwork Wed Jan 27 13:51:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 8134181 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3C3EF9F1CC for ; Wed, 27 Jan 2016 14:08:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1FFF1202EB for ; Wed, 27 Jan 2016 14:08:46 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A0B2D202E6 for ; Wed, 27 Jan 2016 14:08:40 +0000 (UTC) Received: from localhost ([::1]:50625 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOQWA-0002j7-1D for patchwork-qemu-devel@patchwork.kernel.org; Wed, 27 Jan 2016 08:52:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOQVy-0002gG-9m for qemu-devel@nongnu.org; Wed, 27 Jan 2016 08:52:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOQVv-00028X-PT for qemu-devel@nongnu.org; Wed, 27 Jan 2016 08:52:06 -0500 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:33129) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOQVv-00028F-IZ for qemu-devel@nongnu.org; Wed, 27 Jan 2016 08:52:03 -0500 Received: by mail-wm0-x229.google.com with SMTP id l66so3565358wml.0 for ; Wed, 27 Jan 2016 05:52:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SQiVRgyRE5YBEufwQNdwJMCFDkzRgeA46exBv8mBUE8=; b=UkuMJg24R0HE5QcaN3zzJ2aKxVBgWx7M+RTtslh1IHaaYn8pFdgZpFR3pGAy+4AGfN Vu7RbaqXAijkmfr4X33SMtQApEI0pMzW7jTJRWBEx6XWsjFgdQ+XJHFiQLS2UChZxtHL qOGIoMeTR2zZRRFV2HjEeZ48j1ETyln6BetA0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SQiVRgyRE5YBEufwQNdwJMCFDkzRgeA46exBv8mBUE8=; b=TsT67E8zG8f5G/Nj15Z/VfqFgCc1VcLQRqD3DHWvbWJDug4ffq0uFS73kkVBEg6Eeg EDOjZ32keRrm/7VKllOJIibL2zXb7fA6Wpc7i2DmZz/BD1I5+0OTQtle9yQzXx36WAmV BFmvm2y3JnyLVetcCbWcikeCtC+wUOD3wHzXl5d3zWQdvHrOQLsiP3c8ATKbHEB40kFw hCQ+zE73mLSgCNZQ9h1lvVj305wGmHtL3fauXzBV7L+cIC9ZWHF3FwxTe2m5llqdgAqN Mc5S8a13aEuZ//I3z0eTNcQrc5FsVwWpvMLeZpt/js2YdRyy8cgVuFolDunH3YGgPtK0 aH+g== X-Gm-Message-State: AG10YOTkoRolmPWX29k/ntQacN5h4y6KJCK3y6fhWTSf0/p1XtOfrp6yup5zKpf041w5ihMY X-Received: by 10.28.3.131 with SMTP id 125mr32356043wmd.14.1453902722807; Wed, 27 Jan 2016 05:52:02 -0800 (PST) Received: from new-host-8.home (LMontsouris-657-1-37-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by smtp.gmail.com with ESMTPSA id t9sm6345866wjf.33.2016.01.27.05.51.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Jan 2016 05:52:01 -0800 (PST) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org, peter.maydell@linaro.org, alex.williamson@redhat.com, pranav.sawargaonkar@gmail.com, p.fedin@samsung.com, pbonzini@redhat.com, agraf@suse.de Date: Wed, 27 Jan 2016 13:51:49 +0000 Message-Id: <1453902715-25304-2-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453902715-25304-1-git-send-email-eric.auger@linaro.org> References: <1453902715-25304-1-git-send-email-eric.auger@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::229 Cc: Bharat.Bhushan@freescale.com, suravee.suthikulpanit@amd.com, christoffer.dall@linaro.org Subject: [Qemu-devel] [RFC 1/7] linux-headers: partial update for VFIO reserved IOVA registration X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is a partial update aiming at enhancing the VFIO user API according to not yet upstreamed kernel developments available at: https://git.linaro.org/people/eric.auger/linux.git/shortlog/refs/heads/v4.5-rc1-pcie-passthrough-v1 See https://lkml.org/lkml/2016/1/26/371 for more details. Signed-off-by: Eric Auger --- linux-headers/linux/vfio.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h index aa276bc..ac6032e 100644 --- a/linux-headers/linux/vfio.h +++ b/linux-headers/linux/vfio.h @@ -8,8 +8,8 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#ifndef VFIO_H -#define VFIO_H +#ifndef _UAPIVFIO_H +#define _UAPIVFIO_H #include #include @@ -393,6 +393,7 @@ struct vfio_iommu_type1_info { __u32 argsz; __u32 flags; #define VFIO_IOMMU_INFO_PGSIZES (1 << 0) /* supported page sizes info */ +#define VFIO_IOMMU_INFO_REQUIRE_MSI_MAP (1 << 1)/* MSI must be mapped */ __u64 iova_pgsizes; /* Bitmap of supported page sizes */ }; @@ -403,12 +404,20 @@ 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. + * + * In case MSI_RESERVED_IOVA is set, the API only aims at registering an IOVA + * region which will be used on some platforms to map the host MSI frame. + * in that specific case, vaddr is ignored. The requirement for provisioning + * such IOVA range can be checked by calling VFIO_IOMMU_GET_INFO with the + * VFIO_IOMMU_INFO_REQUIRE_MSI_MAP attribute. */ 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 */ +/* reserved iova for MSI vectors*/ +#define VFIO_DMA_MAP_FLAG_MSI_RESERVED_IOVA (1 << 2) __u64 vaddr; /* Process virtual address */ __u64 iova; /* IO virtual address */ __u64 size; /* Size of mapping (bytes) */ @@ -591,4 +600,4 @@ struct vfio_iommu_spapr_tce_remove { /* ***************************************************************** */ -#endif /* VFIO_H */ +#endif /* _UAPIVFIO_H */