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: Auger Eric X-Patchwork-Id: 63324 Delivered-To: patches@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1981394lbc; Tue, 1 Mar 2016 10:28:15 -0800 (PST) X-Received: by 10.28.23.75 with SMTP id 72mr494522wmx.50.1456856895086; Tue, 01 Mar 2016 10:28:15 -0800 (PST) Return-Path: Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com. [2a00:1450:400c:c09::232]) by mx.google.com with ESMTPS id d9si38550202wjr.170.2016.03.01.10.28.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Mar 2016 10:28:15 -0800 (PST) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 2a00:1450:400c:c09::232 as permitted sender) client-ip=2a00:1450:400c:c09::232; Authentication-Results: mx.google.com; spf=pass (google.com: domain of eric.auger@linaro.org designates 2a00:1450:400c:c09::232 as permitted sender) smtp.mailfrom=eric.auger@linaro.org; dkim=pass header.i=@linaro.org Received: by mail-wm0-x232.google.com with SMTP id p65so47886886wmp.1 for ; Tue, 01 Mar 2016 10:28:14 -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=leShYg1iPzcpy2n3Sm4oc50dtrRiQT5t205Fw82n8t+cdWpLaQhF6Yygs7E1dqJeAO IbbJJv9fDqn5DM98pv6M6shkPdpTDjX7xQfoJh0DZxiGYB7qkchf9irWSn0pPlqXMr13 jh0t1e9RURp/dRQHh4wLnb/F32mFsJvgPxazNifjzvfdDDstaUWmEQMOkXbPD9yg8yXJ tjg0c8lxYUIQeI/QquiQNsui03ZsWmFkKO+M2yFT8nTChEXWXFzu6kbbpyhr2p6Ar8U7 RNKUSOBuYs6OIzkgVh3ROdUM7f9pt6lcS+k5/pMAyM+hkT+1uJkBfoDvmu4sBqkkOHaL F9Nw== X-Gm-Message-State: AD7BkJJlPP78cBoDSVT9I4ntSnr9USH4TMYcpNJjuBu7k4pqn9r/qzEiH8yKtfgqEzU6LwlL9II= X-Received: by 10.194.185.199 with SMTP id fe7mr21839099wjc.50.1456856894865; Tue, 01 Mar 2016 10:28:14 -0800 (PST) Return-Path: 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 Cc: suravee.suthikulpanit@amd.com, patches@linaro.org, linux-kernel@vger.kernel.org, Manish.Jaggi@caviumnetworks.com, Bharat.Bhushan@freescale.com, pranav.sawargaonkar@gmail.com, p.fedin@samsung.com, iommu@lists.linux-foundation.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> 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(+) -- 1.9.1 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, };