Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165430
b: refs/heads/master
c: 59c3628
h: refs/heads/master
v: v3
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Sep 19, 2009
1 parent 3d6c66f commit f69b394
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2ebe31513fcbe7a781f27002f065b50ae195022f
refs/heads/master: 59c36286b74ae6a8adebf6e133a83d7f2e3e6704
11 changes: 7 additions & 4 deletions trunk/drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,9 +785,10 @@ static void dma_pte_clear_range(struct dmar_domain *domain,

BUG_ON(addr_width < BITS_PER_LONG && start_pfn >> addr_width);
BUG_ON(addr_width < BITS_PER_LONG && last_pfn >> addr_width);
BUG_ON(start_pfn > last_pfn);

/* we don't need lock here; nobody else touches the iova range */
while (start_pfn <= last_pfn) {
do {
first_pte = pte = dma_pfn_level_pte(domain, start_pfn, 1);
if (!pte) {
start_pfn = align_to_level(start_pfn + 1, 2);
Expand All @@ -801,7 +802,8 @@ static void dma_pte_clear_range(struct dmar_domain *domain,

domain_flush_cache(domain, first_pte,
(void *)pte - (void *)first_pte);
}

} while (start_pfn && start_pfn <= last_pfn);
}

/* free page table pages. last level pte should already be cleared */
Expand All @@ -817,6 +819,7 @@ static void dma_pte_free_pagetable(struct dmar_domain *domain,

BUG_ON(addr_width < BITS_PER_LONG && start_pfn >> addr_width);
BUG_ON(addr_width < BITS_PER_LONG && last_pfn >> addr_width);
BUG_ON(start_pfn > last_pfn);

/* We don't need lock here; nobody else touches the iova range */
level = 2;
Expand All @@ -827,7 +830,7 @@ static void dma_pte_free_pagetable(struct dmar_domain *domain,
if (tmp + level_size(level) - 1 > last_pfn)
return;

while (tmp + level_size(level) - 1 <= last_pfn) {
do {
first_pte = pte = dma_pfn_level_pte(domain, tmp, level);
if (!pte) {
tmp = align_to_level(tmp + 1, level + 1);
Expand All @@ -846,7 +849,7 @@ static void dma_pte_free_pagetable(struct dmar_domain *domain,
domain_flush_cache(domain, first_pte,
(void *)pte - (void *)first_pte);

}
} while (tmp && tmp + level_size(level) - 1 <= last_pfn);
level++;
}
/* free pgd */
Expand Down

0 comments on commit f69b394

Please sign in to comment.