summaryrefslogtreecommitdiff
path: root/drivers/iommu/io-pgtable-arm.c
diff options
context:
space:
mode:
authorMitchel Humpherys <mitchelh@codeaurora.org>2015-07-15 18:25:07 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:13:39 -0700
commitc84f867d941dcc5827f324c1c3b12c709b1c54d6 (patch)
tree58ad439ed74fa09fe44a4b3f10c110d219f5e7a9 /drivers/iommu/io-pgtable-arm.c
parent3053a46e6f2f9077260c6f5df8290d59a765fc4b (diff)
iommu/io-pgtable: Add memory stats debugfs file
It can be useful for debugging to know how much memory is being used for IOMMU page tables. Add some dedicated allocation functions and a debugfs file for this. Change-Id: Id69b4b1b5df5dcc6c604eec3a12a894b8eab0eb6 Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Diffstat (limited to 'drivers/iommu/io-pgtable-arm.c')
-rw-r--r--drivers/iommu/io-pgtable-arm.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c
index 4c745302c948..56c31715683a 100644
--- a/drivers/iommu/io-pgtable-arm.c
+++ b/drivers/iommu/io-pgtable-arm.c
@@ -249,8 +249,8 @@ static int __arm_lpae_map(struct arm_lpae_io_pgtable *data, unsigned long iova,
/* Grab a pointer to the next level */
pte = *ptep;
if (!pte) {
- cptep = alloc_pages_exact(1UL << data->pg_shift,
- GFP_ATOMIC | __GFP_ZERO);
+ cptep = io_pgtable_alloc_pages_exact(1UL << data->pg_shift,
+ GFP_ATOMIC | __GFP_ZERO);
if (!cptep)
return -ENOMEM;
@@ -414,7 +414,7 @@ static void __arm_lpae_free_pgtable(struct arm_lpae_io_pgtable *data, int lvl,
}
data->iop.cfg.tlb->unprepare_pgtable(data->iop.cookie, start);
- free_pages_exact(start, table_size);
+ io_pgtable_free_pages_exact(start, table_size);
}
static void arm_lpae_free_pgtable(struct io_pgtable *iop)
@@ -733,7 +733,8 @@ arm_64_lpae_alloc_pgtable_s1(struct io_pgtable_cfg *cfg, void *cookie)
cfg->arm_lpae_s1_cfg.mair[1] = 0;
/* Looking good; allocate a pgd */
- data->pgd = alloc_pages_exact(data->pgd_size, GFP_KERNEL | __GFP_ZERO);
+ data->pgd = io_pgtable_alloc_pages_exact(data->pgd_size,
+ GFP_KERNEL | __GFP_ZERO);
if (!data->pgd)
goto out_free_data;
@@ -821,7 +822,8 @@ arm_64_lpae_alloc_pgtable_s2(struct io_pgtable_cfg *cfg, void *cookie)
cfg->arm_lpae_s2_cfg.vtcr = reg;
/* Allocate pgd pages */
- data->pgd = alloc_pages_exact(data->pgd_size, GFP_KERNEL | __GFP_ZERO);
+ data->pgd = io_pgtable_alloc_pages_exact(data->pgd_size,
+ GFP_KERNEL | __GFP_ZERO);
if (!data->pgd)
goto out_free_data;