Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1389844
| From | Eric Auger <eric.auger@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v8 2/8] iommu/arm-smmu: sets the MSI geometry to programmable |
| Date | 2016-04-28 10:20 +0200 |
| Message-ID | <rsPl0-8pu-15@gated-at.bofh.it> (permalink) |
| References | <rsPl0-8pu-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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 a programmable
MSI IOVA region.
Signed-off-by: Eric Auger <eric.auger@linaro.org>
---
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 4ff73ff..bf222b5 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -1396,6 +1396,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;
@@ -1414,6 +1415,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 7c39ac4..55f429d 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -976,6 +976,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;
@@ -994,6 +995,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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v8 0/8] KVM PCIe/MSI passthrough on ARM/ARM64: kernel part 1/3: iommu changes Eric Auger <eric.auger@linaro.org> - 2016-04-28 10:20 +0200
[PATCH v8 2/8] iommu/arm-smmu: sets the MSI geometry to programmable Eric Auger <eric.auger@linaro.org> - 2016-04-28 10:20 +0200
[PATCH v8 3/8] iommu: introduce an msi cookie Eric Auger <eric.auger@linaro.org> - 2016-04-28 10:20 +0200
[PATCH v8 7/8] iommu/msi-iommu: iommu_msi_msg_pa_to_va Eric Auger <eric.auger@linaro.org> - 2016-04-28 10:20 +0200
[PATCH v8 5/8] iommu/msi-iommu: iommu_msi_[get,put]_doorbell_iova Eric Auger <eric.auger@linaro.org> - 2016-04-28 10:20 +0200
[PATCH v8 8/8] iommu/arm-smmu: get/put the msi cookie Eric Auger <eric.auger@linaro.org> - 2016-04-28 10:20 +0200
[PATCH v8 6/8] iommu/msi-iommu: iommu_msi_domain Eric Auger <eric.auger@linaro.org> - 2016-04-28 10:20 +0200
Re: [PATCH v8 6/8] iommu/msi-iommu: iommu_msi_domain Alex Williamson <alex.williamson@redhat.com> - 2016-04-29 00:30 +0200
Re: [PATCH v8 6/8] iommu/msi-iommu: iommu_msi_domain Eric Auger <eric.auger@linaro.org> - 2016-05-02 17:50 +0200
Re: [PATCH v8 6/8] iommu/msi-iommu: iommu_msi_domain Alex Williamson <alex.williamson@redhat.com> - 2016-05-02 22:30 +0200
Re: [PATCH v8 6/8] iommu/msi-iommu: iommu_msi_domain Eric Auger <eric.auger@linaro.org> - 2016-05-03 14:30 +0200
[PATCH v8 4/8] iommu/msi-iommu: initialization Eric Auger <eric.auger@linaro.org> - 2016-04-28 10:20 +0200
[PATCH v8 1/8] iommu: Add iommu_domain_msi_geometry and DOMAIN_ATTR_MSI_GEOMETRY Eric Auger <eric.auger@linaro.org> - 2016-04-28 10:20 +0200
csiph-web