Skip to content

Commit

Permalink
iommu/vt-d: Make root entry visible for hardware right after allocation
Browse files Browse the repository at this point in the history
In case there was an old root entry, make our new one
visible immediately after it was allocated.

Tested-by: ZhenHua Li <zhen-hual@hp.com>
Tested-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Joerg Roedel committed Jun 16, 2015
1 parent b63d80d commit 5f0a7f7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/iommu/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2817,6 +2817,12 @@ static int __init init_dmars(void)
ret = iommu_alloc_root_entry(iommu);
if (ret)
goto free_iommu;

iommu_flush_write_buffer(iommu);
iommu_set_root_entry(iommu);
iommu->flush.flush_context(iommu, 0, 0, 0, DMA_CCMD_GLOBAL_INVL);
iommu->flush.flush_iotlb(iommu, 0, 0, 0, DMA_TLB_GLOBAL_FLUSH);

if (!ecap_pass_through(iommu->ecap))
hw_pass_through = 0;
}
Expand Down Expand Up @@ -2893,10 +2899,6 @@ static int __init init_dmars(void)
if (ret)
goto free_iommu;

iommu_set_root_entry(iommu);

iommu->flush.flush_context(iommu, 0, 0, 0, DMA_CCMD_GLOBAL_INVL);
iommu->flush.flush_iotlb(iommu, 0, 0, 0, DMA_TLB_GLOBAL_FLUSH);
iommu_enable_translation(iommu);
iommu_disable_protect_mem_regions(iommu);
}
Expand Down

0 comments on commit 5f0a7f7

Please sign in to comment.