aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2018-08-15 07:29:45 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2018-10-19 22:26:47 -0400
commit0d923962ab69c27cca664a2d535e90ef655110ca (patch)
tree078069f58e8161a67afc52b06938e4fba1839eef
parentafb6d0647fd250a068efd985987b5ff2c0d1b853 (diff)
powerpc/mm: Fix page table dump to work on Radix
When we're running on Book3S with the Radix MMU enabled the page table dump currently prints the wrong addresses because it uses the wrong start address. Fix it to use PAGE_OFFSET rather than KERN_VIRT_START. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/mm/dump_linuxpagetables.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/powerpc/mm/dump_linuxpagetables.c b/arch/powerpc/mm/dump_linuxpagetables.c
index e60aa6d7456d..2b74f8adf4d0 100644
--- a/arch/powerpc/mm/dump_linuxpagetables.c
+++ b/arch/powerpc/mm/dump_linuxpagetables.c
@@ -267,12 +267,13 @@ static void walk_pagetables(struct pg_state *st)
267 unsigned int i; 267 unsigned int i;
268 unsigned long addr; 268 unsigned long addr;
269 269
270 addr = st->start_address;
271
270 /* 272 /*
271 * Traverse the linux pagetable structure and dump pages that are in 273 * Traverse the linux pagetable structure and dump pages that are in
272 * the hash pagetable. 274 * the hash pagetable.
273 */ 275 */
274 for (i = 0; i < PTRS_PER_PGD; i++, pgd++) { 276 for (i = 0; i < PTRS_PER_PGD; i++, pgd++, addr += PGDIR_SIZE) {
275 addr = KERN_VIRT_START + i * PGDIR_SIZE;
276 if (!pgd_none(*pgd) && !pgd_huge(*pgd)) 277 if (!pgd_none(*pgd) && !pgd_huge(*pgd))
277 /* pgd exists */ 278 /* pgd exists */
278 walk_pud(st, pgd, addr); 279 walk_pud(st, pgd, addr);
@@ -321,9 +322,14 @@ static int ptdump_show(struct seq_file *m, void *v)
321{ 322{
322 struct pg_state st = { 323 struct pg_state st = {
323 .seq = m, 324 .seq = m,
324 .start_address = KERN_VIRT_START,
325 .marker = address_markers, 325 .marker = address_markers,
326 }; 326 };
327
328 if (radix_enabled())
329 st.start_address = PAGE_OFFSET;
330 else
331 st.start_address = KERN_VIRT_START;
332
327 /* Traverse kernel page tables */ 333 /* Traverse kernel page tables */
328 walk_pagetables(&st); 334 walk_pagetables(&st);
329 note_page(&st, 0, 0, 0); 335 note_page(&st, 0, 0, 0);