Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264415
b: refs/heads/master
c: 292827c
h: refs/heads/master
i:
  264413: dfd75d0
  264411: 598596e
  264407: 8d82fcd
  264399: ae3663f
  264383: 5086f7f
v: v3
  • Loading branch information
Allen Kay authored and David Woodhouse committed Oct 19, 2011
1 parent 524de55 commit c538b90
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 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: 3fb39615007d0645ad7f3a509d7120a1987d95b2
refs/heads/master: 292827cb164ad00cc7689a21283b1261c0b6daed
11 changes: 8 additions & 3 deletions trunk/drivers/iommu/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,13 +819,14 @@ static struct dma_pte *dma_pfn_level_pte(struct dmar_domain *domain,
}

/* clear last level pte, a tlb flush should be followed */
static void dma_pte_clear_range(struct dmar_domain *domain,
static int dma_pte_clear_range(struct dmar_domain *domain,
unsigned long start_pfn,
unsigned long last_pfn)
{
int addr_width = agaw_to_width(domain->agaw) - VTD_PAGE_SHIFT;
unsigned int large_page = 1;
struct dma_pte *first_pte, *pte;
int order;

BUG_ON(addr_width < BITS_PER_LONG && start_pfn >> addr_width);
BUG_ON(addr_width < BITS_PER_LONG && last_pfn >> addr_width);
Expand All @@ -849,6 +850,9 @@ static void dma_pte_clear_range(struct dmar_domain *domain,
(void *)pte - (void *)first_pte);

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

order = (large_page - 1) * 9;
return order;
}

/* free page table pages. last level pte should already be cleared */
Expand Down Expand Up @@ -3869,14 +3873,15 @@ static int intel_iommu_unmap(struct iommu_domain *domain,
{
struct dmar_domain *dmar_domain = domain->priv;
size_t size = PAGE_SIZE << gfp_order;
int order;

dma_pte_clear_range(dmar_domain, iova >> VTD_PAGE_SHIFT,
order = dma_pte_clear_range(dmar_domain, iova >> VTD_PAGE_SHIFT,
(iova + size - 1) >> VTD_PAGE_SHIFT);

if (dmar_domain->max_addr == iova + size)
dmar_domain->max_addr = iova;

return gfp_order;
return order;
}

static phys_addr_t intel_iommu_iova_to_phys(struct iommu_domain *domain,
Expand Down

0 comments on commit c538b90

Please sign in to comment.