[arm-integrator:kernel-in-vmalloc-v5.18-rc1 18/31] arch/arc/include/asm/page.h:96:16: error: implicit declaration of function '__pa'

From: kernel test robot
Date: Thu Jun 02 2022 - 07:38:47 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git kernel-in-vmalloc-v5.18-rc1
head: 9083f89a58302e92fad7f144986e307db2350aad
commit: 41026b6c37af5a9cf176a9c4cea5b350005f720a [18/31] ARC: mm: Make virt_to_pfn() a static inline
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220602/202206021901.8rEMndYL-lkp@xxxxxxxxx/config)
compiler: arceb-elf-gcc (GCC) 11.3.0
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/linusw/linux-integrator.git/commit/?id=41026b6c37af5a9cf176a9c4cea5b350005f720a
git remote add arm-integrator https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git
git fetch --no-tags arm-integrator kernel-in-vmalloc-v5.18-rc1
git checkout 41026b6c37af5a9cf176a9c4cea5b350005f720a
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=arc prepare

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All error/warnings (new ones prefixed by >>):

In file included from arch/arc/include/asm/thread_info.h:16,
from include/linux/thread_info.h:60,
from include/asm-generic/preempt.h:5,
from ./arch/arc/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/rcupdate.h:27,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from arch/arc/kernel/asm-offsets.c:6:
arch/arc/include/asm/page.h: In function 'virt_to_pfn':
>> arch/arc/include/asm/page.h:96:16: error: implicit declaration of function '__pa' [-Werror=implicit-function-declaration]
96 | return __pa(kaddr) >> PAGE_SHIFT;
| ^~~~
In file included from arch/arc/include/asm/page.h:137,
from arch/arc/include/asm/thread_info.h:16,
from include/linux/thread_info.h:60,
from include/asm-generic/preempt.h:5,
from ./arch/arc/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/rcupdate.h:27,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from arch/arc/kernel/asm-offsets.c:6:
include/linux/mm.h: In function 'pte_lockptr':
>> arch/arc/include/asm/pgtable-levels.h:163:47: warning: passing argument 1 of 'virt_to_pfn' makes pointer from integer without a cast [-Wint-conversion]
163 | #define pmd_page_vaddr(pmd) (pmd_val(pmd) & PAGE_MASK)
| ~~~~~~~~~~~~~~^~~~~~~~~~~~
| |
| long unsigned int
include/asm-generic/memory_model.h:18:46: note: in definition of macro '__pfn_to_page'
18 | #define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET))
| ^~~
arch/arc/include/asm/pgtable-levels.h:165:33: note: in expansion of macro 'virt_to_page'
165 | #define pmd_page(pmd) virt_to_page(pmd_page_vaddr(pmd))
| ^~~~~~~~~~~~
arch/arc/include/asm/pgtable-levels.h:165:46: note: in expansion of macro 'pmd_page_vaddr'
165 | #define pmd_page(pmd) virt_to_page(pmd_page_vaddr(pmd))
| ^~~~~~~~~~~~~~
include/linux/mm.h:2287:27: note: in expansion of macro 'pmd_page'
2287 | return ptlock_ptr(pmd_page(*pmd));
| ^~~~~~~~
In file included from arch/arc/include/asm/thread_info.h:16,
from include/linux/thread_info.h:60,
from include/asm-generic/preempt.h:5,
from ./arch/arc/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/rcupdate.h:27,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from arch/arc/kernel/asm-offsets.c:6:
arch/arc/include/asm/page.h:94:53: note: expected 'const void *' but argument is of type 'long unsigned int'
94 | static inline unsigned long virt_to_pfn(const void *kaddr)
| ~~~~~~~~~~~~^~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:120: arch/arc/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1194: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:219: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.


vim +/__pa +96 arch/arc/include/asm/page.h

86
87 /*
88 * Use virt_to_pfn with caution:
89 * If used in pte or paddr related macros, it could cause truncation
90 * in PAE40 builds
91 * As a rule of thumb, only use it in helpers starting with virt_
92 * You have been warned !
93 */
94 static inline unsigned long virt_to_pfn(const void *kaddr)
95 {
> 96 return __pa(kaddr) >> PAGE_SHIFT;
97 }
98

--
0-DAY CI Kernel Test Service
https://01.org/lkp