Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154763
b: refs/heads/master
c: 77dfa56
h: refs/heads/master
i:
  154761: 56a281a
  154759: 998da21
v: v3
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jun 29, 2009
1 parent 8a99202 commit 754afc3
Show file tree
Hide file tree
Showing 2 changed files with 5 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: dd4e831960e4f0214480fa96a53ca9bb7dd04927
refs/heads/master: 77dfa56c94d2855a25ff552b74980a5538e129f8
8 changes: 4 additions & 4 deletions trunk/drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,9 @@ static inline unsigned int level_to_offset_bits(int level)
return (12 + (level - 1) * LEVEL_STRIDE);
}

static inline int address_level_offset(u64 addr, int level)
static inline int pfn_level_offset(unsigned long pfn, int level)
{
return ((addr >> level_to_offset_bits(level)) & LEVEL_MASK);
return (pfn >> (level_to_offset_bits(level) - 12)) & LEVEL_MASK;
}

static inline u64 level_mask(int level)
Expand Down Expand Up @@ -708,7 +708,7 @@ static struct dma_pte * addr_to_dma_pte(struct dmar_domain *domain, u64 addr)
while (level > 0) {
void *tmp_page;

offset = address_level_offset(addr, level);
offset = pfn_level_offset(addr >> VTD_PAGE_SHIFT, level);
pte = &parent[offset];
if (level == 1)
break;
Expand Down Expand Up @@ -749,7 +749,7 @@ static struct dma_pte *dma_addr_level_pte(struct dmar_domain *domain, u64 addr,

parent = domain->pgd;
while (level <= total) {
offset = address_level_offset(addr, total);
offset = pfn_level_offset(addr >> VTD_PAGE_SHIFT, total);
pte = &parent[offset];
if (level == total)
return pte;
Expand Down

0 comments on commit 754afc3

Please sign in to comment.