[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v02 5/7] arm: omap: introduce print pagetable function for GPU remoteproc
This patch adds a possibility to dump all pagetables of GPU remoteproc. The only reason to have this patch - is a low level debug. Change-Id: I9577dda0f3e4a15f596d2bdcc7b6488f91a7c0e0 Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@xxxxxxxxxxxxxxx> --- xen/arch/arm/platforms/omap_iommu.c | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/xen/arch/arm/platforms/omap_iommu.c b/xen/arch/arm/platforms/omap_iommu.c index d3a3c15..c92b027 100644 --- a/xen/arch/arm/platforms/omap_iommu.c +++ b/xen/arch/arm/platforms/omap_iommu.c @@ -73,6 +73,7 @@ static u32 mmu_ipu_translate_pagetable(struct mmu_info *mmu, struct mmu_pagetabl static u32 mmu_sgx_translate_pagetable(struct mmu_info *mmu, struct mmu_pagetable *pgt); static void mmu_ipu_print_pagetables(struct mmu_info *mmu); +static void mmu_sgx_print_pagetables(struct mmu_info *mmu); static u32 ipu_trap_offsets[] = { MMU_IPU_TTB_OFFSET, @@ -123,6 +124,7 @@ struct mmu_info omap_sgx_mmu = { .mem_size = 0x1000, .num_traps = ARRAY_SIZE(sgx_trap_offsets), .translate_pfunc = mmu_sgx_translate_pagetable, + .print_pagetable_pfunc = mmu_sgx_print_pagetables, }; static bool translate_supersections_to_pages = true; @@ -344,6 +346,63 @@ static u32 mmu_ipu_translate_pagetable(struct mmu_info *mmu, struct mmu_pagetabl return __pa(hyp_pgt); } +static void mmu_sgx_print_one_pagetable(struct mmu_info *mmu, struct mmu_pagetable *pgt, u32 index) +{ + u32 i, page_counter = 0; + u32 *pagetable; + + ASSERT(pgt); + ASSERT(pgt->hyp_pagetable); + ASSERT(pgt->paddr); + ASSERT(pgt->maddr); + + pagetable = pgt->hyp_pagetable; + + pr_mmu("pgt[%u][0x%08x][0x%08x]", index, pgt->paddr, pgt->maddr); + /* 1-st level translation */ + for ( i = 0; i < MMU_PTRS_PER_PGD(mmu); i++ ) + { + u32 pgd = pagetable[i]; + u32 *pte_table = NULL; + u32 j; + + if ( !pgd ) + continue; + + pr_mmu("pgt[%u][0x%08x][0x%08x] pgd[%u] 0x%08x (max %lu)", + index, pgt->paddr, pgt->maddr, i, pgd, MMU_PTRS_PER_PGD(mmu)); + + pte_table = __va(pgd & MMU_SECTION_MASK(mmu->pg_data->pte_shift)); + if ( !pte_table ) + { + pr_mmu("failed to map pagetable"); + return; + } + + for ( j = 0; j < MMU_PTRS_PER_PTE(mmu); j++ ) + { + if ( !pte_table[j] ) + continue; + + page_counter++; + pr_mmu("pgt[%u][0x%08x][0x%08x] pgd[%u]\t pte_table[%u] 0x%08x (max %lu)", + index, pgt->paddr, pgt->maddr, i, j, pte_table[j], MMU_PTRS_PER_PTE(mmu)); + } + } + ASSERT(page_counter == pgt->page_counter); +} + +static void mmu_sgx_print_pagetables(struct mmu_info *mmu) +{ + struct mmu_pagetable *pgt; + u32 i = 0; + + list_for_each_entry(pgt, &mmu->pagetables_list, link_node) + { + mmu_sgx_print_one_pagetable(mmu, pgt, i++); + } +} + static u32 mmu_sgx_translate_pagetable(struct mmu_info *mmu, struct mmu_pagetable *pgt) { u32 *kern_pgt, *hyp_pgt; -- 1.7.9.5 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |