Skip to content

Commit dd5ac03

Browse files
committed
powerpc/mm: Fix page table dump build on non-Book3S
In the recent commit 1515ab9 ("powerpc/mm: Dump hash table") we added code to dump the hage page table. Currently this can be selected to build on any platform. However it breaks the build if we're building for a non-Book3S platform, because none of the hash page table related defines and so on exist. So restrict it to building only on Book3S. Similarly in commit 8eb07b1 ("powerpc/mm: Dump linux pagetables") we added code to dump the Linux page tables, which uses some constants which are only defined on Book3S - so guard those with an #ifdef. Fixes: 1515ab9 ("powerpc/mm: Dump hash table") Fixes: 8eb07b1 ("powerpc/mm: Dump linux pagetables") Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 6dff5b6 commit dd5ac03

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎arch/powerpc/Kconfig.debug‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,4 +366,8 @@ config PPC_PTDUMP
366366

367367
If you are unsure, say N.
368368

369+
config PPC_HTDUMP
370+
def_bool y
371+
depends on PPC_PTDUMP && PPC_BOOK3S
372+
369373
endmenu

‎arch/powerpc/mm/Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-noncoherent.o
4242
obj-$(CONFIG_HIGHMEM) += highmem.o
4343
obj-$(CONFIG_PPC_COPRO_BASE) += copro_fault.o
4444
obj-$(CONFIG_SPAPR_TCE_IOMMU) += mmu_context_iommu.o
45-
obj-$(CONFIG_PPC_PTDUMP) += dump_linuxpagetables.o \
46-
dump_hashpagetable.o
45+
obj-$(CONFIG_PPC_PTDUMP) += dump_linuxpagetables.o
46+
obj-$(CONFIG_PPC_HTDUMP) += dump_hashpagetable.o

‎arch/powerpc/mm/dump_linuxpagetables.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ static const struct flag_info flag_array[] = {
159159
.set = "no cache",
160160
.clear = " ",
161161
}, {
162+
#ifdef CONFIG_PPC_BOOK3S_64
162163
.mask = H_PAGE_BUSY,
163164
.val = H_PAGE_BUSY,
164165
.set = "busy",
@@ -183,6 +184,7 @@ static const struct flag_info flag_array[] = {
183184
.val = H_PAGE_F_SECOND,
184185
.set = "f_second",
185186
}, {
187+
#endif
186188
.mask = _PAGE_SPECIAL,
187189
.val = _PAGE_SPECIAL,
188190
.set = "special",

0 commit comments

Comments
 (0)