summaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorLu Baolu <baolu.lu@linux.intel.com>2019-02-28 22:23:11 -0500
committerJoerg Roedel <jroedel@suse.de>2019-03-01 04:23:35 -0500
commit41b80db227993394f210f0eb705a326db5f605b6 (patch)
tree279b488d3ea250a190bd7f643c21d9c8ef731ed1 /drivers/iommu
parentd8b8591054575f33237556c32762d54e30774d28 (diff)
iommu/vt-d: Set context field after value initialized
Otherwise, the translation type field of a context entry for a PCI device will always be 0. All translated DMA requests will be blocked by IOMMU. As the result, the PCI devices with PCI ATS (device IOTBL) support won't work as expected. Cc: Ashok Raj <ashok.raj@intel.com> Cc: Jacob Pan <jacob.jun.pan@linux.intel.com> Suggested-by: Kevin Tian <kevin.tian@intel.com> Fixes: 7373a8cc38197 ("iommu/vt-d: Setup context and enable RID2PASID support") Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/intel-iommu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 64ce780336a8..d7f10fd4ac2d 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -2056,7 +2056,6 @@ static int domain_context_mapping_one(struct dmar_domain *domain,
2056 int agaw; 2056 int agaw;
2057 2057
2058 context_set_domain_id(context, did); 2058 context_set_domain_id(context, did);
2059 context_set_translation_type(context, translation);
2060 2059
2061 if (translation != CONTEXT_TT_PASS_THROUGH) { 2060 if (translation != CONTEXT_TT_PASS_THROUGH) {
2062 /* 2061 /*
@@ -2086,6 +2085,8 @@ static int domain_context_mapping_one(struct dmar_domain *domain,
2086 */ 2085 */
2087 context_set_address_width(context, iommu->msagaw); 2086 context_set_address_width(context, iommu->msagaw);
2088 } 2087 }
2088
2089 context_set_translation_type(context, translation);
2089 } 2090 }
2090 2091
2091 context_set_fault_enable(context); 2092 context_set_fault_enable(context);