From patchwork Tue Apr 19 17:24:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 66136 Delivered-To: patches@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1983736qge; Tue, 19 Apr 2016 10:25:15 -0700 (PDT) X-Received: by 10.194.243.226 with SMTP id xb2mr4287994wjc.35.1461086706659; Tue, 19 Apr 2016 10:25:06 -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 139si5237813wmv.120.2016.04.19.10.25.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Apr 2016 10:25:06 -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 u206so41552240wme.1 for ; Tue, 19 Apr 2016 10:25:06 -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=8/niqsR69O+XgqZqYglTZuUrpjKXGCc9ucorN3xzYfU=; b=Jp0CMKlb4Q+QSCNMzk3JdLNdXk/4+Rp5XQy62PDTflQepl4FQ5vipiFAegy0/0WX6d S0t7t75G/FzzYvt4PKGRwgi6sqoz39bhM1vgphDBSx1+lgRHLAftvCo29W2++9KiEaJN KbWey5lhhX3j2E0wjFdJ5+6tbAP8oQKTRynmM= 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=8/niqsR69O+XgqZqYglTZuUrpjKXGCc9ucorN3xzYfU=; b=fhym/DKVHruRpMzcFfjr3O3spUfQvEhGc0HsOC+BIHndDoBqCcp27pRTphWEvmLdxk PBMZfeGcJJAVXHNH8H88deXtKIXcEB/onr2pANV8zjc/F/d1OJIYxfpuKmMl83FSKDhl Pk2qII3BOpmfA+ISSVj8JeO3lwL5aVBfNd5oSOSPMvCx7/neQLooH7jnXVdotgr0jGqz 2g5ruXyHWeffY1HiR51KwM0OQldpMlENPgrRm7si8AQs/eXzyNYRFysNTTqLCTVzl1JI eco8GYpGhUtiyw9TF91lSJndJhHZG4dBkpHStgjdsgXR8efO4TgtIdO4XUPFfgcZYmkk EsnA== X-Gm-Message-State: AOPr4FXLcRGMw9FFhik2i01yT0qQ70aO/FUuf+0PwBxF2KKXK2ENO0F7GWL9N9w1zs8KXyeDR48= X-Received: by 10.194.90.229 with SMTP id bz5mr4542527wjb.143.1461086706314; Tue, 19 Apr 2016 10:25:06 -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 w202sm5330220wmw.18.2016.04.19.10.25.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Apr 2016 10:25:05 -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 6/7] iommu/arm-smmu: do not advertise IOMMU_CAP_INTR_REMAP Date: Tue, 19 Apr 2016 17:24:46 +0000 Message-Id: <1461086687-2658-7-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461086687-2658-1-git-send-email-eric.auger@linaro.org> References: <1461086687-2658-1-git-send-email-eric.auger@linaro.org> Do not advertise IOMMU_CAP_INTR_REMAP for arm-smmu(-v3). Indeed the irq_remapping capability is abstracted on irqchip side for ARM as opposed to Intel IOMMU featuring IRQ remapping HW. So to check IRQ remapping capability, the msi domain needs to be checked instead. This commit needs to be applied after "vfio/type1: also check IRQ remapping capability at msi domain" else the legacy interrupt assignment gets broken with arm-smmu. Signed-off-by: Eric Auger --- drivers/iommu/arm-smmu-v3.c | 3 ++- drivers/iommu/arm-smmu.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) -- 1.9.1 diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index afd0dac..1d0106c 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -1386,7 +1386,8 @@ static bool arm_smmu_capable(enum iommu_cap cap) case IOMMU_CAP_CACHE_COHERENCY: return true; case IOMMU_CAP_INTR_REMAP: - return true; /* MSIs are just memory writes */ + /* interrupt translation handled at MSI controller level */ + return false; case IOMMU_CAP_NOEXEC: return true; default: diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 492339f..6232b2a 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -1312,7 +1312,8 @@ static bool arm_smmu_capable(enum iommu_cap cap) */ return true; case IOMMU_CAP_INTR_REMAP: - return true; /* MSIs are just memory writes */ + /* interrupt translation handled at MSI controller level */ + return false; case IOMMU_CAP_NOEXEC: return true; default: