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

Subsystems: memory management, the rest

STALE4204d

18 messages, 7 authors, 2015-01-29 · open the first message on its own page

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

From: Kim Phillips <hidden>
Date: 2015-01-20 20:22:12

It's possible to configure DEBUG_PAGEALLOC without PAGE_POISONING on
ppc.  Fix building the generic kernel_map_pages() implementation in
this case:

  LD      init/built-in.o
mm/built-in.o: In function `free_pages_prepare':
mm/page_alloc.c:770: undefined reference to `.kernel_map_pages'
mm/built-in.o: In function `prep_new_page':
mm/page_alloc.c:933: undefined reference to `.kernel_map_pages'
mm/built-in.o: In function `map_pages':
mm/compaction.c:61: undefined reference to `.kernel_map_pages'
make: *** [vmlinux] Error 1

Signed-off-by: Kim Phillips <redacted>
---
 mm/Makefile | 1 +
 1 file changed, 1 insertion(+)
diff --git a/mm/Makefile b/mm/Makefile
index 4bf586e..2956467 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -46,6 +46,7 @@ obj-$(CONFIG_SLOB) += slob.o
 obj-$(CONFIG_MMU_NOTIFIER) += mmu_notifier.o
 obj-$(CONFIG_KSM) += ksm.o
 obj-$(CONFIG_PAGE_POISONING) += debug-pagealloc.o
+obj-$(CONFIG_DEBUG_PAGEALLOC) += debug-pagealloc.o
 obj-$(CONFIG_SLAB) += slab.o
 obj-$(CONFIG_SLUB) += slub.o
 obj-$(CONFIG_KMEMCHECK) += kmemcheck.o
-- 
2.2.2

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

From: josh@joshtriplett.org
Date: 2015-01-20 23:01:59

On Tue, Jan 20, 2015 at 02:02:00PM -0600, Kim Phillips wrote:
quoted hunk
It's possible to configure DEBUG_PAGEALLOC without PAGE_POISONING on
ppc.  Fix building the generic kernel_map_pages() implementation in
this case:

  LD      init/built-in.o
mm/built-in.o: In function `free_pages_prepare':
mm/page_alloc.c:770: undefined reference to `.kernel_map_pages'
mm/built-in.o: In function `prep_new_page':
mm/page_alloc.c:933: undefined reference to `.kernel_map_pages'
mm/built-in.o: In function `map_pages':
mm/compaction.c:61: undefined reference to `.kernel_map_pages'
make: *** [vmlinux] Error 1

Signed-off-by: Kim Phillips <redacted>
---
 mm/Makefile | 1 +
 1 file changed, 1 insertion(+)
diff --git a/mm/Makefile b/mm/Makefile
index 4bf586e..2956467 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -46,6 +46,7 @@ obj-$(CONFIG_SLOB) += slob.o
 obj-$(CONFIG_MMU_NOTIFIER) += mmu_notifier.o
 obj-$(CONFIG_KSM) += ksm.o
 obj-$(CONFIG_PAGE_POISONING) += debug-pagealloc.o
+obj-$(CONFIG_DEBUG_PAGEALLOC) += debug-pagealloc.o
Does it work correctly to list the same object file twice?  Doesn't seem
like it would.  Shouldn't this do something like the following instead:

ifneq ($(CONFIG_DEBUG_PAGEALLOC)$(CONFIG_PAGE_POISONING),)
obj-y += debug-pagealloc.o
endif

?
 obj-$(CONFIG_SLAB) += slab.o
 obj-$(CONFIG_SLUB) += slub.o
 obj-$(CONFIG_KMEMCHECK) += kmemcheck.o
-- 
2.2.2

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

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2015-01-21 00:07:41

On Tue, 20 Jan 2015 15:01:50 -0800 josh@joshtriplett.org wrote:
On Tue, Jan 20, 2015 at 02:02:00PM -0600, Kim Phillips wrote:
quoted
It's possible to configure DEBUG_PAGEALLOC without PAGE_POISONING on
ppc.  Fix building the generic kernel_map_pages() implementation in
this case:

  LD      init/built-in.o
mm/built-in.o: In function `free_pages_prepare':
mm/page_alloc.c:770: undefined reference to `.kernel_map_pages'
mm/built-in.o: In function `prep_new_page':
mm/page_alloc.c:933: undefined reference to `.kernel_map_pages'
mm/built-in.o: In function `map_pages':
mm/compaction.c:61: undefined reference to `.kernel_map_pages'
make: *** [vmlinux] Error 1

Signed-off-by: Kim Phillips <redacted>
---
 mm/Makefile | 1 +
 1 file changed, 1 insertion(+)
diff --git a/mm/Makefile b/mm/Makefile
index 4bf586e..2956467 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -46,6 +46,7 @@ obj-$(CONFIG_SLOB) += slob.o
 obj-$(CONFIG_MMU_NOTIFIER) += mmu_notifier.o
 obj-$(CONFIG_KSM) += ksm.o
 obj-$(CONFIG_PAGE_POISONING) += debug-pagealloc.o
+obj-$(CONFIG_DEBUG_PAGEALLOC) += debug-pagealloc.o
Does it work correctly to list the same object file twice?  Doesn't seem
like it would.  Shouldn't this do something like the following instead:

ifneq ($(CONFIG_DEBUG_PAGEALLOC)$(CONFIG_PAGE_POISONING),)
obj-y += debug-pagealloc.o
endif
I expect it's a Kconfig problem.  DEBUG_PAGEALLOC should be selecting
PAGE_POISONING.

config DEBUG_PAGEALLOC
	bool "Debug page memory allocations"
	depends on DEBUG_KERNEL
	depends on !HIBERNATION || ARCH_SUPPORTS_DEBUG_PAGEALLOC && !PPC && !SPARC
	depends on !KMEMCHECK
	select PAGE_EXTENSION
	select PAGE_POISONING if !ARCH_SUPPORTS_DEBUG_PAGEALLOC

Culprits cc'ed!

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

From: Akinobu Mita <akinobu.mita@gmail.com>
Date: 2015-01-21 12:58:15

2015-01-21 9:07 GMT+09:00 Andrew Morton [off-list ref]:
On Tue, 20 Jan 2015 15:01:50 -0800 josh@joshtriplett.org wrote:
quoted
On Tue, Jan 20, 2015 at 02:02:00PM -0600, Kim Phillips wrote:
quoted
It's possible to configure DEBUG_PAGEALLOC without PAGE_POISONING on
ppc.  Fix building the generic kernel_map_pages() implementation in
this case:

  LD      init/built-in.o
mm/built-in.o: In function `free_pages_prepare':
mm/page_alloc.c:770: undefined reference to `.kernel_map_pages'
mm/built-in.o: In function `prep_new_page':
mm/page_alloc.c:933: undefined reference to `.kernel_map_pages'
mm/built-in.o: In function `map_pages':
mm/compaction.c:61: undefined reference to `.kernel_map_pages'
make: *** [vmlinux] Error 1
kernel_map_pages() is static inline function since commit 031bc5743f15
("mm/debug-pagealloc: make debug-pagealloc boottime configurable").

But there is old declaration in 'arch/powerpc/include/asm/cacheflush.h'.
Removing it or changing s/kernel_map_pages/__kernel_map_pages/ in this
header file or something can fix this problem?

The architecture which has ARCH_SUPPORTS_DEBUG_PAGEALLOC
including PPC should not build mm/debug-pagealloc.o

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

From: Joonsoo Kim <hidden>
Date: 2015-01-22 01:45:01

On Wed, Jan 21, 2015 at 09:57:59PM +0900, Akinobu Mita wrote:
2015-01-21 9:07 GMT+09:00 Andrew Morton [off-list ref]:
quoted
On Tue, 20 Jan 2015 15:01:50 -0800 josh@joshtriplett.org wrote:
quoted
On Tue, Jan 20, 2015 at 02:02:00PM -0600, Kim Phillips wrote:
quoted
It's possible to configure DEBUG_PAGEALLOC without PAGE_POISONING on
ppc.  Fix building the generic kernel_map_pages() implementation in
this case:

  LD      init/built-in.o
mm/built-in.o: In function `free_pages_prepare':
mm/page_alloc.c:770: undefined reference to `.kernel_map_pages'
mm/built-in.o: In function `prep_new_page':
mm/page_alloc.c:933: undefined reference to `.kernel_map_pages'
mm/built-in.o: In function `map_pages':
mm/compaction.c:61: undefined reference to `.kernel_map_pages'
make: *** [vmlinux] Error 1
kernel_map_pages() is static inline function since commit 031bc5743f15
("mm/debug-pagealloc: make debug-pagealloc boottime configurable").

But there is old declaration in 'arch/powerpc/include/asm/cacheflush.h'.
Removing it or changing s/kernel_map_pages/__kernel_map_pages/ in this
header file or something can fix this problem?

The architecture which has ARCH_SUPPORTS_DEBUG_PAGEALLOC
including PPC should not build mm/debug-pagealloc.o
Yes, architecture with ARCH_SUPPORTS_DEBUG_PAGEALLOC should not build
mm/debug-pagealloc.o. I attach the patch to remove old declaration.
I hope it will fix Kim's problem.

-------------->8------------------
From 7cb9d1ed8a785df152cb8934e187031c8ebd1bb2 Mon Sep 17 00:00:00 2001
From: Joonsoo Kim <redacted>
Date: Thu, 22 Jan 2015 10:28:58 +0900
Subject: [PATCH] mm/debug_pagealloc: fix build failure on ppc and some other
 archs

Kim Phillips reported following build failure.

  LD      init/built-in.o
  mm/built-in.o: In function `free_pages_prepare':
  mm/page_alloc.c:770: undefined reference to `.kernel_map_pages'
  mm/built-in.o: In function `prep_new_page':
  mm/page_alloc.c:933: undefined reference to `.kernel_map_pages'
  mm/built-in.o: In function `map_pages':
  mm/compaction.c:61: undefined reference to `.kernel_map_pages'
  make: *** [vmlinux] Error 1

Reason for this problem is that commit 031bc5743f15
("mm/debug-pagealloc: make debug-pagealloc boottime configurable") forgot
to remove old declaration of kernel_map_pages() in some architectures.
This patch removes them to fix build failure.

Reported-by: Kim Phillips <redacted>
Signed-off-by: Joonsoo Kim <redacted>
---
 arch/mn10300/include/asm/cacheflush.h  |    7 -------
 arch/powerpc/include/asm/cacheflush.h  |    7 -------
 arch/s390/include/asm/cacheflush.h     |    4 ----
 arch/sparc/include/asm/cacheflush_64.h |    5 -----
 4 files changed, 23 deletions(-)
diff --git a/arch/mn10300/include/asm/cacheflush.h b/arch/mn10300/include/asm/cacheflush.h
index faed902..6d6df83 100644
--- a/arch/mn10300/include/asm/cacheflush.h
+++ b/arch/mn10300/include/asm/cacheflush.h
@@ -159,13 +159,6 @@ extern void flush_icache_range(unsigned long start, unsigned long end);
 #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
 	memcpy(dst, src, len)
 
-/*
- * Internal debugging function
- */
-#ifdef CONFIG_DEBUG_PAGEALLOC
-extern void kernel_map_pages(struct page *page, int numpages, int enable);
-#endif
-
 #endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_CACHEFLUSH_H */
diff --git a/arch/powerpc/include/asm/cacheflush.h b/arch/powerpc/include/asm/cacheflush.h
index 5b93122..30b35ff 100644
--- a/arch/powerpc/include/asm/cacheflush.h
+++ b/arch/powerpc/include/asm/cacheflush.h
@@ -60,13 +60,6 @@ extern void flush_dcache_phys_range(unsigned long start, unsigned long stop);
 #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
 	memcpy(dst, src, len)
 
-
-
-#ifdef CONFIG_DEBUG_PAGEALLOC
-/* internal debugging function */
-void kernel_map_pages(struct page *page, int numpages, int enable);
-#endif
-
 #endif /* __KERNEL__ */
 
 #endif /* _ASM_POWERPC_CACHEFLUSH_H */
diff --git a/arch/s390/include/asm/cacheflush.h b/arch/s390/include/asm/cacheflush.h
index 3e20383..58fae7d 100644
--- a/arch/s390/include/asm/cacheflush.h
+++ b/arch/s390/include/asm/cacheflush.h
@@ -4,10 +4,6 @@
 /* Caches aren't brain-dead on the s390. */
 #include <asm-generic/cacheflush.h>
 
-#ifdef CONFIG_DEBUG_PAGEALLOC
-void kernel_map_pages(struct page *page, int numpages, int enable);
-#endif
-
 int set_memory_ro(unsigned long addr, int numpages);
 int set_memory_rw(unsigned long addr, int numpages);
 int set_memory_nx(unsigned long addr, int numpages);
diff --git a/arch/sparc/include/asm/cacheflush_64.h b/arch/sparc/include/asm/cacheflush_64.h
index 3896537..68513c4 100644
--- a/arch/sparc/include/asm/cacheflush_64.h
+++ b/arch/sparc/include/asm/cacheflush_64.h
@@ -74,11 +74,6 @@ void flush_ptrace_access(struct vm_area_struct *, struct page *,
 #define flush_cache_vmap(start, end)		do { } while (0)
 #define flush_cache_vunmap(start, end)		do { } while (0)
 
-#ifdef CONFIG_DEBUG_PAGEALLOC
-/* internal debugging function */
-void kernel_map_pages(struct page *page, int numpages, int enable);
-#endif
-
 #endif /* !__ASSEMBLY__ */
 
 #endif /* _SPARC64_CACHEFLUSH_H */
-- 
1.7.9.5

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

From: Kim Phillips <hidden>
Date: 2015-01-22 20:47:14

On Thu, 22 Jan 2015 10:45:51 +0900
Joonsoo Kim [off-list ref] wrote:
On Wed, Jan 21, 2015 at 09:57:59PM +0900, Akinobu Mita wrote:
quoted
2015-01-21 9:07 GMT+09:00 Andrew Morton [off-list ref]:
quoted
On Tue, 20 Jan 2015 15:01:50 -0800 josh@joshtriplett.org wrote:
quoted
On Tue, Jan 20, 2015 at 02:02:00PM -0600, Kim Phillips wrote:
quoted
It's possible to configure DEBUG_PAGEALLOC without PAGE_POISONING on
ppc.  Fix building the generic kernel_map_pages() implementation in
this case:

  LD      init/built-in.o
mm/built-in.o: In function `free_pages_prepare':
mm/page_alloc.c:770: undefined reference to `.kernel_map_pages'
mm/built-in.o: In function `prep_new_page':
mm/page_alloc.c:933: undefined reference to `.kernel_map_pages'
mm/built-in.o: In function `map_pages':
mm/compaction.c:61: undefined reference to `.kernel_map_pages'
make: *** [vmlinux] Error 1
kernel_map_pages() is static inline function since commit 031bc5743f15
("mm/debug-pagealloc: make debug-pagealloc boottime configurable").

But there is old declaration in 'arch/powerpc/include/asm/cacheflush.h'.
Removing it or changing s/kernel_map_pages/__kernel_map_pages/ in this
header file or something can fix this problem?

The architecture which has ARCH_SUPPORTS_DEBUG_PAGEALLOC
including PPC should not build mm/debug-pagealloc.o
Yes, architecture with ARCH_SUPPORTS_DEBUG_PAGEALLOC should not build
mm/debug-pagealloc.o. I attach the patch to remove old declaration.
I hope it will fix Kim's problem.

-------------->8------------------
From 7cb9d1ed8a785df152cb8934e187031c8ebd1bb2 Mon Sep 17 00:00:00 2001
From: Joonsoo Kim <redacted>
Date: Thu, 22 Jan 2015 10:28:58 +0900
Subject: [PATCH] mm/debug_pagealloc: fix build failure on ppc and some other
 archs

Kim Phillips reported following build failure.

  LD      init/built-in.o
  mm/built-in.o: In function `free_pages_prepare':
  mm/page_alloc.c:770: undefined reference to `.kernel_map_pages'
  mm/built-in.o: In function `prep_new_page':
  mm/page_alloc.c:933: undefined reference to `.kernel_map_pages'
  mm/built-in.o: In function `map_pages':
  mm/compaction.c:61: undefined reference to `.kernel_map_pages'
  make: *** [vmlinux] Error 1

Reason for this problem is that commit 031bc5743f15
("mm/debug-pagealloc: make debug-pagealloc boottime configurable") forgot
to remove old declaration of kernel_map_pages() in some architectures.
This patch removes them to fix build failure.

Reported-by: Kim Phillips <redacted>
Signed-off-by: Joonsoo Kim <redacted>
---
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.

Kim

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

From: Akinobu Mita <akinobu.mita@gmail.com>
Date: 2015-01-22 23:49:40

2015-01-23 5:41 GMT+09:00 Kim Phillips [off-list ref]:
On Thu, 22 Jan 2015 10:45:51 +0900
Joonsoo Kim [off-list ref] wrote:
quoted
On Wed, Jan 21, 2015 at 09:57:59PM +0900, Akinobu Mita wrote:
quoted
2015-01-21 9:07 GMT+09:00 Andrew Morton [off-list ref]:
quoted
On Tue, 20 Jan 2015 15:01:50 -0800 josh@joshtriplett.org wrote:
quoted
On Tue, Jan 20, 2015 at 02:02:00PM -0600, Kim Phillips wrote:
quoted
It's possible to configure DEBUG_PAGEALLOC without PAGE_POISONING on
ppc.  Fix building the generic kernel_map_pages() implementation in
this case:

  LD      init/built-in.o
mm/built-in.o: In function `free_pages_prepare':
mm/page_alloc.c:770: undefined reference to `.kernel_map_pages'
mm/built-in.o: In function `prep_new_page':
mm/page_alloc.c:933: undefined reference to `.kernel_map_pages'
mm/built-in.o: In function `map_pages':
mm/compaction.c:61: undefined reference to `.kernel_map_pages'
make: *** [vmlinux] Error 1
kernel_map_pages() is static inline function since commit 031bc5743f15
("mm/debug-pagealloc: make debug-pagealloc boottime configurable").

But there is old declaration in 'arch/powerpc/include/asm/cacheflush.h'.
Removing it or changing s/kernel_map_pages/__kernel_map_pages/ in this
header file or something can fix this problem?

The architecture which has ARCH_SUPPORTS_DEBUG_PAGEALLOC
including PPC should not build mm/debug-pagealloc.o
Yes, architecture with ARCH_SUPPORTS_DEBUG_PAGEALLOC should not build
mm/debug-pagealloc.o. I attach the patch to remove old declaration.
I hope it will fix Kim's problem.

-------------->8------------------
From 7cb9d1ed8a785df152cb8934e187031c8ebd1bb2 Mon Sep 17 00:00:00 2001
From: Joonsoo Kim <redacted>
Date: Thu, 22 Jan 2015 10:28:58 +0900
Subject: [PATCH] mm/debug_pagealloc: fix build failure on ppc and some other
 archs

Kim Phillips reported following build failure.

  LD      init/built-in.o
  mm/built-in.o: In function `free_pages_prepare':
  mm/page_alloc.c:770: undefined reference to `.kernel_map_pages'
  mm/built-in.o: In function `prep_new_page':
  mm/page_alloc.c:933: undefined reference to `.kernel_map_pages'
  mm/built-in.o: In function `map_pages':
  mm/compaction.c:61: undefined reference to `.kernel_map_pages'
  make: *** [vmlinux] Error 1

Reason for this problem is that commit 031bc5743f15
("mm/debug-pagealloc: make debug-pagealloc boottime configurable") forgot
to remove old declaration of kernel_map_pages() in some architectures.
This patch removes them to fix build failure.

Reported-by: Kim Phillips <redacted>
Signed-off-by: Joonsoo Kim <redacted>
---
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.

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

From: Kim Phillips <hidden>
Date: 2015-01-23 03:25:41

On Fri, 23 Jan 2015 08:49:36 +0900
Akinobu Mita [off-list ref] wrote:
2015-01-23 5:41 GMT+09:00 Kim Phillips [off-list ref]:
quoted
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 <redacted>
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 <redacted>
---
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(+)
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
-- 
2.2.2

Thanks,

Kim

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

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2015-01-23 04:24:56

On Thu, 2015-01-22 at 21:20 -0600, Kim Phillips wrote:
On Fri, 23 Jan 2015 08:49:36 +0900
Akinobu Mita [off-list ref] wrote:
quoted
2015-01-23 5:41 GMT+09:00 Kim Phillips [off-list ref]:
quoted
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 <redacted>
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

[PATCH v3] powerpc/mm: fix undefined reference to `.__kernel_map_pages' on FSL PPC64

From: Kim Phillips <hidden>
Date: 2015-01-26 19:27:49

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
for PPC64 machines with 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 <redacted>
---
v3:
- fix wording for hash_utils_64.c implementation pointed out by
Michael Ellerman
- changed designation from 'mm:' to 'powerpc/mm:', as I think this
now belongs in ppc-land

v2:
- corrected SUPPORTS_DEBUG_PAGEALLOC selection to enable
non-STD_MMU_64 builds to use the generic __kernel_map_pages().

depends on:
From: Joonsoo Kim <redacted>
Date: Thu, 22 Jan 2015 10:28:58 +0900
Subject: [PATCH] mm/debug_pagealloc: fix build failure on ppc and some other archs

 arch/powerpc/Kconfig | 1 +
 1 file changed, 1 insertion(+)
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
-- 
2.2.2

Re: [PATCH v3] powerpc/mm: fix undefined reference to `.__kernel_map_pages' on FSL PPC64

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2015-01-28 01:01:06

On Mon, 2015-01-26 at 13:22 -0600, Kim Phillips wrote:
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
for PPC64 machines with 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 <redacted>
---
v3:
- fix wording for hash_utils_64.c implementation pointed out by
Michael Ellerman
- changed designation from 'mm:' to 'powerpc/mm:', as I think this
now belongs in ppc-land

v2:
- corrected SUPPORTS_DEBUG_PAGEALLOC selection to enable
non-STD_MMU_64 builds to use the generic __kernel_map_pages().
I'd be happy to take this through the powerpc tree for 3.20, but for this:
depends on:
From: Joonsoo Kim <redacted>
Date: Thu, 22 Jan 2015 10:28:58 +0900
Subject: [PATCH] mm/debug_pagealloc: fix build failure on ppc and some other archs
I don't have that patch in my tree.

But in what way does this patch depend on that one?

It looks to me like it'd be safe to take this on its own, or am I wrong?

cheers

Re: [PATCH v3] powerpc/mm: fix undefined reference to `.__kernel_map_pages' on FSL PPC64

From: Joonsoo Kim <hidden>
Date: 2015-01-28 01:34:04

2015-01-28 10:01 GMT+09:00 Michael Ellerman [off-list ref]:
On Mon, 2015-01-26 at 13:22 -0600, Kim Phillips wrote:
quoted
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
for PPC64 machines with 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 <redacted>
---
v3:
- fix wording for hash_utils_64.c implementation pointed out by
Michael Ellerman
- changed designation from 'mm:' to 'powerpc/mm:', as I think this
now belongs in ppc-land

v2:
- corrected SUPPORTS_DEBUG_PAGEALLOC selection to enable
non-STD_MMU_64 builds to use the generic __kernel_map_pages().
I'd be happy to take this through the powerpc tree for 3.20, but for this:
quoted
depends on:
From: Joonsoo Kim <redacted>
Date: Thu, 22 Jan 2015 10:28:58 +0900
Subject: [PATCH] mm/debug_pagealloc: fix build failure on ppc and some other archs
I don't have that patch in my tree.

But in what way does this patch depend on that one?

It looks to me like it'd be safe to take this on its own, or am I wrong?
Hello,

These two patches are merged to Andrew's tree now.

Thanks.

Re: [PATCH v3] powerpc/mm: fix undefined reference to `.__kernel_map_pages' on FSL PPC64

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2015-01-28 02:57:36

On Wed, 28 Jan 2015 10:33:59 +0900 Joonsoo Kim [off-list ref] wrote:
2015-01-28 10:01 GMT+09:00 Michael Ellerman [off-list ref]:
quoted
On Mon, 2015-01-26 at 13:22 -0600, Kim Phillips wrote:
quoted
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
for PPC64 machines with 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 <redacted>
---
v3:
- fix wording for hash_utils_64.c implementation pointed out by
Michael Ellerman
- changed designation from 'mm:' to 'powerpc/mm:', as I think this
now belongs in ppc-land

v2:
- corrected SUPPORTS_DEBUG_PAGEALLOC selection to enable
non-STD_MMU_64 builds to use the generic __kernel_map_pages().
I'd be happy to take this through the powerpc tree for 3.20, but for this:
quoted
depends on:
From: Joonsoo Kim <redacted>
Date: Thu, 22 Jan 2015 10:28:58 +0900
Subject: [PATCH] mm/debug_pagealloc: fix build failure on ppc and some other archs
I don't have that patch in my tree.

But in what way does this patch depend on that one?

It looks to me like it'd be safe to take this on its own, or am I wrong?
Hello,

These two patches are merged to Andrew's tree now.
That didn't answer either of Michael's questions ;)

Yes, I think they're independent.  I was holding off on the powerpc
one, waiting to see if it popped up in linux-next via your tree.  I can
merge both if you like?

Re: [PATCH v3] powerpc/mm: fix undefined reference to `.__kernel_map_pages' on FSL PPC64

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2015-01-28 03:22:08

On Tue, 2015-01-27 at 18:57 -0800, Andrew Morton wrote:
On Wed, 28 Jan 2015 10:33:59 +0900 Joonsoo Kim [off-list ref] wrote:
quoted
2015-01-28 10:01 GMT+09:00 Michael Ellerman [off-list ref]:
quoted
On Mon, 2015-01-26 at 13:22 -0600, Kim Phillips wrote:
quoted
arch/powerpc has __kernel_map_pages implementations in mm/pgtable_32.c, and
I'd be happy to take this through the powerpc tree for 3.20, but for this:
quoted
depends on:
From: Joonsoo Kim <redacted>
Date: Thu, 22 Jan 2015 10:28:58 +0900
Subject: [PATCH] mm/debug_pagealloc: fix build failure on ppc and some other archs
I don't have that patch in my tree.

But in what way does this patch depend on that one?

It looks to me like it'd be safe to take this on its own, or am I wrong?
Hello,

These two patches are merged to Andrew's tree now.
That didn't answer either of Michael's questions ;)

Yes, I think they're independent.  I was holding off on the powerpc
one, waiting to see if it popped up in linux-next via your tree.  I can
merge both if you like?
Right, I didn't think I'd seen it in your tree :)

I'm happy to take this one, saves a possible merge conflict.

cheers

Re: [PATCH v3] powerpc/mm: fix undefined reference to `.__kernel_map_pages' on FSL PPC64

From: Kim Phillips <hidden>
Date: 2015-01-28 20:19:45

On Wed, 28 Jan 2015 14:22:02 +1100
Michael Ellerman [off-list ref] wrote:
On Tue, 2015-01-27 at 18:57 -0800, Andrew Morton wrote:
quoted
On Wed, 28 Jan 2015 10:33:59 +0900 Joonsoo Kim [off-list ref] wrote:
quoted
2015-01-28 10:01 GMT+09:00 Michael Ellerman [off-list ref]:
quoted
On Mon, 2015-01-26 at 13:22 -0600, Kim Phillips wrote:
quoted
arch/powerpc has __kernel_map_pages implementations in mm/pgtable_32.c, and
I'd be happy to take this through the powerpc tree for 3.20, but for this:
quoted
depends on:
From: Joonsoo Kim <redacted>
Date: Thu, 22 Jan 2015 10:28:58 +0900
Subject: [PATCH] mm/debug_pagealloc: fix build failure on ppc and some other archs
I don't have that patch in my tree.

But in what way does this patch depend on that one?

It looks to me like it'd be safe to take this on its own, or am I wrong?
Hello,

These two patches are merged to Andrew's tree now.
That didn't answer either of Michael's questions ;)

Yes, I think they're independent.  I was holding off on the powerpc
sorry - my bad, they are indeed completely independent.
quoted
one, waiting to see if it popped up in linux-next via your tree.  I can
merge both if you like?
Right, I didn't think I'd seen it in your tree :)

I'm happy to take this one, saves a possible merge conflict.
I'm fine either way (I work on linux-next).

Kim

Re: [PATCH v3] powerpc/mm: fix undefined reference to `.__kernel_map_pages' on FSL PPC64

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2015-01-29 04:06:00

On Wed, 2015-01-28 at 14:14 -0600, Kim Phillips wrote:
On Wed, 28 Jan 2015 14:22:02 +1100
Michael Ellerman [off-list ref] wrote:
quoted
On Tue, 2015-01-27 at 18:57 -0800, Andrew Morton wrote:
quoted
On Wed, 28 Jan 2015 10:33:59 +0900 Joonsoo Kim [off-list ref] wrote:
quoted
2015-01-28 10:01 GMT+09:00 Michael Ellerman [off-list ref]:
quoted
On Mon, 2015-01-26 at 13:22 -0600, Kim Phillips wrote:
quoted
arch/powerpc has __kernel_map_pages implementations in mm/pgtable_32.c, and
I'd be happy to take this through the powerpc tree for 3.20, but for this:
quoted
depends on:
From: Joonsoo Kim <redacted>
Date: Thu, 22 Jan 2015 10:28:58 +0900
Subject: [PATCH] mm/debug_pagealloc: fix build failure on ppc and some other archs
I don't have that patch in my tree.

But in what way does this patch depend on that one?

It looks to me like it'd be safe to take this on its own, or am I wrong?
Hello,

These two patches are merged to Andrew's tree now.
That didn't answer either of Michael's questions ;)

Yes, I think they're independent.  I was holding off on the powerpc
sorry - my bad, they are indeed completely independent.
 
No worries.
quoted
quoted
one, waiting to see if it popped up in linux-next via your tree.  I can
merge both if you like?
Right, I didn't think I'd seen it in your tree :)

I'm happy to take this one, saves a possible merge conflict.
I'm fine either way (I work on linux-next).
Cool. It's in my next as of now, so should be in linux-next tomorrow (30th).

cheers

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

From: Kim Phillips <hidden>
Date: 2015-01-26 19:29:42

On Thu, 22 Jan 2015 10:45:51 +0900
Joonsoo Kim [off-list ref] wrote:
From 7cb9d1ed8a785df152cb8934e187031c8ebd1bb2 Mon Sep 17 00:00:00 2001
From: Joonsoo Kim <redacted>
Date: Thu, 22 Jan 2015 10:28:58 +0900
Subject: [PATCH] mm/debug_pagealloc: fix build failure on ppc and some other
 archs

Kim Phillips reported following build failure.

  LD      init/built-in.o
  mm/built-in.o: In function `free_pages_prepare':
  mm/page_alloc.c:770: undefined reference to `.kernel_map_pages'
  mm/built-in.o: In function `prep_new_page':
  mm/page_alloc.c:933: undefined reference to `.kernel_map_pages'
  mm/built-in.o: In function `map_pages':
  mm/compaction.c:61: undefined reference to `.kernel_map_pages'
  make: *** [vmlinux] Error 1

Reason for this problem is that commit 031bc5743f15
("mm/debug-pagealloc: make debug-pagealloc boottime configurable") forgot
to remove old declaration of kernel_map_pages() in some architectures.
This patch removes them to fix build failure.

Reported-by: Kim Phillips <redacted>
Signed-off-by: Joonsoo Kim <redacted>
---
Acked-by: Kim Phillips <redacted>

Thanks,

Kim

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

From: Joonsoo Kim <hidden>
Date: 2015-01-27 07:55:41

On Thu, Jan 22, 2015 at 10:45:51AM +0900, Joonsoo Kim wrote:
On Wed, Jan 21, 2015 at 09:57:59PM +0900, Akinobu Mita wrote:
quoted
2015-01-21 9:07 GMT+09:00 Andrew Morton [off-list ref]:
quoted
On Tue, 20 Jan 2015 15:01:50 -0800 josh@joshtriplett.org wrote:
quoted
On Tue, Jan 20, 2015 at 02:02:00PM -0600, Kim Phillips wrote:
quoted
It's possible to configure DEBUG_PAGEALLOC without PAGE_POISONING on
ppc.  Fix building the generic kernel_map_pages() implementation in
this case:

  LD      init/built-in.o
mm/built-in.o: In function `free_pages_prepare':
mm/page_alloc.c:770: undefined reference to `.kernel_map_pages'
mm/built-in.o: In function `prep_new_page':
mm/page_alloc.c:933: undefined reference to `.kernel_map_pages'
mm/built-in.o: In function `map_pages':
mm/compaction.c:61: undefined reference to `.kernel_map_pages'
make: *** [vmlinux] Error 1
kernel_map_pages() is static inline function since commit 031bc5743f15
("mm/debug-pagealloc: make debug-pagealloc boottime configurable").

But there is old declaration in 'arch/powerpc/include/asm/cacheflush.h'.
Removing it or changing s/kernel_map_pages/__kernel_map_pages/ in this
header file or something can fix this problem?

The architecture which has ARCH_SUPPORTS_DEBUG_PAGEALLOC
including PPC should not build mm/debug-pagealloc.o
Yes, architecture with ARCH_SUPPORTS_DEBUG_PAGEALLOC should not build
mm/debug-pagealloc.o. I attach the patch to remove old declaration.
I hope it will fix Kim's problem.

-------------->8------------------
quoted
From 7cb9d1ed8a785df152cb8934e187031c8ebd1bb2 Mon Sep 17 00:00:00 2001
From: Joonsoo Kim <redacted>
Date: Thu, 22 Jan 2015 10:28:58 +0900
Subject: [PATCH] mm/debug_pagealloc: fix build failure on ppc and some other
 archs

Kim Phillips reported following build failure.

  LD      init/built-in.o
  mm/built-in.o: In function `free_pages_prepare':
  mm/page_alloc.c:770: undefined reference to `.kernel_map_pages'
  mm/built-in.o: In function `prep_new_page':
  mm/page_alloc.c:933: undefined reference to `.kernel_map_pages'
  mm/built-in.o: In function `map_pages':
  mm/compaction.c:61: undefined reference to `.kernel_map_pages'
  make: *** [vmlinux] Error 1

Reason for this problem is that commit 031bc5743f15
("mm/debug-pagealloc: make debug-pagealloc boottime configurable") forgot
to remove old declaration of kernel_map_pages() in some architectures.
This patch removes them to fix build failure.

Reported-by: Kim Phillips <redacted>
Signed-off-by: Joonsoo Kim <redacted>
Hello, Andrew.

Could you take this patch?
This patch is also needed to fix build failure.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help