Thread (2 messages) 2 messages, 2 authors, 2021-03-30

Re: [linux-next:master 7236/7588] mm/util.c:999:2: error: statement requires expression of scalar type ('void' invalid)

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2021-03-30 00:38:37
Also in: oe-kbuild-all

On Mon, 29 Mar 2021 15:21:47 +0800 kernel test robot [off-list ref] wrote:
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   931294922e65a23e1aad6398b9ae02df74044679
commit: d1f75d5ddea82b2c610d194d253b4d4ecdaa6be3 [7236/7588] mm/util.c: reduce mem_dump_obj() object size
config: riscv-randconfig-r034-20210328 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 821547cabb5819ed42245376a9afcd11cdee5ddd)
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
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=d1f75d5ddea82b2c610d194d253b4d4ecdaa6be3
        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 d1f75d5ddea82b2c610d194d253b4d4ecdaa6be3
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv 

...

                                                     ~~~~~~~~~~ ^
   In file included from mm/util.c:29:
   mm/internal.h:454:8: error: use of undeclared identifier 'max_mapnr'
                   if (!pfn_valid(pfn))
                        ^
   arch/riscv/include/asm/page.h:130:62: note: expanded from macro 'pfn_valid'
           (((pfn) >= ARCH_PFN_OFFSET) && (((pfn) - ARCH_PFN_OFFSET) < max_mapnr))
                                                                       ^
   mm/util.c:999:6: error: use of undeclared identifier 'max_mapnr'
           if (virt_addr_valid(object))
               ^
   arch/riscv/include/asm/page.h:137:43: note: expanded from macro 'virt_addr_valid'
           (unsigned long)(_addr) >= PAGE_OFFSET && pfn_valid(virt_to_pfn(_addr)); \
                                                    ^
   arch/riscv/include/asm/page.h:130:62: note: expanded from macro 'pfn_valid'
           (((pfn) >= ARCH_PFN_OFFSET) && (((pfn) - ARCH_PFN_OFFSET) < max_mapnr))
                                                                       ^
quoted
quoted
mm/util.c:999:2: error: statement requires expression of scalar type ('void' invalid)
           if (virt_addr_valid(object))
           ^   ~~~~~~~~~~~~~~~~~~~~~~~
   7 warnings and 3 errors generated.
"mm/util.c: reduce mem_dump_obj() object size" can't be the cause of this.

It appears that riscv doesn't handle CONFIG_NEED_MULTIPLE_NODES=y.  Its
pfn_valid() (and hence virt_addr_valid()) implementations require that
max_mapnr be defined and implemented.  But with
CONFIG_NEED_MULTIPLE_NODES=y, that is not the case.

Probably riscv needs some Kconfig fix to disallow this config combination.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help