All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/mm: Fix page table dump build on non-Book3S
@ 2016-12-01  9:00 Michael Ellerman
  2016-12-03 11:28 ` Michael Ellerman
  2017-03-06  4:38 ` [PATCH] " Robert E. Cochran
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Ellerman @ 2016-12-01  9:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: rashmicy

In the recent commit 1515ab932156 ("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 8eb07b187000 ("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: 1515ab932156 ("powerpc/mm: Dump hash table")
Fixes: 8eb07b187000 ("powerpc/mm: Dump linux pagetables")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/Kconfig.debug             | 4 ++++
 arch/powerpc/mm/Makefile               | 4 ++--
 arch/powerpc/mm/dump_linuxpagetables.c | 2 ++
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index 20cf770611ec..949258d412d0 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -366,4 +366,8 @@ config PPC_PTDUMP
 
 	  If you are unsure, say N.
 
+config PPC_HTDUMP
+	def_bool y
+	depends on PPC_PTDUMP && PPC_BOOK3S
+
 endmenu
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
index f4ffe1f68ce9..5784682d7b63 100644
--- a/arch/powerpc/mm/Makefile
+++ b/arch/powerpc/mm/Makefile
@@ -42,5 +42,5 @@ obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-noncoherent.o
 obj-$(CONFIG_HIGHMEM)		+= highmem.o
 obj-$(CONFIG_PPC_COPRO_BASE)	+= copro_fault.o
 obj-$(CONFIG_SPAPR_TCE_IOMMU)	+= mmu_context_iommu.o
-obj-$(CONFIG_PPC_PTDUMP)	+= dump_linuxpagetables.o \
-				   dump_hashpagetable.o
+obj-$(CONFIG_PPC_PTDUMP)	+= dump_linuxpagetables.o
+obj-$(CONFIG_PPC_HTDUMP)	+= dump_hashpagetable.o
diff --git a/arch/powerpc/mm/dump_linuxpagetables.c b/arch/powerpc/mm/dump_linuxpagetables.c
index d242bc79ae64..49abaf4dc8e3 100644
--- a/arch/powerpc/mm/dump_linuxpagetables.c
+++ b/arch/powerpc/mm/dump_linuxpagetables.c
@@ -159,6 +159,7 @@ static const struct flag_info flag_array[] = {
 		.set	= "no cache",
 		.clear	= "        ",
 	}, {
+#ifdef CONFIG_PPC_BOOK3S_64
 		.mask	= H_PAGE_BUSY,
 		.val	= H_PAGE_BUSY,
 		.set	= "busy",
@@ -183,6 +184,7 @@ static const struct flag_info flag_array[] = {
 		.val	= H_PAGE_F_SECOND,
 		.set	= "f_second",
 	}, {
+#endif
 		.mask	= _PAGE_SPECIAL,
 		.val	= _PAGE_SPECIAL,
 		.set	= "special",
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: powerpc/mm: Fix page table dump build on non-Book3S
  2016-12-01  9:00 [PATCH] powerpc/mm: Fix page table dump build on non-Book3S Michael Ellerman
@ 2016-12-03 11:28 ` Michael Ellerman
  2017-03-06  4:38 ` [PATCH] " Robert E. Cochran
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2016-12-03 11:28 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: rashmicy

On Thu, 2016-12-01 at 09:00:00 UTC, Michael Ellerman wrote:
> In the recent commit 1515ab932156 ("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 8eb07b187000 ("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: 1515ab932156 ("powerpc/mm: Dump hash table")
> Fixes: 8eb07b187000 ("powerpc/mm: Dump linux pagetables")
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Applied to powerpc next.

https://git.kernel.org/powerpc/c/dd5ac03e09554b7504f64990cfbcec

cheers

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/mm: Fix page table dump build on non-Book3S
  2016-12-01  9:00 [PATCH] powerpc/mm: Fix page table dump build on non-Book3S Michael Ellerman
  2016-12-03 11:28 ` Michael Ellerman
@ 2017-03-06  4:38 ` Robert E. Cochran
  2017-03-06  9:28   ` Michael Ellerman
  1 sibling, 1 reply; 4+ messages in thread
From: Robert E. Cochran @ 2017-03-06  4:38 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev

On 12/01/2016 04:00 AM, Michael Ellerman wrote:
> In the recent commit 1515ab932156 ("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 8eb07b187000 ("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.


Hello,

I was just building the mainline 4.11-rc1 tonight on an NXP P1010 / 
e500v2 with CONFIG_PPC_PTDUMP set.

I received a bunch of errors from dump_linuxpagetables.c  (as you can 
see below).

I realize now that CONFIG_PPC_PTDUMP  isn't for the e500, but I thought 
someone might want to know that enabling it causes the build of an 
e500v2 to fail.

Bob

   CC      arch/powerpc/mm/dump_linuxpagetables.o
../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)
    addr = KERN_VIRT_START + i * PGDIR_SIZE;
           ^~~~~~~~~~~~~~~
../arch/powerpc/mm/dump_linuxpagetables.c:369:10: note: each undeclared 
identifier is reported only once for each function it appears in
../arch/powerpc/mm/dump_linuxpagetables.c: In function 'populate_markers':
../arch/powerpc/mm/dump_linuxpagetables.c:383:37: error: 'ISA_IO_BASE' 
undeclared (first use in this function)
   address_markers[3].start_address = ISA_IO_BASE;
                                      ^~~~~~~~~~~
../arch/powerpc/mm/dump_linuxpagetables.c:384:37: error: 'ISA_IO_END' 
undeclared (first use in this function)
   address_markers[4].start_address = ISA_IO_END;
                                      ^~~~~~~~~~
../arch/powerpc/mm/dump_linuxpagetables.c:385:37: error: 'PHB_IO_BASE' 
undeclared (first use in this function)
   address_markers[5].start_address = PHB_IO_BASE;
                                      ^~~~~~~~~~~
../arch/powerpc/mm/dump_linuxpagetables.c:386:37: error: 'PHB_IO_END' 
undeclared (first use in this function)
   address_markers[6].start_address = PHB_IO_END;
                                      ^~~~~~~~~~
../arch/powerpc/mm/dump_linuxpagetables.c:387:37: error: 'IOREMAP_BASE' 
undeclared (first use in this function)
   address_markers[7].start_address = IOREMAP_BASE;
                                      ^~~~~~~~~~~~
../arch/powerpc/mm/dump_linuxpagetables.c:388:37: error: 'IOREMAP_END' 
undeclared (first use in this function)
   address_markers[8].start_address = IOREMAP_END;
                                      ^~~~~~~~~~~
../arch/powerpc/mm/dump_linuxpagetables.c:392:38: error: 'VMEMMAP_BASE' 
undeclared (first use in this function)
   address_markers[9].start_address =  VMEMMAP_BASE;
                                       ^~~~~~~~~~~~
../arch/powerpc/mm/dump_linuxpagetables.c: In function 'ptdump_show':
../arch/powerpc/mm/dump_linuxpagetables.c:400:20: error: 
'KERN_VIRT_START' undeclared (first use in this function)
    .start_address = KERN_VIRT_START,
                     ^~~~~~~~~~~~~~~
../scripts/Makefile.build:294: recipe for target 
'arch/powerpc/mm/dump_linuxpagetables.o' failed
make[2]: *** [arch/powerpc/mm/dump_linuxpagetables.o] Error 1
/build/linux/Makefile:1002: recipe for target 'arch/powerpc/mm' failed
make[1]: *** [arch/powerpc/mm] Error 2
make[1]: Leaving directory '/build/linux/build_p1010'
Makefile:152: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2




>
> Fixes: 1515ab932156 ("powerpc/mm: Dump hash table")
> Fixes: 8eb07b187000 ("powerpc/mm: Dump linux pagetables")
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
>   arch/powerpc/Kconfig.debug             | 4 ++++
>   arch/powerpc/mm/Makefile               | 4 ++--
>   arch/powerpc/mm/dump_linuxpagetables.c | 2 ++
>   3 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
> index 20cf770611ec..949258d412d0 100644
> --- a/arch/powerpc/Kconfig.debug
> +++ b/arch/powerpc/Kconfig.debug
> @@ -366,4 +366,8 @@ config PPC_PTDUMP
>   
>   	  If you are unsure, say N.
>   
> +config PPC_HTDUMP
> +	def_bool y
> +	depends on PPC_PTDUMP && PPC_BOOK3S
> +
>   endmenu
> diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
> index f4ffe1f68ce9..5784682d7b63 100644
> --- a/arch/powerpc/mm/Makefile
> +++ b/arch/powerpc/mm/Makefile
> @@ -42,5 +42,5 @@ obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-noncoherent.o
>   obj-$(CONFIG_HIGHMEM)		+= highmem.o
>   obj-$(CONFIG_PPC_COPRO_BASE)	+= copro_fault.o
>   obj-$(CONFIG_SPAPR_TCE_IOMMU)	+= mmu_context_iommu.o
> -obj-$(CONFIG_PPC_PTDUMP)	+= dump_linuxpagetables.o \
> -				   dump_hashpagetable.o
> +obj-$(CONFIG_PPC_PTDUMP)	+= dump_linuxpagetables.o
> +obj-$(CONFIG_PPC_HTDUMP)	+= dump_hashpagetable.o
> diff --git a/arch/powerpc/mm/dump_linuxpagetables.c b/arch/powerpc/mm/dump_linuxpagetables.c
> index d242bc79ae64..49abaf4dc8e3 100644
> --- a/arch/powerpc/mm/dump_linuxpagetables.c
> +++ b/arch/powerpc/mm/dump_linuxpagetables.c
> @@ -159,6 +159,7 @@ static const struct flag_info flag_array[] = {
>   		.set	= "no cache",
>   		.clear	= "        ",
>   	}, {
> +#ifdef CONFIG_PPC_BOOK3S_64
>   		.mask	= H_PAGE_BUSY,
>   		.val	= H_PAGE_BUSY,
>   		.set	= "busy",
> @@ -183,6 +184,7 @@ static const struct flag_info flag_array[] = {
>   		.val	= H_PAGE_F_SECOND,
>   		.set	= "f_second",
>   	}, {
> +#endif
>   		.mask	= _PAGE_SPECIAL,
>   		.val	= _PAGE_SPECIAL,
>   		.set	= "special",

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/mm: Fix page table dump build on non-Book3S
  2017-03-06  4:38 ` [PATCH] " Robert E. Cochran
@ 2017-03-06  9:28   ` Michael Ellerman
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2017-03-06  9:28 UTC (permalink / raw)
  To: Robert E. Cochran, linuxppc-dev

"Robert E. Cochran" <ppc@mindchasers.com> writes:

> On 12/01/2016 04:00 AM, Michael Ellerman wrote:
>> In the recent commit 1515ab932156 ("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 8eb07b187000 ("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.
>
>
> Hello,
>
> I was just building the mainline 4.11-rc1 tonight on an NXP P1010 / 
> e500v2 with CONFIG_PPC_PTDUMP set.
>
> I received a bunch of errors from dump_linuxpagetables.c  (as you can 
> see below).
>
> I realize now that CONFIG_PPC_PTDUMP  isn't for the e500, but I thought 
> someone might want to know that enabling it causes the build of an 
> e500v2 to fail.

Thanks. It actually should work on that config, it's just dumping the
Linux page tables.

It looks like it's just that some of the "well known" address ranges
don't exist, or don't have the same names. So it should be fixable with
some #ifdefs.

I'll fix it at some point if no one beats me to it.

cheers

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-06  9:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-01  9:00 [PATCH] powerpc/mm: Fix page table dump build on non-Book3S Michael Ellerman
2016-12-03 11:28 ` Michael Ellerman
2017-03-06  4:38 ` [PATCH] " Robert E. Cochran
2017-03-06  9:28   ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.