diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2009-09-02 11:08:55 -0400 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2009-09-03 10:03:42 -0400 |
commit | a6d41a4027b758a9473197a78fab45afb31003aa (patch) | |
tree | 4b80b62f33819494b4c0fe9a446a0ee8c78cfcc2 | |
parent | 38a76eeeafb251bf67d143a34b37a8105cff302e (diff) |
x86/amd-iommu: Use fetch_pte in amd_iommu_iova_to_phys
Don't reimplement the page table walker in this function.
Use the generic one.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
-rw-r--r-- | arch/x86/kernel/amd_iommu.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index 5e5279899994..4a54366d422d 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -2140,21 +2140,9 @@ static phys_addr_t amd_iommu_iova_to_phys(struct iommu_domain *dom, | |||
2140 | phys_addr_t paddr; | 2140 | phys_addr_t paddr; |
2141 | u64 *pte; | 2141 | u64 *pte; |
2142 | 2142 | ||
2143 | pte = &domain->pt_root[IOMMU_PTE_L2_INDEX(iova)]; | 2143 | pte = fetch_pte(domain, iova); |
2144 | 2144 | ||
2145 | if (!IOMMU_PTE_PRESENT(*pte)) | 2145 | if (!pte || !IOMMU_PTE_PRESENT(*pte)) |
2146 | return 0; | ||
2147 | |||
2148 | pte = IOMMU_PTE_PAGE(*pte); | ||
2149 | pte = &pte[IOMMU_PTE_L1_INDEX(iova)]; | ||
2150 | |||
2151 | if (!IOMMU_PTE_PRESENT(*pte)) | ||
2152 | return 0; | ||
2153 | |||
2154 | pte = IOMMU_PTE_PAGE(*pte); | ||
2155 | pte = &pte[IOMMU_PTE_L0_INDEX(iova)]; | ||
2156 | |||
2157 | if (!IOMMU_PTE_PRESENT(*pte)) | ||
2158 | return 0; | 2146 | return 0; |
2159 | 2147 | ||
2160 | paddr = *pte & IOMMU_PAGE_MASK; | 2148 | paddr = *pte & IOMMU_PAGE_MASK; |