Skip to contentSkip to conversation

init/main.c:540:2: error: implicit declaration of function 'pgd_cache_init'

PATCH Nadav Amit 1 participant 1 message May 5, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Nadav Amit

author
#1 lore raw
In reply to a message not in the archive
Quoted 48 lines · kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/mm
head:   ef5f22b4e5caf7e5ac12b28d4c9566c95d709ba5
commit: ef5f22b4e5caf7e5ac12b28d4c9566c95d709ba5 [36/36] x86/mm: Initialize PGD cache during mm initialization
config: openrisc-or1ksim_defconfig (attached as .config)
compiler: or1k-linux-gcc (GCC) 6.0.0 20160327 (experimental)

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
git checkout ef5f22b4e5caf7e5ac12b28d4c9566c95d709ba5
# save the attached .config to linux build tree
make.cross ARCH=openrisc

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

init/main.c: In function 'mm_init':

Quoted 1 line
Quoted 1 line

init/main.c:540:2: error: implicit declaration of function 'pgd_cache_init' [-Werror=implicit-function-declaration]

    pgd_cache_init();
    ^~~~~~~~~~~~~~

cc1: some warnings being treated as errors

vim +/pgd_cache_init +540 init/main.c

519
520 /*
521 * Set up kernel memory allocators
522 */
523 static void __init mm_init(void)
524 {
525 /*
526 * page_ext requires contiguous pages,
527 * bigger than MAX_ORDER unless SPARSEMEM.
528 */
529 page_ext_init_flatmem();
530 mem_init();
531 kmem_cache_init();
532 pgtable_init();
533 debug_objects_mem_init();
534 vmalloc_init();
535 ioremap_huge_init();
536 /* Should be run before the first non-init thread is created */
537 init_espfix_bsp();
538 /* Should be run after espfix64 is set up. */
539 pti_init();

Quoted 8 lines
Quoted 1 line

540 pgd_cache_init();

541 }
542

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
<.config.gz>

Sorry for that - I got confused and forgot this is not arch-specific code. I don’t see the latest commit in the x86/mm tree, so I assume you can squash the following on top?

-- >8 --

Subject: [PATCH] x86/mm: Fix breakage due to missing pgd_cache_init()

Set pgd_cache_init() as a weak symbol.

---
 arch/x86/include/asm/pgtable.h | 1 -
 include/asm-generic/pgtable.h  | 2 ++
 init/main.c                    | 2 ++
 3 files changed, 4 insertions(+), 1 deletion(-)
arch/x86/include/asm/pgtable.h +0 -1
index 9635662e1163..6b6bfdfe83aa 100644
@@ -1027,7 +1027,6 @@ static inline int pgd_none(pgd_t pgd)
 
 extern int direct_gbpages;
 void init_mem_mapping(void);
-void pgd_cache_init(void);
 void early_alloc_pgt_buf(void);
 extern void memblock_find_dma_reserve(void);
 
include/asm-generic/pgtable.h +2 -0
index fa782fba51ee..75d9d68a6de7 100644
@@ -1126,6 +1126,8 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
 static inline void init_espfix_bsp(void) { }
 #endif
 
+extern void __init pgd_cache_init(void);
+
 #ifndef __HAVE_ARCH_PFN_MODIFY_ALLOWED
 static inline bool pfn_modify_allowed(unsigned long pfn, pgprot_t prot)
 {
init/main.c +2 -0
index 7fac4ac2fede..2f99b3f40aaa 100644
@@ -506,6 +506,8 @@ void __init __weak mem_encrypt_init(void) { }
 
 void __init __weak poking_init(void) { }
 
+void __init __weak pgd_cache_init(void) { }
+
 bool initcall_debug;
 core_param(initcall_debug, initcall_debug, bool, 0644);
 
Signature · 1 line
2.17.1