From patchwork Tue Apr 19 16:56:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 66112 Delivered-To: patches@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1968655qge; Tue, 19 Apr 2016 09:56:45 -0700 (PDT) X-Received: by 10.194.61.40 with SMTP id m8mr4187201wjr.106.1461085005149; Tue, 19 Apr 2016 09:56:45 -0700 (PDT) Return-Path: Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com. [2a00:1450:400c:c09::22a]) by mx.google.com with ESMTPS id e14si1145930wjz.208.2016.04.19.09.56.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Apr 2016 09:56:45 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 2a00:1450:400c:c09::22a as permitted sender) client-ip=2a00:1450:400c:c09::22a; 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::22a as permitted sender) smtp.mailfrom=eric.auger@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-wm0-x22a.google.com with SMTP id e201so21398521wme.0 for ; Tue, 19 Apr 2016 09:56:45 -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=n9TSRFiqD74+r4tAJSOCaCRZNJnYXr+wN0f2nmi+nDM=; b=S+MdF3d2O/UVcK/JOhOkQXFTX9KKit1ljFz9v1XXlfPAoovHs/SOt12A0JS/BPEc42 5IC2HNdUzKP97ZUagTWU2pHPCxgbcOJGkTCCk95NyjHK7a4Crx6RmCPF4dUOtVXasgCG eEcVu2iS7QNCYvMXEx247zh2CQyBPJhjk70jU= 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=n9TSRFiqD74+r4tAJSOCaCRZNJnYXr+wN0f2nmi+nDM=; b=QewUeGN56D/wVLmEoO2Sb7cczM0OhT32kqvqMRSdxaRHwTjLO861vHdQEkc4oA6gPg rWbHVw+fwrDDo7Eqm9iTYaOaXky4sLe8Xqk064h5M7OUnFUHJSME6tvEhgCgfLEmJh79 mQc547NUF2gaPCSYtktCJWKIeCq54hXtUxEM+8P6qGvFtqFo153mmbfMTpH5OLEfUTCm 0kawWwCUSEXRBm3oXrWah3YCnjTr1RrolyIHOlARtcvsd7fXJxCjtvBXavEYEMtrZtwo jERRqnMQ6ArLNGPVGLRyAVqdX7QfC7/KZHVz+A2D8llUSQjaZ5aEUJZDra/sunxP8Egn 4J6w== X-Gm-Message-State: AOPr4FW1WbOvfSVTH7WX6h7xffj3N9opWDGm4T3lWHScPdCRbeU05DYvoXyVsqoV8XNH7dfY8oc= X-Received: by 10.28.180.133 with SMTP id d127mr4805502wmf.45.1461085004862; Tue, 19 Apr 2016 09:56:44 -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.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Apr 2016 09:56:43 -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 01/10] iommu: Add DOMAIN_ATTR_MSI_MAPPING attribute Date: Tue, 19 Apr 2016 16:56:25 +0000 Message-Id: <1461084994-2355-2-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> 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 62a5eae..b3e8c5b 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -113,6 +113,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, };