On Mon, Jan 18, 2021 at 08:44:40AM +0800, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > head: b3a3cbdec55b090d22a09f75efb7c7d34cb97f25 > commit: 5577d3803e8c46cfe63791e5fd0cb2c782d4db3b [3945/3956] mm: introduce memfd_secret system call to create "secret" memory areas > config: riscv-randconfig-r003-20210118 (attached as .config) > compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project bfd75bdf3fd62d4f5e7028d4122f9ffa517f2a09) > 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=5577d3803e8c46cfe63791e5fd0cb2c782d4db3b > 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 5577d3803e8c46cfe63791e5fd0cb2c782d4db3b > # save the attached .config to linux build tree > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang 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 mm/secretmem.c:14: > In file included from include/linux/pagemap.h:11: > In file included from include/linux/highmem.h:10: > In file included from include/linux/hardirq.h:10: > In file included from ./arch/riscv/include/generated/asm/hardirq.h:1: > In file included from include/asm-generic/hardirq.h:17: > In file included from include/linux/irq.h:20: > In file included from include/linux/io.h:13: > In file included from arch/riscv/include/asm/io.h:149: > include/asm-generic/io.h:1005:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] > return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port; > ~~~~~~~~~~ ^ > >> mm/secretmem.c:107:6: error: implicit declaration of function 'mlock_future_check' [-Werror,-Wimplicit-function-declaration] > if (mlock_future_check(vma->vm_mm, vma->vm_flags | VM_LOCKED, len)) > ^ > 7 warnings and 1 error generated. > > > vim +/mlock_future_check +107 mm/secretmem.c > > 99 > 100 static int secretmem_mmap(struct file *file, struct vm_area_struct *vma) > 101 { > 102 unsigned long len = vma->vm_end - vma->vm_start; > 103 > 104 if ((vma->vm_flags & (VM_SHARED | VM_MAYSHARE)) == 0) > 105 return -EINVAL; > 106 > > 107 if (mlock_future_check(vma->vm_mm, vma->vm_flags | VM_LOCKED, len)) > 108 return -EAGAIN; > 109 > 110 vma->vm_ops = &secretmem_vm_ops; > 111 vma->vm_flags |= VM_LOCKED; > 112 > 113 return 0; > 114 } > 115 > The patch vs v5.11-rc3-mmots-2021-01-12-02-00 below should fix this: >From 51b925943bcf65b82d2ba3b30082a0665681585c Mon Sep 17 00:00:00 2001 From: Mike Rapoport <rppt@xxxxxxxxxxxxx> Date: Mon, 18 Jan 2021 10:03:29 +0200 Subject: [PATCH] riscv/Kconfig: make direct map manipulation options depend on MMU ARCH_HAS_SET_DIRECT_MAP and ARCH_HAS_SET_MEMORY configuration options have no meaning when CONFIG_MMU is disabled and there is no point to enable them for the nommu case. Add an explicit dependency on MMU for these options. Reported-by: kernel test robot <lkp@xxxxxxxxx> Signed-off-by: Mike Rapoport <rppt@xxxxxxxxxxxxx> --- arch/riscv/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 2ef05ef921b5..dd295dba8a8d 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -25,8 +25,8 @@ config RISCV select ARCH_HAS_KCOV select ARCH_HAS_MMIOWB select ARCH_HAS_PTE_SPECIAL - select ARCH_HAS_SET_DIRECT_MAP - select ARCH_HAS_SET_MEMORY + select ARCH_HAS_SET_DIRECT_MAP if MMU + select ARCH_HAS_SET_MEMORY if MMU select ARCH_HAS_STRICT_KERNEL_RWX if MMU select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT -- 2.28.0 -- Sincerely yours, Mike.