diff mbox

[2/2] mm: fix undefined reference to `.kernel_map_pages' on PPC builds

Message ID 20150122212017.4b7032d52a6c75c06d5b4728@freescale.com (mailing list archive)
State Accepted
Commit ce614c3c6c8d215c9a00d6c1fce70211f75d3310
Headers show

Commit Message

Kim Phillips Jan. 23, 2015, 3:20 a.m. UTC
On Fri, 23 Jan 2015 08:49:36 +0900
Akinobu Mita <akinobu.mita@gmail.com> wrote:

> 2015-01-23 5:41 GMT+09:00 Kim Phillips <kim.phillips@freescale.com>:
> > Thanks. Now I get this:
> >
> >   LD      init/built-in.o
> > mm/built-in.o: In function `kernel_map_pages':
> > include/linux/mm.h:2076: undefined reference to `.__kernel_map_pages'
> > include/linux/mm.h:2076: undefined reference to `.__kernel_map_pages'
> > include/linux/mm.h:2076: undefined reference to `.__kernel_map_pages'
> > Makefile:925: recipe for target 'vmlinux' failed
> > make: *** [vmlinux] Error 1
> >
> > but, AFAICT, that's not because this patch is invalid: it's because
> > __kernel_map_pages() isn't implemented in
> > arch/powerpc/mm/pgtable_64.c, i.e., for non-PPC_STD_MMU_64 PPC64
> > machines.
> 
> Then, in order to use generic __kernel_map_pages() in mm/debug-pagealloc.c,
> CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC shouldn't be selected in
> arch/powerpc/Kconfig, when CONFIG_PPC_STD_MMU_64 isn't defined.

Thanks.  I'm still build-testing this now:

From 082911ee947246ff962ef21863c45ec467455c40 Mon Sep 17 00:00:00 2001
From: Kim Phillips <kim.phillips@freescale.com>
Date: Thu, 22 Jan 2015 20:42:40 -0600
Subject: [PATCH v2] mm: fix undefined reference to  `.__kernel_map_pages' on FSL
 PPC64

arch/powerpc has __kernel_map_pages implementations in mm/pgtable_32.c, and
mm/hash_utils_64.c, of which the former is built for PPC32, and the latter
PPC64's without PPC_STD_MMU.  Fix arch/powerpc/Kconfig to not select
ARCH_SUPPORTS_DEBUG_PAGEALLOC when CONFIG_PPC_STD_MMU_64 isn't defined,
i.e., for 64-bit book3e builds to use the generic __kernel_map_pages()
in mm/debug-pagealloc.c.

  LD      init/built-in.o
mm/built-in.o: In function `kernel_map_pages':
include/linux/mm.h:2076: undefined reference to `.__kernel_map_pages'
include/linux/mm.h:2076: undefined reference to `.__kernel_map_pages'
include/linux/mm.h:2076: undefined reference to `.__kernel_map_pages'
Makefile:925: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
---
v2: corrected SUPPORTS_DEBUG_PAGEALLOC selection to enable
non-STD_MMU_64 builds to use the generic __kernel_map_pages().

note: depends on Joonsoo Kim's patch "mm/debug_pagealloc: fix build
failure on ppc and some other archs" published earlier in this
thread.

 arch/powerpc/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Michael Ellerman Jan. 23, 2015, 4:24 a.m. UTC | #1
On Thu, 2015-01-22 at 21:20 -0600, Kim Phillips wrote:
> On Fri, 23 Jan 2015 08:49:36 +0900
> Akinobu Mita <akinobu.mita@gmail.com> wrote:
> 
> > 2015-01-23 5:41 GMT+09:00 Kim Phillips <kim.phillips@freescale.com>:
> > > Thanks. Now I get this:
> > >
> > >   LD      init/built-in.o
> > > mm/built-in.o: In function `kernel_map_pages':
> > > include/linux/mm.h:2076: undefined reference to `.__kernel_map_pages'
> > > include/linux/mm.h:2076: undefined reference to `.__kernel_map_pages'
> > > include/linux/mm.h:2076: undefined reference to `.__kernel_map_pages'
> > > Makefile:925: recipe for target 'vmlinux' failed
> > > make: *** [vmlinux] Error 1
> > >
> > > but, AFAICT, that's not because this patch is invalid: it's because
> > > __kernel_map_pages() isn't implemented in
> > > arch/powerpc/mm/pgtable_64.c, i.e., for non-PPC_STD_MMU_64 PPC64
> > > machines.
> > 
> > Then, in order to use generic __kernel_map_pages() in mm/debug-pagealloc.c,
> > CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC shouldn't be selected in
> > arch/powerpc/Kconfig, when CONFIG_PPC_STD_MMU_64 isn't defined.
> 
> Thanks.  I'm still build-testing this now:
> 
> From 082911ee947246ff962ef21863c45ec467455c40 Mon Sep 17 00:00:00 2001
> From: Kim Phillips <kim.phillips@freescale.com>
> Date: Thu, 22 Jan 2015 20:42:40 -0600
> Subject: [PATCH v2] mm: fix undefined reference to  `.__kernel_map_pages' on FSL
>  PPC64
> 
> arch/powerpc has __kernel_map_pages implementations in mm/pgtable_32.c, and
> mm/hash_utils_64.c, of which the former is built for PPC32, and the latter
> PPC64's without PPC_STD_MMU.

That last part is wrong.

hash_utils_64.c is built for CONFIG_PPC_STD_MMU_64, which is:

config PPC_STD_MMU_64
	def_bool y
	depends on PPC_STD_MMU && PPC64

The problem is when you have PPC64 && !PPC_STD_MMU.

cheers
diff mbox

Patch

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index a2a168e..22b0940 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -256,6 +256,7 @@  config PPC_OF_PLATFORM_PCI
 	default n
 
 config ARCH_SUPPORTS_DEBUG_PAGEALLOC
+	depends on PPC32 || PPC_STD_MMU_64
 	def_bool y
 
 config ARCH_SUPPORTS_UPROBES