diff options
author | Joerg Roedel <jroedel@suse.de> | 2015-06-12 03:18:53 -0400 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2015-06-16 04:59:34 -0400 |
commit | 5f0a7f7614a9d99325ac8d618f1cdf7a3014287c (patch) | |
tree | 6fec61fe80852313b1309f69c4afaa79dc64d46a | |
parent | b63d80d1e01e949dbe469e1d72fc0b7e173dbdd8 (diff) |
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>
-rw-r--r-- | drivers/iommu/intel-iommu.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 989761c8f017..bf3e450b5b97 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c | |||
@@ -2817,6 +2817,12 @@ static int __init init_dmars(void) | |||
2817 | ret = iommu_alloc_root_entry(iommu); | 2817 | ret = iommu_alloc_root_entry(iommu); |
2818 | if (ret) | 2818 | if (ret) |
2819 | goto free_iommu; | 2819 | goto free_iommu; |
2820 | |||
2821 | iommu_flush_write_buffer(iommu); | ||
2822 | iommu_set_root_entry(iommu); | ||
2823 | iommu->flush.flush_context(iommu, 0, 0, 0, DMA_CCMD_GLOBAL_INVL); | ||
2824 | iommu->flush.flush_iotlb(iommu, 0, 0, 0, DMA_TLB_GLOBAL_FLUSH); | ||
2825 | |||
2820 | if (!ecap_pass_through(iommu->ecap)) | 2826 | if (!ecap_pass_through(iommu->ecap)) |
2821 | hw_pass_through = 0; | 2827 | hw_pass_through = 0; |
2822 | } | 2828 | } |
@@ -2893,10 +2899,6 @@ static int __init init_dmars(void) | |||
2893 | if (ret) | 2899 | if (ret) |
2894 | goto free_iommu; | 2900 | goto free_iommu; |
2895 | 2901 | ||
2896 | iommu_set_root_entry(iommu); | ||
2897 | |||
2898 | iommu->flush.flush_context(iommu, 0, 0, 0, DMA_CCMD_GLOBAL_INVL); | ||
2899 | iommu->flush.flush_iotlb(iommu, 0, 0, 0, DMA_TLB_GLOBAL_FLUSH); | ||
2900 | iommu_enable_translation(iommu); | 2902 | iommu_enable_translation(iommu); |
2901 | iommu_disable_protect_mem_regions(iommu); | 2903 | iommu_disable_protect_mem_regions(iommu); |
2902 | } | 2904 | } |