Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190976
b: refs/heads/master
c: f03152b
h: refs/heads/master
v: v3
  • Loading branch information
Joerg Roedel committed Mar 7, 2010
1 parent 7f67fbe commit 05f1941
Show file tree
Hide file tree
Showing 2 changed files with 10 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: 24cd772315c19e4d9409d0d21367ec1ebab3149f
refs/heads/master: f03152bb7d0a74f409ad63ed36916444a7493d72
13 changes: 9 additions & 4 deletions trunk/arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2556,17 +2556,22 @@ static phys_addr_t amd_iommu_iova_to_phys(struct iommu_domain *dom,
unsigned long iova)
{
struct protection_domain *domain = dom->priv;
unsigned long offset = iova & ~PAGE_MASK;
unsigned long offset_mask;
phys_addr_t paddr;
u64 *pte;
u64 *pte, __pte;

pte = fetch_pte(domain, iova);

if (!pte || !IOMMU_PTE_PRESENT(*pte))
return 0;

paddr = *pte & IOMMU_PAGE_MASK;
paddr |= offset;
if (PM_PTE_LEVEL(*pte) == 0)
offset_mask = PAGE_SIZE - 1;
else
offset_mask = PTE_PAGE_SIZE(*pte) - 1;

__pte = *pte & PM_ADDR_MASK;
paddr = (__pte & ~offset_mask) | (iova & offset_mask);

return paddr;
}
Expand Down

0 comments on commit 05f1941

Please sign in to comment.