Commit 5f0a7f76 authored by Joerg Roedel's avatar Joerg Roedel

iommu/vt-d: Make root entry visible for hardware right after allocation

In case there was an old root entry, make our new one
visible immediately after it was allocated.
Tested-by: default avatarZhenHua Li <zhen-hual@hp.com>
Tested-by: default avatarBaoquan He <bhe@redhat.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent b63d80d1
...@@ -2817,6 +2817,12 @@ static int __init init_dmars(void) ...@@ -2817,6 +2817,12 @@ static int __init init_dmars(void)
ret = iommu_alloc_root_entry(iommu); ret = iommu_alloc_root_entry(iommu);
if (ret) if (ret)
goto free_iommu; 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)) if (!ecap_pass_through(iommu->ecap))
hw_pass_through = 0; hw_pass_through = 0;
} }
...@@ -2893,10 +2899,6 @@ static int __init init_dmars(void) ...@@ -2893,10 +2899,6 @@ static int __init init_dmars(void)
if (ret) if (ret)
goto free_iommu; 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_enable_translation(iommu);
iommu_disable_protect_mem_regions(iommu); iommu_disable_protect_mem_regions(iommu);
} }
......
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