提交 25cbff16 编写于 作者: S Sheng Yang 提交者: David Woodhouse

intel-iommu: Fix reference by physical address in intel_iommu_attach_device()

Commit a99c47a2 "intel-iommu: errors with smaller iommu widths" replace the
dmar_domain->pgd with the first entry of page table when iommu's supported
width is smaller than dmar_domain's. But it use physical address directly
for new dmar_domain->pgd...

This result in KVM oops with VT-d on some machines.
Reported-by: NAllen Kay <allen.m.kay@intel.com>
Cc: Tom Lyon <pugs@cisco.com>
Signed-off-by: NSheng Yang <sheng@linux.intel.com>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 7e27d6e7
...@@ -3603,7 +3603,8 @@ static int intel_iommu_attach_device(struct iommu_domain *domain, ...@@ -3603,7 +3603,8 @@ static int intel_iommu_attach_device(struct iommu_domain *domain,
pte = dmar_domain->pgd; pte = dmar_domain->pgd;
if (dma_pte_present(pte)) { if (dma_pte_present(pte)) {
free_pgtable_page(dmar_domain->pgd); free_pgtable_page(dmar_domain->pgd);
dmar_domain->pgd = (struct dma_pte *)dma_pte_addr(pte); dmar_domain->pgd = (struct dma_pte *)
phys_to_virt(dma_pte_addr(pte));
} }
dmar_domain->agaw--; dmar_domain->agaw--;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册