diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2008-12-02 12:20:21 -0500 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2009-01-03 08:11:53 -0500 |
commit | 86db2e5d47bfa61a151d6ac83263f4bde4d52290 (patch) | |
tree | b6ff290a63a27205b565b39189d6fd4ce2b15703 | |
parent | 38e817febe2f12bd2fbf92a1df36f41946d0c223 (diff) |
AMD IOMMU: make dma_ops_free_pagetable generic
Impact: change code to free pagetables from protection domains
The dma_ops_free_pagetable function can only free pagetables from
dma_ops domains. Change that to free pagetables of pure protection
domains.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
-rw-r--r-- | arch/x86/kernel/amd_iommu.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index b11c855af7b4..8a0fd3d09973 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -587,12 +587,12 @@ static void dma_ops_reserve_addresses(struct dma_ops_domain *dom, | |||
587 | iommu_area_reserve(dom->bitmap, start_page, pages); | 587 | iommu_area_reserve(dom->bitmap, start_page, pages); |
588 | } | 588 | } |
589 | 589 | ||
590 | static void dma_ops_free_pagetable(struct dma_ops_domain *dma_dom) | 590 | static void free_pagetable(struct protection_domain *domain) |
591 | { | 591 | { |
592 | int i, j; | 592 | int i, j; |
593 | u64 *p1, *p2, *p3; | 593 | u64 *p1, *p2, *p3; |
594 | 594 | ||
595 | p1 = dma_dom->domain.pt_root; | 595 | p1 = domain->pt_root; |
596 | 596 | ||
597 | if (!p1) | 597 | if (!p1) |
598 | return; | 598 | return; |
@@ -613,6 +613,8 @@ static void dma_ops_free_pagetable(struct dma_ops_domain *dma_dom) | |||
613 | } | 613 | } |
614 | 614 | ||
615 | free_page((unsigned long)p1); | 615 | free_page((unsigned long)p1); |
616 | |||
617 | domain->pt_root = NULL; | ||
616 | } | 618 | } |
617 | 619 | ||
618 | /* | 620 | /* |
@@ -624,7 +626,7 @@ static void dma_ops_domain_free(struct dma_ops_domain *dom) | |||
624 | if (!dom) | 626 | if (!dom) |
625 | return; | 627 | return; |
626 | 628 | ||
627 | dma_ops_free_pagetable(dom); | 629 | free_pagetable(&dom->domain); |
628 | 630 | ||
629 | kfree(dom->pte_pages); | 631 | kfree(dom->pte_pages); |
630 | 632 | ||