diff options
author | Sheng Yang <sheng@linux.intel.com> | 2010-06-12 07:21:42 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-06-15 05:40:02 -0400 |
commit | 25cbff1660d3f4c059a178a1e5b851be6d70c5e8 (patch) | |
tree | b0f43789d01fcb89041195550a582a41dfb979d7 /drivers/pci/intel-iommu.c | |
parent | 7e27d6e778cd87b6f2415515d7127eba53fe5d02 (diff) |
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: Allen Kay <allen.m.kay@intel.com>
Cc: Tom Lyon <pugs@cisco.com>
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/pci/intel-iommu.c')
-rw-r--r-- | drivers/pci/intel-iommu.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index 796828fce34c..3bd30557ce2e 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
@@ -3603,7 +3603,8 @@ static int intel_iommu_attach_device(struct iommu_domain *domain, | |||
3603 | pte = dmar_domain->pgd; | 3603 | pte = dmar_domain->pgd; |
3604 | if (dma_pte_present(pte)) { | 3604 | if (dma_pte_present(pte)) { |
3605 | free_pgtable_page(dmar_domain->pgd); | 3605 | free_pgtable_page(dmar_domain->pgd); |
3606 | dmar_domain->pgd = (struct dma_pte *)dma_pte_addr(pte); | 3606 | dmar_domain->pgd = (struct dma_pte *) |
3607 | phys_to_virt(dma_pte_addr(pte)); | ||
3607 | } | 3608 | } |
3608 | dmar_domain->agaw--; | 3609 | dmar_domain->agaw--; |
3609 | } | 3610 | } |