lkml.org 
[lkml]   [2008]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 04/19] AMD IOMMU: make dma_ops_free_pagetable generic
    Date
    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>
    ---
    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 f3dd4cd..bec34fd 100644
    --- a/arch/x86/kernel/amd_iommu.c
    +++ b/arch/x86/kernel/amd_iommu.c
    @@ -584,12 +584,12 @@ static void dma_ops_reserve_addresses(struct dma_ops_domain *dom,
    iommu_area_reserve(dom->bitmap, start_page, pages);
    }

    -static void dma_ops_free_pagetable(struct dma_ops_domain *dma_dom)
    +static void free_pagetable(struct protection_domain *domain)
    {
    int i, j;
    u64 *p1, *p2, *p3;

    - p1 = dma_dom->domain.pt_root;
    + p1 = domain->pt_root;

    if (!p1)
    return;
    @@ -610,6 +610,8 @@ static void dma_ops_free_pagetable(struct dma_ops_domain *dma_dom)
    }

    free_page((unsigned long)p1);
    +
    + domain->pt_root = NULL;
    }

    /*
    @@ -621,7 +623,7 @@ static void dma_ops_domain_free(struct dma_ops_domain *dom)
    if (!dom)
    return;

    - dma_ops_free_pagetable(dom);
    + free_pagetable(&dom->domain);

    kfree(dom->pte_pages);

    --
    1.5.6.4



    \
     
     \ /
      Last update: 2008-12-04 19:13    [W:0.024 / U:59.632 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site