From: Eric Auger <eric.auger@redhat.com>
To: eric.auger@redhat.com, eric.auger.pro@gmail.com,
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: 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, yehuday@marvell.com
Subject: [PATCH v10 2/8] iommu/arm-smmu: initialize the msi geometry and advertise iommu-msi support
Date: Tue, 7 Jun 2016 15:59:16 +0000 [thread overview]
Message-ID: <1465315162-5888-3-git-send-email-eric.auger@redhat.com> (raw)
In-Reply-To: <1465315162-5888-1-git-send-email-eric.auger@redhat.com>
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_GEOMETRY advertises the support of
the IOMMU-MSI API.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
---
v8 -> v9:
- reword the title and patch description
v7 -> v8:
- use DOMAIN_ATTR_MSI_GEOMETRY
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 | 3 +++
2 files changed, 5 insertions(+)
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 94b6821..8eb002e 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -1397,6 +1397,7 @@ static bool arm_smmu_capable(enum iommu_cap cap)
static struct iommu_domain *arm_smmu_domain_alloc(unsigned type)
{
struct arm_smmu_domain *smmu_domain;
+ struct iommu_domain_msi_geometry msi_geometry = {0, 0, true};
if (type != IOMMU_DOMAIN_UNMANAGED && type != IOMMU_DOMAIN_DMA)
return NULL;
@@ -1415,6 +1416,7 @@ static struct iommu_domain *arm_smmu_domain_alloc(unsigned type)
kfree(smmu_domain);
return NULL;
}
+ smmu_domain->domain.msi_geometry = msi_geometry;
mutex_init(&smmu_domain->init_mutex);
spin_lock_init(&smmu_domain->pgtbl_lock);
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 9345a3f..9755a1b 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -1038,6 +1038,7 @@ static void arm_smmu_destroy_domain_context(struct iommu_domain *domain)
static struct iommu_domain *arm_smmu_domain_alloc(unsigned type)
{
struct arm_smmu_domain *smmu_domain;
+ struct iommu_domain_msi_geometry msi_geometry = {0, 0, true};
if (type != IOMMU_DOMAIN_UNMANAGED && type != IOMMU_DOMAIN_DMA)
return NULL;
@@ -1056,6 +1057,8 @@ static struct iommu_domain *arm_smmu_domain_alloc(unsigned type)
return NULL;
}
+ smmu_domain->domain.msi_geometry = msi_geometry;
+
mutex_init(&smmu_domain->init_mutex);
spin_lock_init(&smmu_domain->pgtbl_lock);
--
1.9.1
next prev parent reply other threads:[~2016-06-07 15:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-07 15:59 [PATCH v10 0/8] KVM PCIe/MSI passthrough on ARM/ARM64: kernel part 1/3: iommu changes Eric Auger
2016-06-07 15:59 ` [PATCH v10 1/8] iommu: Add iommu_domain_msi_geometry and DOMAIN_ATTR_MSI_GEOMETRY Eric Auger
2016-06-07 15:59 ` Eric Auger [this message]
2016-06-07 15:59 ` [PATCH v10 3/8] iommu: introduce an msi cookie Eric Auger
2016-06-07 15:59 ` [PATCH v10 4/8] iommu/msi-iommu: initialization Eric Auger
2016-06-07 15:59 ` [PATCH v10 5/8] iommu/msi-iommu: iommu_msi_[get,put]_doorbell_iova Eric Auger
2016-06-07 15:59 ` [PATCH v10 6/8] iommu/msi-iommu: iommu_msi_domain Eric Auger
2016-06-07 15:59 ` [PATCH v10 7/8] iommu/msi-iommu: iommu_msi_msg_pa_to_va Eric Auger
2016-06-07 15:59 ` [PATCH v10 8/8] iommu/arm-smmu: get/put the msi cookie Eric Auger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1465315162-5888-3-git-send-email-eric.auger@redhat.com \
--to=eric.auger@redhat.com \
--cc=Bharat.Bhushan@freescale.com \
--cc=Jean-Philippe.Brucker@arm.com \
--cc=alex.williamson@redhat.com \
--cc=christoffer.dall@linaro.org \
--cc=eric.auger.pro@gmail.com \
--cc=iommu@lists.linux-foundation.org \
--cc=jason@lakedaemon.net \
--cc=joro@8bytes.org \
--cc=julien.grall@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=p.fedin@samsung.com \
--cc=pranav.sawargaonkar@gmail.com \
--cc=robin.murphy@arm.com \
--cc=tglx@linutronix.de \
--cc=will.deacon@arm.com \
--cc=yehuday@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).