Skip to content

Commit

Permalink
arm64: Print physical address of page table base in show_pte()
Browse files Browse the repository at this point in the history
When dumping the page table in response to an unexpected kernel page
fault, we print the virtual (hashed) address of the page table base, but
display physical addresses for everything else.

Make the page table dumping code in show_pte() consistent, by printing
the page table base pointer as a physical address.

Reported-by: Mark Rutland <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
  • Loading branch information
wildea01 committed May 14, 2019
1 parent 84c187a commit 48caebf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/arm64/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,10 @@ static void show_pte(unsigned long addr)
return;
}

pr_alert("%s pgtable: %luk pages, %u-bit VAs, pgdp = %p\n",
pr_alert("%s pgtable: %luk pages, %u-bit VAs, pgdp=%016lx\n",
mm == &init_mm ? "swapper" : "user", PAGE_SIZE / SZ_1K,
mm == &init_mm ? VA_BITS : (int) vabits_user, mm->pgd);
mm == &init_mm ? VA_BITS : (int)vabits_user,
(unsigned long)virt_to_phys(mm->pgd));
pgdp = pgd_offset(mm, addr);
pgd = READ_ONCE(*pgdp);
pr_alert("[%016lx] pgd=%016llx", addr, pgd_val(pgd));
Expand Down

0 comments on commit 48caebf

Please sign in to comment.