intel-iommu: Change dma_addr_level_pte() to dma_pfn_level_pte()

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git-commits-head@...>
Date: Friday, July 3, 2009 - 5:59 pm

Gitweb:     http://git.kernel.org/linus/90dcfb5eb2fd427b16135a14f176a6902750b6b4
Commit:     90dcfb5eb2fd427b16135a14f176a6902750b6b4
Parent:     77dfa56c94d2855a25ff552b74980a5538e129f8
Author:     David Woodhouse <David.Woodhouse@intel.com>
AuthorDate: Sat Jun 27 17:14:59 2009 +0100
Committer:  David Woodhouse <David.Woodhouse@intel.com>
CommitDate: Mon Jun 29 12:38:38 2009 +0100

    intel-iommu: Change dma_addr_level_pte() to dma_pfn_level_pte()
    
    Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
---
 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 529c1c1..edd39d3 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)
 }
 
 /* return address's pte at specific level */
-static struct dma_pte *dma_addr_level_pte(struct dmar_domain *domain, u64 addr,
-		int level)
+static struct dma_pte *dma_pfn_level_pte(struct dmar_domain *domain,
+					 unsigned long pfn,
+					 int level)
 {
 	struct dma_pte *parent, *pte = NULL;
 	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,
 
 	parent = domain->pgd;
 	while (level <= total) {
-		offset = pfn_level_offset(addr >> VTD_PAGE_SHIFT, total);
+		offset = pfn_level_offset(pfn, total);
 		pte = &parent[offset];
 		if (level == total)
 			return pte;
@@ -768,7 +769,7 @@ static void dma_pte_clear_one(struct dmar_domain *domain, u64 addr)
 	struct dma_pte *pte = NULL;
 
 	/* get last level pte */
-	pte = dma_addr_level_pte(domain, addr, 1);
+	pte = dma_pfn_level_pte(domain, addr >> VTD_PAGE_SHIFT, 1);
 
 	if (pte) {
 		dma_clear_pte(pte);
@@ -817,7 +818,8 @@ static void dma_pte_free_pagetable(struct dmar_domain *domain,
 			return;
 
 		while (tmp < end) {
-			pte = dma_addr_level_pte(domain, tmp, level);
+			pte = dma_pfn_level_pte(domain, tmp >> VTD_PAGE_SHIFT,
+						level);
 			if (pte) {
 				free_pgtable_page(
 					phys_to_virt(dma_pte_addr(pte)));
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
intel-iommu: Change dma_addr_level_pte() to dma_pfn_level_pt..., Linux Kernel Mailing List..., (Fri Jul 3, 5:59 pm)