Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154767
b: refs/heads/master
c: 04b18e6
h: refs/heads/master
i:
  154765: e1a829c
  154763: 754afc3
  154759: 998da21
  154751: 5d4bc1d
v: v3
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jun 29, 2009
1 parent b6e3f93 commit 491d4c7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 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: 66eae8469e4e4ba6f4ca7ef82103c78f6d645583
refs/heads/master: 04b18e65dd5a3e544f07f4bcfa8fb52704a1833b
22 changes: 9 additions & 13 deletions trunk/drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,21 +779,17 @@ static void dma_pte_clear_one(struct dmar_domain *domain, unsigned long pfn)
/* clear last level pte, a tlb flush should be followed */
static void dma_pte_clear_range(struct dmar_domain *domain, u64 start, u64 end)
{
int addr_width = agaw_to_width(domain->agaw);
int npages;

BUG_ON(start >> addr_width);
BUG_ON((end-1) >> addr_width);
unsigned long start_pfn = IOVA_PFN(start);
unsigned long end_pfn = IOVA_PFN(end-1);
int addr_width = agaw_to_width(domain->agaw) - VTD_PAGE_SHIFT;

/* in case it's partial page */
start &= PAGE_MASK;
end = PAGE_ALIGN(end);
npages = (end - start) / VTD_PAGE_SIZE;
BUG_ON(addr_width < BITS_PER_LONG && start_pfn >> addr_width);
BUG_ON(addr_width < BITS_PER_LONG && end_pfn >> addr_width);

/* we don't need lock here, nobody else touches the iova range */
while (npages--) {
dma_pte_clear_one(domain, start >> VTD_PAGE_SHIFT);
start += VTD_PAGE_SIZE;
/* we don't need lock here; nobody else touches the iova range */
while (start_pfn <= end_pfn) {
dma_pte_clear_one(domain, start_pfn);
start_pfn++;
}
}

Expand Down

0 comments on commit 491d4c7

Please sign in to comment.