summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/intel-iommu.c
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2015-06-12 09:18:53 +0200
committerJoerg Roedel <jroedel@suse.de>2015-06-16 10:59:34 +0200
commit5f0a7f7614a9d99325ac8d618f1cdf7a3014287c (patch)
tree6fec61fe80852313b1309f69c4afaa79dc64d46a /drivers/iommu/intel-iommu.c
parentb63d80d1e01e949dbe469e1d72fc0b7e173dbdd8 (diff)
downloadop-kernel-dev-5f0a7f7614a9d99325ac8d618f1cdf7a3014287c.zip
op-kernel-dev-5f0a7f7614a9d99325ac8d618f1cdf7a3014287c.tar.gz
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: ZhenHua Li <zhen-hual@hp.com> Tested-by: Baoquan He <bhe@redhat.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/intel-iommu.c')
-rw-r--r--drivers/iommu/intel-iommu.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 989761c..bf3e450 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -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;
}
@@ -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);
}
OpenPOWER on IntegriCloud