All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@linux.ibm.com>
To: kernel test robot <lkp@intel.com>
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
	Linux Memory Management List <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [linux-next:master 3945/3956] mm/secretmem.c:107:6: error: implicit declaration of function 'mlock_future_check'
Date: Mon, 18 Jan 2021 10:12:02 +0200	[thread overview]
Message-ID: <20210118081202.GV832698@linux.ibm.com> (raw)
In-Reply-To: <202101180834.8JuxblXK-lkp@intel.com>

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@intel.com>
> 
> 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@linux.ibm.com>
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@intel.com>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
---
 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.


      reply	other threads:[~2021-01-18  8:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-18  0:44 [linux-next:master 3945/3956] mm/secretmem.c:107:6: error: implicit declaration of function 'mlock_future_check' kernel test robot
2021-01-18  0:44 ` kernel test robot
2021-01-18  8:12 ` Mike Rapoport [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210118081202.GV832698@linux.ibm.com \
    --to=rppt@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.