Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154766
b: refs/heads/master
c: 66eae84
h: refs/heads/master
v: v3
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jun 29, 2009
1 parent e1a829c commit b6e3f93
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 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: a75f7cf94f01717c5103138319b96752ee2a2be9
refs/heads/master: 66eae8469e4e4ba6f4ca7ef82103c78f6d645583
14 changes: 7 additions & 7 deletions trunk/drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,8 +700,7 @@ static struct dma_pte * addr_to_dma_pte(struct dmar_domain *domain, u64 addr)
unsigned long flags;

BUG_ON(!domain->pgd);

addr &= (((u64)1) << addr_width) - 1;
BUG_ON(addr >> addr_width);
parent = domain->pgd;

spin_lock_irqsave(&domain->mapping_lock, flags);
Expand Down Expand Up @@ -783,8 +782,9 @@ static void dma_pte_clear_range(struct dmar_domain *domain, u64 start, u64 end)
int addr_width = agaw_to_width(domain->agaw);
int npages;

start &= (((u64)1) << addr_width) - 1;
end &= (((u64)1) << addr_width) - 1;
BUG_ON(start >> addr_width);
BUG_ON((end-1) >> addr_width);

/* in case it's partial page */
start &= PAGE_MASK;
end = PAGE_ALIGN(end);
Expand All @@ -807,8 +807,8 @@ static void dma_pte_free_pagetable(struct dmar_domain *domain,
int level;
u64 tmp;

start &= (((u64)1) << addr_width) - 1;
end &= (((u64)1) << addr_width) - 1;
BUG_ON(start >> addr_width);
BUG_ON(end >> addr_width);

/* we don't need lock here, nobody else touches the iova range */
level = 2;
Expand Down Expand Up @@ -1654,7 +1654,7 @@ domain_page_mapping(struct dmar_domain *domain, dma_addr_t iova,
int index;
int addr_width = agaw_to_width(domain->agaw);

hpa &= (((u64)1) << addr_width) - 1;
BUG_ON(hpa >> addr_width);

if ((prot & (DMA_PTE_READ|DMA_PTE_WRITE)) == 0)
return -EINVAL;
Expand Down

0 comments on commit b6e3f93

Please sign in to comment.