From patchwork Tue Apr 19 16:56:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 66113 Delivered-To: patches@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1968666qge; Tue, 19 Apr 2016 09:56:47 -0700 (PDT) X-Received: by 10.194.124.243 with SMTP id ml19mr4712634wjb.80.1461085007021; Tue, 19 Apr 2016 09:56:47 -0700 (PDT) Return-Path: Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com. [2a00:1450:400c:c09::22b]) by mx.google.com with ESMTPS id t130si5166417wme.63.2016.04.19.09.56.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Apr 2016 09:56:47 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 2a00:1450:400c:c09::22b as permitted sender) client-ip=2a00:1450:400c:c09::22b; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of eric.auger@linaro.org designates 2a00:1450:400c:c09::22b as permitted sender) smtp.mailfrom=eric.auger@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-wm0-x22b.google.com with SMTP id n3so40528000wmn.0 for ; Tue, 19 Apr 2016 09:56:46 -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=nCAo07XykrAW3jwXe4esihuScgJiYTqJpzHKPqqqhqU=; b=ATXCvhsPpJdZo5pDYW7yiOZLR9P07Qrb1li4zBXP5DA91lBmoe5k6QFn8yqehTp0WI EIAn2saisSQ+wPlZhzxYKcwDQSagCQZnTvhwgkjP2OSOcAEcrrMX/Irsmdzo5jY2U4tm 3kxukhTZtD5NC7xNaXWbvgpgb2jqUY5GD0J+c= 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=nCAo07XykrAW3jwXe4esihuScgJiYTqJpzHKPqqqhqU=; b=GiUUfri4vgEwihj/Y+nmtKjrmZK0afI/XmXqupI1kSqURefKJ8Qwu+3Iou0Yfif8gp pfY8BfAaSGmR/cGJah3z1YcBV4IHqOJgBk3QUiRq8zsBAeOZ2VSDZzmzloPf4pa5/1P+ 73q9wNMNeBNwocxjDuJ4jFkhdiyFamLJFotgG+agBVbmSDnhz6l79cCadMPu3oi1scI9 ixvmEmG+9pYFYoWDPpcLJlqM3D2CUXZx8TNqmHWqWo4cOnEkWqAguR/6GOoM7tMGOAmp h9u67XJ/Bz9ZOL4Zm/UNFdA+Qug5K8tcoMaR0ruoSp/EhEJkfLRXbRshNry1ED0ds8s2 51wQ== X-Gm-Message-State: AOPr4FVQ/XTkw9lA4Tx8srnNJprL8cpbTfxiJB1p7A3Lp2FWjHwvklABtiz0lo/pL+r0zrNolg8= X-Received: by 10.28.25.67 with SMTP id 64mr12582223wmz.10.1461085006719; Tue, 19 Apr 2016 09:56:46 -0700 (PDT) Return-Path: Received: from new-host-34.home (LMontsouris-657-1-37-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by smtp.gmail.com with ESMTPSA id x2sm1169329wjr.33.2016.04.19.09.56.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Apr 2016 09:56:45 -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 Cc: patches@linaro.org, linux-kernel@vger.kernel.org, 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 v7 02/10] iommu/arm-smmu: advertise DOMAIN_ATTR_MSI_MAPPING attribute Date: Tue, 19 Apr 2016 16:56:26 +0000 Message-Id: <1461084994-2355-3-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461084994-2355-1-git-send-email-eric.auger@linaro.org> References: <1461084994-2355-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 4ff73ff..a077a35 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -1900,6 +1900,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 7c39ac4..8cd7b8a 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -1435,6 +1435,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; }