Commit a2bb8459 authored by Weidong Han's avatar Weidong Han Committed by Joerg Roedel

Get iommu from g_iommus for deferred flush

deferred_flush[] uses the iommu seq_id to index, so its iommu is fixed and can get it from g_iommus.
Signed-off-by: default avatarWeidong Han <weidong.han@intel.com>
Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
parent d9630fe9
...@@ -2101,10 +2101,11 @@ static void flush_unmaps(void) ...@@ -2101,10 +2101,11 @@ static void flush_unmaps(void)
/* just flush them all */ /* just flush them all */
for (i = 0; i < g_num_of_iommus; i++) { for (i = 0; i < g_num_of_iommus; i++) {
if (deferred_flush[i].next) { struct intel_iommu *iommu = g_iommus[i];
struct intel_iommu *iommu = if (!iommu)
deferred_flush[i].domain[0]->iommu; continue;
if (deferred_flush[i].next) {
iommu->flush.flush_iotlb(iommu, 0, 0, 0, iommu->flush.flush_iotlb(iommu, 0, 0, 0,
DMA_TLB_GLOBAL_FLUSH, 0); DMA_TLB_GLOBAL_FLUSH, 0);
for (j = 0; j < deferred_flush[i].next; j++) { for (j = 0; j < deferred_flush[i].next; j++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment