[avpatel:memperf_test_v1 7/7] include/asm-generic/memory_model.h:26:58: error: 'vmemmap' undeclared; did you mean 'mem_map'?

From: kernel test robot
Date: Fri Jan 28 2022 - 16:04:17 EST


tree: https://github.com/avpatel/linux.git memperf_test_v1
head: ad86979ac717673ec1647f1148a5c7cd214a1f39
commit: ad86979ac717673ec1647f1148a5c7cd214a1f39 [7/7] lib: Add memperf test
config: sparc-allyesconfig (https://download.01.org/0day-ci/archive/20220129/202201290422.wXXPptlV-lkp@xxxxxxxxx/config)
compiler: sparc64-linux-gcc (GCC) 11.2.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://github.com/avpatel/linux/commit/ad86979ac717673ec1647f1148a5c7cd214a1f39
git remote add avpatel https://github.com/avpatel/linux.git
git fetch --no-tags avpatel memperf_test_v1
git checkout ad86979ac717673ec1647f1148a5c7cd214a1f39
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=sparc SHELL=/bin/bash

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

All errors (new ones prefixed by >>):

lib/memperf_test.c: In function 'memset_perf_test':
lib/memperf_test.c:33:15: error: implicit declaration of function 'page_to_virt'; did you mean 'phys_to_virt'? [-Werror=implicit-function-declaration]
33 | dst = page_to_virt(dpage);
| ^~~~~~~~~~~~
| phys_to_virt
lib/memperf_test.c:33:13: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
33 | dst = page_to_virt(dpage);
| ^
In file included from arch/sparc/include/asm/page_64.h:130,
from arch/sparc/include/asm/page.h:8,
from include/linux/mm_types_task.h:16,
from include/linux/mm_types.h:5,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from lib/memperf_test.c:3:
>> include/asm-generic/memory_model.h:26:58: error: 'vmemmap' undeclared (first use in this function); did you mean 'mem_map'?
26 | #define __page_to_pfn(page) (unsigned long)((page) - vmemmap)
| ^~~~~~~
include/asm-generic/memory_model.h:52:21: note: in expansion of macro '__page_to_pfn'
52 | #define page_to_pfn __page_to_pfn
| ^~~~~~~~~~~~~
lib/memperf_test.c:44:27: note: in expansion of macro 'page_to_pfn'
44 | free_contig_range(page_to_pfn(dpage), MEM_PAGES);
| ^~~~~~~~~~~
include/asm-generic/memory_model.h:26:58: note: each undeclared identifier is reported only once for each function it appears in
26 | #define __page_to_pfn(page) (unsigned long)((page) - vmemmap)
| ^~~~~~~
include/asm-generic/memory_model.h:52:21: note: in expansion of macro '__page_to_pfn'
52 | #define page_to_pfn __page_to_pfn
| ^~~~~~~~~~~~~
lib/memperf_test.c:44:27: note: in expansion of macro 'page_to_pfn'
44 | free_contig_range(page_to_pfn(dpage), MEM_PAGES);
| ^~~~~~~~~~~
lib/memperf_test.c: In function 'memcpy_memmove_perf_test':
lib/memperf_test.c:62:13: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
62 | src = page_to_virt(spage);
| ^
lib/memperf_test.c:64:13: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
64 | dst = page_to_virt(dpage);
| ^
In file included from arch/sparc/include/asm/page_64.h:130,
from arch/sparc/include/asm/page.h:8,
from include/linux/mm_types_task.h:16,
from include/linux/mm_types.h:5,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from lib/memperf_test.c:3:
>> include/asm-generic/memory_model.h:26:58: error: 'vmemmap' undeclared (first use in this function); did you mean 'mem_map'?
26 | #define __page_to_pfn(page) (unsigned long)((page) - vmemmap)
| ^~~~~~~
include/asm-generic/memory_model.h:52:21: note: in expansion of macro '__page_to_pfn'
52 | #define page_to_pfn __page_to_pfn
| ^~~~~~~~~~~~~
lib/memperf_test.c:83:27: note: in expansion of macro 'page_to_pfn'
83 | free_contig_range(page_to_pfn(dpage), MEM_PAGES);
| ^~~~~~~~~~~
cc1: some warnings being treated as errors


vim +26 include/asm-generic/memory_model.h

8f6aac419bd590 Christoph Lameter 2007-10-16 23
af901ca181d92a André Goddard Rosa 2009-11-14 24 /* memmap is virtually contiguous. */
8f6aac419bd590 Christoph Lameter 2007-10-16 25 #define __pfn_to_page(pfn) (vmemmap + (pfn))
32272a26974d20 Martin Schwidefsky 2008-12-25 @26 #define __page_to_pfn(page) (unsigned long)((page) - vmemmap)
8f6aac419bd590 Christoph Lameter 2007-10-16 27

:::::: The code at line 26 was first introduced by commit
:::::: 32272a26974d2027384fd4010cd1780fca425d94 [S390] __page_to_pfn warnings

:::::: TO: Martin Schwidefsky <schwidefsky@xxxxxxxxxx>
:::::: CC: Martin Schwidefsky <schwidefsky@xxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx