aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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/*