Re: [linux-next:master 5094/7430] arch/riscv/mm/init.c:454:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__inidata'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 4 Jun 2021 20:59:42 +0800
kernel test robot <lkp@xxxxxxxxx> wrote:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   ccc252d2e818f6a479441119ad453c3ce7c7c461
> commit: 010623568222bd144eb73aa9f3b46c79b63d7676 [5094/7430] riscv: mm: init: Consolidate vars, functions
> config: riscv-randconfig-r002-20210604 (attached as .config)
> compiler: riscv32-linux-gcc (GCC) 9.3.0

This is the key, RV32GC platform! the pfn_pmd() is only defined in pgtable-64.h,
so we need one more fix patch for commit e88b333142e ("riscv: mm: add THP
support on 64-bit"). I'll send out a fix

> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=010623568222bd144eb73aa9f3b46c79b63d7676
>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>         git fetch --no-tags linux-next master
>         git checkout 010623568222bd144eb73aa9f3b46c79b63d7676
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> 
> All errors (new ones prefixed by >>):
> 
>    In file included from include/linux/pgtable.h:6,
>                     from include/linux/mm.h:33,
>                     from arch/riscv/mm/init.c:10:
>    arch/riscv/include/asm/pgtable.h: In function 'mk_pmd':
>    arch/riscv/include/asm/pgtable.h:518:9: error: implicit declaration of function 'pfn_pmd'; did you mean 'pfn_pgd'? [-Werror=implicit-function-declaration]
>      518 |  return pfn_pmd(page_to_pfn(page), prot);
>          |         ^~~~~~~
>          |         pfn_pgd
>    In file included from arch/riscv/include/asm/page.h:185,
>                     from arch/riscv/include/asm/thread_info.h:11,
>                     from include/linux/thread_info.h:59,
>                     from include/asm-generic/preempt.h:5,
>                     from ./arch/riscv/include/generated/asm/preempt.h:1,
>                     from include/linux/preempt.h:78,
>                     from include/linux/spinlock.h:51,
>                     from include/linux/mmzone.h:8,
>                     from include/linux/gfp.h:6,
>                     from include/linux/mm.h:10,
>                     from arch/riscv/mm/init.c:10:
>    include/asm-generic/memory_model.h:64:14: error: implicit declaration of function 'page_to_section'; did you mean 'present_section'? [-Werror=implicit-function-declaration]
>       64 |  int __sec = page_to_section(__pg);   \
>          |              ^~~~~~~~~~~~~~~
>    include/asm-generic/memory_model.h:81:21: note: in expansion of macro '__page_to_pfn'
>       81 | #define page_to_pfn __page_to_pfn
>          |                     ^~~~~~~~~~~~~
>    arch/riscv/include/asm/pgtable.h:518:17: note: in expansion of macro 'page_to_pfn'
>      518 |  return pfn_pmd(page_to_pfn(page), prot);
>          |                 ^~~~~~~~~~~
>    In file included from include/linux/pgtable.h:6,
>                     from include/linux/mm.h:33,
>                     from arch/riscv/mm/init.c:10:
>    arch/riscv/include/asm/pgtable.h:518:9: error: incompatible types when returning type 'int' but 'pmd_t' {aka 'struct <anonymous>'} was expected
>      518 |  return pfn_pmd(page_to_pfn(page), prot);
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    In file included from arch/riscv/mm/init.c:10:
>    include/linux/mm.h: At top level:
>    include/linux/mm.h:1552:29: error: conflicting types for 'page_to_section'
>     1552 | static inline unsigned long page_to_section(const struct page *page)
>          |                             ^~~~~~~~~~~~~~~
>    In file included from arch/riscv/include/asm/page.h:185,
>                     from arch/riscv/include/asm/thread_info.h:11,
>                     from include/linux/thread_info.h:59,
>                     from include/asm-generic/preempt.h:5,
>                     from ./arch/riscv/include/generated/asm/preempt.h:1,
>                     from include/linux/preempt.h:78,
>                     from include/linux/spinlock.h:51,
>                     from include/linux/mmzone.h:8,
>                     from include/linux/gfp.h:6,
>                     from include/linux/mm.h:10,
>                     from arch/riscv/mm/init.c:10:
>    include/asm-generic/memory_model.h:64:14: note: previous implicit declaration of 'page_to_section' was here
>       64 |  int __sec = page_to_section(__pg);   \
>          |              ^~~~~~~~~~~~~~~
>    include/asm-generic/memory_model.h:81:21: note: in expansion of macro '__page_to_pfn'
>       81 | #define page_to_pfn __page_to_pfn
>          |                     ^~~~~~~~~~~~~
>    arch/riscv/include/asm/pgtable.h:518:17: note: in expansion of macro 'page_to_pfn'
>      518 |  return pfn_pmd(page_to_pfn(page), prot);
>          |                 ^~~~~~~~~~~
>    In file included from include/linux/kexec.h:28,
>                     from include/linux/crash_dump.h:5,
>                     from arch/riscv/mm/init.c:20:
>    arch/riscv/include/asm/kexec.h:45:1: warning: 'extern' is not at beginning of declaration [-Wold-style-declaration]
>       45 | const extern unsigned char riscv_kexec_relocate[];
>          | ^~~~~
>    arch/riscv/include/asm/kexec.h:46:1: warning: 'extern' is not at beginning of declaration [-Wold-style-declaration]
>       46 | const extern unsigned int riscv_kexec_relocate_size;
>          | ^~~~~
> >> arch/riscv/mm/init.c:454:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__inidata'  
>      454 | static uintptr_t xiprom __inidata;

Vitaly has sent a patch to fix this typo.

>          |                         ^~~~~~~~~
>    In file included from include/linux/pgtable.h:6,
>                     from include/linux/mm.h:33,
>                     from arch/riscv/mm/init.c:10:
>    arch/riscv/mm/init.c: In function 'create_kernel_page_table':
> >> arch/riscv/mm/init.c:457:51: error: 'xiprom' undeclared (first use in this function); did you mean '_xiprom'?  
>      457 | #define xiprom         (*((uintptr_t *)XIP_FIXUP(&xiprom)))
>          |                                                   ^~~~~~
>    arch/riscv/include/asm/pgtable.h:98:30: note: in definition of macro 'XIP_FIXUP'
>       98 |  uintptr_t __a = (uintptr_t)(addr);     \
>          |                              ^~~~
>    arch/riscv/mm/init.c:467:8: note: in expansion of macro 'xiprom'
>      467 |        xiprom + (va - kernel_virt_addr),
>          |        ^~~~~~
>    arch/riscv/mm/init.c:457:51: note: each undeclared identifier is reported only once for each function it appears in
>      457 | #define xiprom         (*((uintptr_t *)XIP_FIXUP(&xiprom)))
>          |                                                   ^~~~~~
>    arch/riscv/include/asm/pgtable.h:98:30: note: in definition of macro 'XIP_FIXUP'
>       98 |  uintptr_t __a = (uintptr_t)(addr);     \
>          |                              ^~~~
>    arch/riscv/mm/init.c:467:8: note: in expansion of macro 'xiprom'
>      467 |        xiprom + (va - kernel_virt_addr),
>          |        ^~~~~~
>    arch/riscv/mm/init.c: In function 'setup_vm':
> >> arch/riscv/mm/init.c:457:51: error: 'xiprom' undeclared (first use in this function); did you mean '_xiprom'?  
>      457 | #define xiprom         (*((uintptr_t *)XIP_FIXUP(&xiprom)))
>          |                                                   ^~~~~~
>    arch/riscv/include/asm/pgtable.h:98:30: note: in definition of macro 'XIP_FIXUP'
>       98 |  uintptr_t __a = (uintptr_t)(addr);     \
>          |                              ^~~~
>    arch/riscv/mm/init.c:499:2: note: in expansion of macro 'xiprom'
>      499 |  xiprom = (uintptr_t)CONFIG_XIP_PHYS_ADDR;
>          |  ^~~~~~
>    cc1: some warnings being treated as errors
> 
> 
> vim +454 arch/riscv/mm/init.c
> 
>    452	
>    453	#ifdef CONFIG_XIP_KERNEL
>  > 454	static uintptr_t xiprom __inidata;  
>    455	static uintptr_t xiprom_sz __initdata;
>    456	#define xiprom_sz      (*((uintptr_t *)XIP_FIXUP(&xiprom_sz)))
>  > 457	#define xiprom         (*((uintptr_t *)XIP_FIXUP(&xiprom)))  
>    458	
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx






[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux