From patchwork Tue Mar 1 18:27:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 8468551 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A9BB8C0553 for ; Tue, 1 Mar 2016 18:30:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 45E452017D for ; Tue, 1 Mar 2016 18:30:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 71C64202C8 for ; Tue, 1 Mar 2016 18:30:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aap2V-0001n0-HH; Tue, 01 Mar 2016 18:28:55 +0000 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aap2C-0001Rz-GN for linux-arm-kernel@lists.infradead.org; Tue, 01 Mar 2016 18:28:38 +0000 Received: by mail-wm0-x235.google.com with SMTP id l68so50604667wml.0 for ; Tue, 01 Mar 2016 10:28:15 -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=nDkUXBKT2hlhE15GEKvwNIlswsvMKRdWXqMO8yVEVeI=; b=NQKS6LfcS7GNCXYtN7U0G55U77AD50/dxIReMFdq1jXV2s/4FfoXaqKGBm3jbvEOvU z47TdzHQbBMMU6IoYNNhKb/pEeUa117C79PUu3BMkFafX1WCBz1imAt4whQnf7pLa6Ot wD/apwfr7PADwm91zrIb0n5FPNyPtThIuZdIs= 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=nDkUXBKT2hlhE15GEKvwNIlswsvMKRdWXqMO8yVEVeI=; b=P/jjfhL3vplSVbyadMycPJ7/8lJoPmnzMuDjolxnZoPVLFJKkEOufB398I8nOTRTzD PR6qUWHo/MgKsKrJPiGDnBamMiHAQ7gcaLQSWU7N7wshStnvT4QuOlJciJeTL+UXhT/t gByHjRj9mG2Dtw4GXoCWTZZ+kn3rz9RJ9uMhH21ktTaD5YjCmFqg+wos+w4hbmI6J+cL FZz6qBnerv+DiFzBEmK5mNIi9wXZMLtDlr7rjecPooIwwicIjit6ilyGuwN9lVJ8Gcaj obRNz5u2bN6cIXtK7yQnwy504wPIelTtfZYdWnHkMh7sUMJud3DJHz1g549OJtXL2R9x 8GFg== X-Gm-Message-State: AD7BkJJGy6Tibq1bDX/vzxoL81pjsH5N9NUSJvEhMGYAAjUj2um+szE48uhqYSjJSXCU4f6b X-Received: by 10.194.185.199 with SMTP id fe7mr21839099wjc.50.1456856894865; Tue, 01 Mar 2016 10:28:14 -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 k8sm32176385wjr.38.2016.03.01.10.28.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Mar 2016 10:28:13 -0800 (PST) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, robin.murphy@arm.com, alex.williamson@redhat.com, will.deacon@arm.com, joro@8bytes.org, tglx@linutronix.de, jason@lakedaemon.net, marc.zyngier@arm.com, christoffer.dall@linaro.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Subject: [RFC v5 01/17] iommu: Add DOMAIN_ATTR_MSI_MAPPING attribute Date: Tue, 1 Mar 2016 18:27:41 +0000 Message-Id: <1456856877-4817-2-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1456856877-4817-1-git-send-email-eric.auger@linaro.org> References: <1456856877-4817-1-git-send-email-eric.auger@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160301_102836_813589_463AADE7 X-CRM114-Status: GOOD ( 12.90 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: patches@linaro.org, Manish.Jaggi@caviumnetworks.com, p.fedin@samsung.com, linux-kernel@vger.kernel.org, Bharat.Bhushan@freescale.com, iommu@lists.linux-foundation.org, pranav.sawargaonkar@gmail.com, suravee.suthikulpanit@amd.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,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 Introduce a new DOMAIN_ATTR_MSI_MAPPING domain attribute. If supported, this means the MSI addresses need to be mapped in the IOMMU. x86 IOMMUs typically don't expose the attribute since on x86, MSI write transaction addresses always are within the 1MB PA region [FEE0_0000h - FEF0_000h] window which directly targets the APIC configuration space and hence bypass the sMMU. On ARM and PowerPC however MSI transactions are conveyed through the IOMMU. Signed-off-by: Bharat Bhushan Signed-off-by: Eric Auger --- v4 -> v5: - introduce the user in the next patch RFC v1 -> v1: - the data field is not used - for this attribute domain_get_attr simply returns 0 if the MSI_MAPPING capability if needed or <0 if not. - removed struct iommu_domain_msi_maps --- include/linux/iommu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index a5c539f..a4fe04a 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -112,6 +112,7 @@ enum iommu_attr { DOMAIN_ATTR_FSL_PAMU_ENABLE, DOMAIN_ATTR_FSL_PAMUV1, DOMAIN_ATTR_NESTING, /* two stages of translation */ + DOMAIN_ATTR_MSI_MAPPING, /* Require MSIs mapping in iommu */ DOMAIN_ATTR_MAX, };