diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2009-06-27 12:14:59 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-06-29 07:38:38 -0400 |
commit | 90dcfb5eb2fd427b16135a14f176a6902750b6b4 (patch) | |
tree | 2951f2a7e9dab02127005937c92dfa8dc0e03e07 /drivers/pci/intel-iommu.c | |
parent | 77dfa56c94d2855a25ff552b74980a5538e129f8 (diff) |
intel-iommu: Change dma_addr_level_pte() to dma_pfn_level_pte()
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 | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index 529c1c13048f..edd39d348a98 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
@@ -740,8 +740,9 @@ static struct dma_pte * addr_to_dma_pte(struct dmar_domain *domain, u64 addr) | |||
740 | } | 740 | } |
741 | 741 | ||
742 | /* return address's pte at specific level */ | 742 | /* return address's pte at specific level */ |
743 | static struct dma_pte *dma_addr_level_pte(struct dmar_domain *domain, u64 addr, | 743 | static struct dma_pte *dma_pfn_level_pte(struct dmar_domain *domain, |
744 | int level) | 744 | unsigned long pfn, |
745 | int level) | ||
745 | { | 746 | { |
746 | struct dma_pte *parent, *pte = NULL; | 747 | struct dma_pte *parent, *pte = NULL; |
747 | int total = agaw_to_level(domain->agaw); | 748 | int total = agaw_to_level(domain->agaw); |
@@ -749,7 +750,7 @@ static struct dma_pte *dma_addr_level_pte(struct dmar_domain *domain, u64 addr, | |||
749 | 750 | ||
750 | parent = domain->pgd; | 751 | parent = domain->pgd; |
751 | while (level <= total) { | 752 | while (level <= total) { |
752 | offset = pfn_level_offset(addr >> VTD_PAGE_SHIFT, total); | 753 | offset = pfn_level_offset(pfn, total); |
753 | pte = &parent[offset]; | 754 | pte = &parent[offset]; |
754 | if (level == total) | 755 | if (level == total) |
755 | return pte; | 756 | return pte; |
@@ -768,7 +769,7 @@ static void dma_pte_clear_one(struct dmar_domain *domain, u64 addr) | |||
768 | struct dma_pte *pte = NULL; | 769 | struct dma_pte *pte = NULL; |
769 | 770 | ||
770 | /* get last level pte */ | 771 | /* get last level pte */ |
771 | pte = dma_addr_level_pte(domain, addr, 1); | 772 | pte = dma_pfn_level_pte(domain, addr >> VTD_PAGE_SHIFT, 1); |
772 | 773 | ||
773 | if (pte) { | 774 | if (pte) { |
774 | dma_clear_pte(pte); | 775 | dma_clear_pte(pte); |
@@ -817,7 +818,8 @@ static void dma_pte_free_pagetable(struct dmar_domain *domain, | |||
817 | return; | 818 | return; |
818 | 819 | ||
819 | while (tmp < end) { | 820 | while (tmp < end) { |
820 | pte = dma_addr_level_pte(domain, tmp, level); | 821 | pte = dma_pfn_level_pte(domain, tmp >> VTD_PAGE_SHIFT, |
822 | level); | ||
821 | if (pte) { | 823 | if (pte) { |
822 | free_pgtable_page( | 824 | free_pgtable_page( |
823 | phys_to_virt(dma_pte_addr(pte))); | 825 | phys_to_virt(dma_pte_addr(pte))); |