From patchwork Tue Mar 1 18:27:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 63325 Delivered-To: patches@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1981415lbc; Tue, 1 Mar 2016 10:28:18 -0800 (PST) X-Received: by 10.28.109.141 with SMTP id b13mr406955wmi.25.1456856898123; Tue, 01 Mar 2016 10:28:18 -0800 (PST) Return-Path: Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com. [2a00:1450:400c:c09::235]) by mx.google.com with ESMTPS id d132si429027wmf.39.2016.03.01.10.28.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Mar 2016 10:28:18 -0800 (PST) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 2a00:1450:400c:c09::235 as permitted sender) client-ip=2a00:1450:400c:c09::235; Authentication-Results: mx.google.com; spf=pass (google.com: domain of eric.auger@linaro.org designates 2a00:1450:400c:c09::235 as permitted sender) smtp.mailfrom=eric.auger@linaro.org; dkim=pass header.i=@linaro.org Received: by mail-wm0-x235.google.com with SMTP id n186so50781154wmn.1 for ; Tue, 01 Mar 2016 10:28:18 -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=2BvQq+d2tIMt7OVJgIB8Io1l3WPUWIlq/4u9qu615+8=; b=QDLH0ER9uGp5kEqgsYgxhqiJDYXM5N/5rqFRpCTBUXvQ0BqSbKY2kImclkVX5CyJ/8 WOXfKTuks/L+FWQzxu3F476Ux6OEMuAlZJIsnW6i/fF4TqrKKknAG5tSQKB7AxZ1BFd8 xRI+JiGYaVIPoMBI8SPhkgP1ebmVP/nVtVMWY= 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=2BvQq+d2tIMt7OVJgIB8Io1l3WPUWIlq/4u9qu615+8=; b=nMeK3thu15QkZchVwrph2YfN5zFJ31sgxbvsI0FnxyACdOeJcDYiGfXs2MTP5EXhBJ iahy76YxV9wE1ywXg5mtIlPNG9NdN1Q0aMm61hXgzmIjUr2YaEnboLWLp4SdjnVmuXe2 IrjPuFDFoGwnsoD0RA3GZnwJ2zYhPmf0+hU2aSCnhP82FXyogtKkNNvHh3AN3l3v8ySo DGcdQ7f0OC5BMc+h3Zee4vCDUR+SU0kqm995sEXblxRZKey+ybG2GeGq7+XtKz5OZyY9 4597E7or0GniuHr+XD0F5eje3uVpfLosDXenjorDP+plVpDx1tW9vD2ZhgWjCNM1ei1H PR0A== X-Gm-Message-State: AD7BkJLVCFAK3F7IY9TZGwVALrt2nmlMPMrRltq8Z+GahX/Fxvt6jivh7cJeAPNs6WD/8urbbyo= X-Received: by 10.28.87.139 with SMTP id l133mr456681wmb.38.1456856897894; Tue, 01 Mar 2016 10:28:17 -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.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Mar 2016 10:28:16 -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 02/17] iommu/arm-smmu: advertise DOMAIN_ATTR_MSI_MAPPING attribute Date: Tue, 1 Mar 2016 18:27:42 +0000 Message-Id: <1456856877-4817-3-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> On ARM, MSI write transactions from device upstream to the smmu are conveyed through the iommu. Therefore target physical addresses must be mapped and DOMAIN_ATTR_MSI_MAPPING is set to advertise this requirement on arm-smmu and arm-smmu-v3. Signed-off-by: Eric Auger Signed-off-by: Bharat Bhushan --- v4 -> v5: - don't handle fsl_pamu_domain anymore - handle arm-smmu-v3 --- drivers/iommu/arm-smmu-v3.c | 2 ++ drivers/iommu/arm-smmu.c | 2 ++ 2 files changed, 4 insertions(+) -- 1.9.1 diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 2087534..1d7b506 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -1895,6 +1895,8 @@ static int arm_smmu_domain_get_attr(struct iommu_domain *domain, case DOMAIN_ATTR_NESTING: *(int *)data = (smmu_domain->stage == ARM_SMMU_DOMAIN_NESTED); return 0; + case DOMAIN_ATTR_MSI_MAPPING: + return 0; default: return -ENODEV; } diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 59ee4b8..c8b7e71 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -1409,6 +1409,8 @@ static int arm_smmu_domain_get_attr(struct iommu_domain *domain, case DOMAIN_ATTR_NESTING: *(int *)data = (smmu_domain->stage == ARM_SMMU_DOMAIN_NESTED); return 0; + case DOMAIN_ATTR_MSI_MAPPING: + return 0; default: return -ENODEV; }