aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2009-09-02 11:02:47 -0400
committerJoerg Roedel <joerg.roedel@amd.com>2009-09-03 10:03:41 -0400
commit38a76eeeafb251bf67d143a34b37a8105cff302e (patch)
treef5fbe58002425e7424937678fd87b35f9e3c9280 /arch
parent9355a08186e52b7c120adea91c984923b54efa10 (diff)
x86/amd-iommu: Use fetch_pte in iommu_unmap_page
Instead of reimplementing existing logic use fetch_pte to walk the page table in iommu_unmap_page. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/amd_iommu.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 29bcd358b6ce..5e5279899994 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -546,23 +546,10 @@ static int iommu_map_page(struct protection_domain *dom,
546static void iommu_unmap_page(struct protection_domain *dom, 546static void iommu_unmap_page(struct protection_domain *dom,
547 unsigned long bus_addr) 547 unsigned long bus_addr)
548{ 548{
549 u64 *pte; 549 u64 *pte = fetch_pte(dom, bus_addr);
550
551 pte = &dom->pt_root[IOMMU_PTE_L2_INDEX(bus_addr)];
552
553 if (!IOMMU_PTE_PRESENT(*pte))
554 return;
555
556 pte = IOMMU_PTE_PAGE(*pte);
557 pte = &pte[IOMMU_PTE_L1_INDEX(bus_addr)];
558
559 if (!IOMMU_PTE_PRESENT(*pte))
560 return;
561
562 pte = IOMMU_PTE_PAGE(*pte);
563 pte = &pte[IOMMU_PTE_L1_INDEX(bus_addr)];
564 550
565 *pte = 0; 551 if (pte)
552 *pte = 0;
566} 553}
567 554
568/* 555/*