Skip to content

Commit 41b80db

Browse files
LuBaolujoergroedel
authored andcommitted
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: 7373a8c ("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>
1 parent d8b8591 commit 41b80db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/iommu/intel-iommu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2056,7 +2056,6 @@ static int domain_context_mapping_one(struct dmar_domain *domain,
20562056
int agaw;
20572057

20582058
context_set_domain_id(context, did);
2059-
context_set_translation_type(context, translation);
20602059

20612060
if (translation != CONTEXT_TT_PASS_THROUGH) {
20622061
/*
@@ -2086,6 +2085,8 @@ static int domain_context_mapping_one(struct dmar_domain *domain,
20862085
*/
20872086
context_set_address_width(context, iommu->msagaw);
20882087
}
2088+
2089+
context_set_translation_type(context, translation);
20892090
}
20902091

20912092
context_set_fault_enable(context);

0 commit comments

Comments
 (0)