From: Magnus Damm <[email protected]>

Adjust code to output page table configuration on boot. Not for upstream merge.

Not-Yet-Signed-off-by: Magnus Damm <[email protected]>
---

 drivers/iommu/io-pgtable-arm.c |   12 ++++++++++++
 drivers/iommu/io-pgtable.c     |    4 ++++
 2 files changed, 16 insertions(+)

--- 0001/drivers/iommu/io-pgtable-arm.c
+++ work/drivers/iommu/io-pgtable-arm.c 2017-11-17 12:44:09.100607110 +0900
@@ -970,6 +970,18 @@ struct io_pgtable_init_fns io_pgtable_ar
        .free   = arm_lpae_free_pgtable,
 };
 
+void arm_lpae_dump(struct io_pgtable_ops *ops)
+{
+       struct arm_lpae_io_pgtable *data = io_pgtable_ops_to_data(ops);
+       struct io_pgtable_cfg *cfg = &data->iop.cfg;
+
+       pr_err("cfg: pgsize_bitmap 0x%lx, ias %u-bit\n",
+               cfg->pgsize_bitmap, cfg->ias);
+       pr_err("data: %d levels, 0x%zx pgd_size, %lu pg_shift, %lu 
bits_per_level, pgd @ %p\n",
+               data->levels, data->pgd_size, data->pg_shift,
+               data->bits_per_level, data->pgd);
+}
+
 #ifdef CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST
 
 static struct io_pgtable_cfg *cfg_cookie;
--- 0001/drivers/iommu/io-pgtable.c
+++ work/drivers/iommu/io-pgtable.c     2017-11-17 12:44:31.290607110 +0900
@@ -37,6 +37,8 @@ io_pgtable_init_table[IO_PGTABLE_NUM_FMT
 #endif
 };
 
+void arm_lpae_dump(struct io_pgtable_ops *ops);
+
 struct io_pgtable_ops *alloc_io_pgtable_ops(enum io_pgtable_fmt fmt,
                                            struct io_pgtable_cfg *cfg,
                                            void *cookie)
@@ -59,6 +61,8 @@ struct io_pgtable_ops *alloc_io_pgtable_
        iop->cookie     = cookie;
        iop->cfg        = *cfg;
 
+       arm_lpae_dump(&iop->ops);
+
        return &iop->ops;
 }
 

Reply via email to