diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2017-04-18 02:20:13 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-04-27 08:20:26 -0400 |
commit | 6c01bbd2cf8cbc1906818b402b10bca2283c4e7e (patch) | |
tree | a0d224b60d18bd0df5a8555c7516f101c2af905e /arch/powerpc/mm/dump_linuxpagetables.c | |
parent | a5998fcb92552a18713b6aa5c146aa400e4d75ee (diff) |
powerpc/mm: Fix page table dump build on PPC32
On PPC32 (eg. mpc885_ads_defconfig), page table dump compilation fails as
follows. This is because the memory layout is slightly different on PPC32. This
patch adapts it.
arch/powerpc/mm/dump_linuxpagetables.c: In function 'walk_pagetables':
arch/powerpc/mm/dump_linuxpagetables.c:369:10: error: 'KERN_VIRT_START' undeclared (first use in this function)
...
Fixes: 8eb07b187000d ("powerpc/mm: Dump linux pagetables")
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/dump_linuxpagetables.c')
-rw-r--r-- | arch/powerpc/mm/dump_linuxpagetables.c | 59 |
1 files changed, 48 insertions, 11 deletions
diff --git a/arch/powerpc/mm/dump_linuxpagetables.c b/arch/powerpc/mm/dump_linuxpagetables.c index b4cb7818dfd0..bb136ac6ac55 100644 --- a/arch/powerpc/mm/dump_linuxpagetables.c +++ b/arch/powerpc/mm/dump_linuxpagetables.c | |||
@@ -26,6 +26,10 @@ | |||
26 | #include <asm/page.h> | 26 | #include <asm/page.h> |
27 | #include <asm/pgalloc.h> | 27 | #include <asm/pgalloc.h> |
28 | 28 | ||
29 | #ifdef CONFIG_PPC32 | ||
30 | #define KERN_VIRT_START 0 | ||
31 | #endif | ||
32 | |||
29 | /* | 33 | /* |
30 | * To visualise what is happening, | 34 | * To visualise what is happening, |
31 | * | 35 | * |
@@ -71,6 +75,7 @@ static struct addr_marker address_markers[] = { | |||
71 | { 0, "Start of kernel VM" }, | 75 | { 0, "Start of kernel VM" }, |
72 | { 0, "vmalloc() Area" }, | 76 | { 0, "vmalloc() Area" }, |
73 | { 0, "vmalloc() End" }, | 77 | { 0, "vmalloc() End" }, |
78 | #ifdef CONFIG_PPC64 | ||
74 | { 0, "isa I/O start" }, | 79 | { 0, "isa I/O start" }, |
75 | { 0, "isa I/O end" }, | 80 | { 0, "isa I/O end" }, |
76 | { 0, "phb I/O start" }, | 81 | { 0, "phb I/O start" }, |
@@ -78,6 +83,20 @@ static struct addr_marker address_markers[] = { | |||
78 | { 0, "I/O remap start" }, | 83 | { 0, "I/O remap start" }, |
79 | { 0, "I/O remap end" }, | 84 | { 0, "I/O remap end" }, |
80 | { 0, "vmemmap start" }, | 85 | { 0, "vmemmap start" }, |
86 | #else | ||
87 | { 0, "Early I/O remap start" }, | ||
88 | { 0, "Early I/O remap end" }, | ||
89 | #ifdef CONFIG_NOT_COHERENT_CACHE | ||
90 | { 0, "Consistent mem start" }, | ||
91 | { 0, "Consistent mem end" }, | ||
92 | #endif | ||
93 | #ifdef CONFIG_HIGHMEM | ||
94 | { 0, "Highmem PTEs start" }, | ||
95 | { 0, "Highmem PTEs end" }, | ||
96 | #endif | ||
97 | { 0, "Fixmap start" }, | ||
98 | { 0, "Fixmap end" }, | ||
99 | #endif | ||
81 | { -1, NULL }, | 100 | { -1, NULL }, |
82 | }; | 101 | }; |
83 | 102 | ||
@@ -404,20 +423,38 @@ static void walk_pagetables(struct pg_state *st) | |||
404 | 423 | ||
405 | static void populate_markers(void) | 424 | static void populate_markers(void) |
406 | { | 425 | { |
407 | address_markers[0].start_address = PAGE_OFFSET; | 426 | int i = 0; |
408 | address_markers[1].start_address = VMALLOC_START; | 427 | |
409 | address_markers[2].start_address = VMALLOC_END; | 428 | address_markers[i++].start_address = PAGE_OFFSET; |
410 | address_markers[3].start_address = ISA_IO_BASE; | 429 | address_markers[i++].start_address = VMALLOC_START; |
411 | address_markers[4].start_address = ISA_IO_END; | 430 | address_markers[i++].start_address = VMALLOC_END; |
412 | address_markers[5].start_address = PHB_IO_BASE; | 431 | #ifdef CONFIG_PPC64 |
413 | address_markers[6].start_address = PHB_IO_END; | 432 | address_markers[i++].start_address = ISA_IO_BASE; |
414 | address_markers[7].start_address = IOREMAP_BASE; | 433 | address_markers[i++].start_address = ISA_IO_END; |
415 | address_markers[8].start_address = IOREMAP_END; | 434 | address_markers[i++].start_address = PHB_IO_BASE; |
435 | address_markers[i++].start_address = PHB_IO_END; | ||
436 | address_markers[i++].start_address = IOREMAP_BASE; | ||
437 | address_markers[i++].start_address = IOREMAP_END; | ||
416 | #ifdef CONFIG_PPC_STD_MMU_64 | 438 | #ifdef CONFIG_PPC_STD_MMU_64 |
417 | address_markers[9].start_address = H_VMEMMAP_BASE; | 439 | address_markers[i++].start_address = H_VMEMMAP_BASE; |
418 | #else | 440 | #else |
419 | address_markers[9].start_address = VMEMMAP_BASE; | 441 | address_markers[i++].start_address = VMEMMAP_BASE; |
442 | #endif | ||
443 | #else /* !CONFIG_PPC64 */ | ||
444 | address_markers[i++].start_address = ioremap_bot; | ||
445 | address_markers[i++].start_address = IOREMAP_TOP; | ||
446 | #ifdef CONFIG_NOT_COHERENT_CACHE | ||
447 | address_markers[i++].start_address = IOREMAP_TOP; | ||
448 | address_markers[i++].start_address = IOREMAP_TOP + | ||
449 | CONFIG_CONSISTENT_SIZE; | ||
450 | #endif | ||
451 | #ifdef CONFIG_HIGHMEM | ||
452 | address_markers[i++].start_address = PKMAP_BASE; | ||
453 | address_markers[i++].start_address = PKMAP_ADDR(LAST_PKMAP); | ||
420 | #endif | 454 | #endif |
455 | address_markers[i++].start_address = FIXADDR_START; | ||
456 | address_markers[i++].start_address = FIXADDR_TOP; | ||
457 | #endif /* CONFIG_PPC64 */ | ||
421 | } | 458 | } |
422 | 459 | ||
423 | static int ptdump_show(struct seq_file *m, void *v) | 460 | static int ptdump_show(struct seq_file *m, void *v) |