From patchwork Mon Apr 4 08:06:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 64951 Delivered-To: patches@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1047152lbc; Mon, 4 Apr 2016 01:07:14 -0700 (PDT) X-Received: by 10.141.5.137 with SMTP id h131mr23064256qhd.47.1459757234296; Mon, 04 Apr 2016 01:07:14 -0700 (PDT) Return-Path: Received: from mail-qg0-x22a.google.com (mail-qg0-x22a.google.com. [2607:f8b0:400d:c04::22a]) by mx.google.com with ESMTPS id t5si21452078qgt.117.2016.04.04.01.07.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Apr 2016 01:07:14 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 2607:f8b0:400d:c04::22a as permitted sender) client-ip=2607:f8b0:400d:c04::22a; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of eric.auger@linaro.org designates 2607:f8b0:400d:c04::22a as permitted sender) smtp.mailfrom=eric.auger@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-qg0-x22a.google.com with SMTP id j35so142631674qge.0 for ; Mon, 04 Apr 2016 01:07:14 -0700 (PDT) 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=ADtP+q4HmVwMC9baE9lqgakoS0vMF0dWilgew1IiY7v1fTcp2FgdyV7FqhBu6axjF0 5nkPJilG3FGakTpbpGgzXHeM81/JhE0IF7eikiRLcLJw5QtUKbx+r+laSeP3pthg6ysx /pI3Svd+4NKbfXQlRwa/kH/Lh+Ylkhlzg9XI8= 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=IWI2qlhcXmLeqp2xjSGsSqcQaddoFISheR+gmUZUMDcSuRTzoOT4YtsWDvLSLAOb1j n+FO5KRDsTiXugnc3aAop6xFwZsF3X46Bo0f2gN1VjcV5mHnjwAmHiAR3JbC1rwGDMar xxB88Xb18w+dGj1yuYESbv46V8nLNU7iRp9oow8qQHyoGjXA1IMeETK+/ypfLubLf++n xKtvboVIRXRuoyawPN465nVFq/YrK7/GDGBxXwPzJSSTU+p8wK//EaIkeecwEsnDVjqf ADAxoBVU17wJdA+UwmUzMdd1Q1jtb+FNUagZu41kxcacIanzX4PSqpqKh1njbC7Prr5k KXng== X-Gm-Message-State: AD7BkJIlbBplxZroKFxq1lIMl1KuznK2QswSHdLDVVKZuRRomsaLnvWUqAAof2iWdr5iL4BFdpw= X-Received: by 10.194.22.97 with SMTP id c1mr10462508wjf.19.1459757233960; Mon, 04 Apr 2016 01:07:13 -0700 (PDT) Return-Path: Received: from new-host-2.home (LMontsouris-657-1-37-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by smtp.gmail.com with ESMTPSA id m67sm7505239wma.3.2016.04.04.01.07.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Apr 2016 01:07:12 -0700 (PDT) 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, Jean-Philippe.Brucker@arm.com, julien.grall@arm.com Subject: [PATCH v6 1/7] iommu: Add DOMAIN_ATTR_MSI_MAPPING attribute Date: Mon, 4 Apr 2016 08:06:56 +0000 Message-Id: <1459757222-2668-2-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459757222-2668-1-git-send-email-eric.auger@linaro.org> References: <1459757222-2668-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, };