* [asm-generic:master 2/6] arch/x86//mm/mpx.c:57:26: error: 'MAP_PRIVATE' undeclared; did you mean 'DQF_PRIVATE'?
@ 2019-02-18 16:28 kbuild test robot
2019-02-18 16:44 ` Michael S. Tsirkin
0 siblings, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2019-02-18 16:28 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: kbuild-all, linux-arch, Arnd Bergmann
[-- Attachment #1: Type: text/plain, Size: 2959 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git master
head: 3c4fcc2648569c3fe573849f9254c8c3499ec648
commit: 9ac483109d19095e22414e46d38a6817520883b9 [2/6] arch: move common mmap flags to linux/mman.h
config: x86_64-kexec (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
git checkout 9ac483109d19095e22414e46d38a6817520883b9
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
arch/x86//mm/mpx.c: In function 'mpx_mmap':
>> arch/x86//mm/mpx.c:57:26: error: 'MAP_PRIVATE' undeclared (first use in this function); did you mean 'DQF_PRIVATE'?
MAP_ANONYMOUS | MAP_PRIVATE, VM_MPX, 0, &populate, NULL);
^~~~~~~~~~~
DQF_PRIVATE
arch/x86//mm/mpx.c:57:26: note: each undeclared identifier is reported only once for each function it appears in
vim +57 arch/x86//mm/mpx.c
613fcb7d3 Dave Hansen 2015-06-07 41
57319d80e Qiaowei Ren 2014-11-14 42 /*
57319d80e Qiaowei Ren 2014-11-14 43 * This is really a simplified "vm_mmap". it only handles MPX
57319d80e Qiaowei Ren 2014-11-14 44 * bounds tables (the bounds directory is user-allocated).
57319d80e Qiaowei Ren 2014-11-14 45 */
57319d80e Qiaowei Ren 2014-11-14 46 static unsigned long mpx_mmap(unsigned long len)
57319d80e Qiaowei Ren 2014-11-14 47 {
57319d80e Qiaowei Ren 2014-11-14 48 struct mm_struct *mm = current->mm;
1fcfd8db7 Oleg Nesterov 2015-09-09 49 unsigned long addr, populate;
57319d80e Qiaowei Ren 2014-11-14 50
eb099e5bc Dave Hansen 2015-06-07 51 /* Only bounds table can be allocated here */
613fcb7d3 Dave Hansen 2015-06-07 52 if (len != mpx_bt_size_bytes(mm))
57319d80e Qiaowei Ren 2014-11-14 53 return -EINVAL;
57319d80e Qiaowei Ren 2014-11-14 54
57319d80e Qiaowei Ren 2014-11-14 55 down_write(&mm->mmap_sem);
1fcfd8db7 Oleg Nesterov 2015-09-09 56 addr = do_mmap(NULL, 0, len, PROT_READ | PROT_WRITE,
897ab3e0c Mike Rapoport 2017-02-24 @57 MAP_ANONYMOUS | MAP_PRIVATE, VM_MPX, 0, &populate, NULL);
57319d80e Qiaowei Ren 2014-11-14 58 up_write(&mm->mmap_sem);
1fcfd8db7 Oleg Nesterov 2015-09-09 59 if (populate)
1fcfd8db7 Oleg Nesterov 2015-09-09 60 mm_populate(addr, populate);
57319d80e Qiaowei Ren 2014-11-14 61
1fcfd8db7 Oleg Nesterov 2015-09-09 62 return addr;
57319d80e Qiaowei Ren 2014-11-14 63 }
fcc7ffd67 Dave Hansen 2014-11-14 64
:::::: The code at line 57 was first introduced by commit
:::::: 897ab3e0c49e24b62e2d54d165c7afec6bbca65b userfaultfd: non-cooperative: add event for memory unmaps
:::::: TO: Mike Rapoport <rppt@linux.vnet.ibm.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26402 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [asm-generic:master 2/6] arch/x86//mm/mpx.c:57:26: error: 'MAP_PRIVATE' undeclared; did you mean 'DQF_PRIVATE'?
2019-02-18 16:28 [asm-generic:master 2/6] arch/x86//mm/mpx.c:57:26: error: 'MAP_PRIVATE' undeclared; did you mean 'DQF_PRIVATE'? kbuild test robot
@ 2019-02-18 16:44 ` Michael S. Tsirkin
2019-02-18 16:52 ` Arnd Bergmann
0 siblings, 1 reply; 4+ messages in thread
From: Michael S. Tsirkin @ 2019-02-18 16:44 UTC (permalink / raw)
To: kbuild test robot; +Cc: kbuild-all, linux-arch, Arnd Bergmann
On Tue, Feb 19, 2019 at 12:28:55AM +0800, kbuild test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git master
> head: 3c4fcc2648569c3fe573849f9254c8c3499ec648
> commit: 9ac483109d19095e22414e46d38a6817520883b9 [2/6] arch: move common mmap flags to linux/mman.h
> config: x86_64-kexec (attached as .config)
> compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
> reproduce:
> git checkout 9ac483109d19095e22414e46d38a6817520883b9
> # save the attached .config to linux build tree
> make ARCH=x86_64
>
> All errors (new ones prefixed by >>):
>
> arch/x86//mm/mpx.c: In function 'mpx_mmap':
> >> arch/x86//mm/mpx.c:57:26: error: 'MAP_PRIVATE' undeclared (first use in this function); did you mean 'DQF_PRIVATE'?
> MAP_ANONYMOUS | MAP_PRIVATE, VM_MPX, 0, &populate, NULL);
> ^~~~~~~~~~~
> DQF_PRIVATE
> arch/x86//mm/mpx.c:57:26: note: each undeclared identifier is reported only once for each function it appears in
Arnd I think you are missing:
x86/mpx: tweak header name
The whole file is going away eventually:
https://lkml.kernel.org/r/7de5232f-4bc1-5c85-00d5-cb646462577f@intel.com
but to avoid breaking bisect I think it's needed.
> vim +57 arch/x86//mm/mpx.c
>
> 613fcb7d3 Dave Hansen 2015-06-07 41
> 57319d80e Qiaowei Ren 2014-11-14 42 /*
> 57319d80e Qiaowei Ren 2014-11-14 43 * This is really a simplified "vm_mmap". it only handles MPX
> 57319d80e Qiaowei Ren 2014-11-14 44 * bounds tables (the bounds directory is user-allocated).
> 57319d80e Qiaowei Ren 2014-11-14 45 */
> 57319d80e Qiaowei Ren 2014-11-14 46 static unsigned long mpx_mmap(unsigned long len)
> 57319d80e Qiaowei Ren 2014-11-14 47 {
> 57319d80e Qiaowei Ren 2014-11-14 48 struct mm_struct *mm = current->mm;
> 1fcfd8db7 Oleg Nesterov 2015-09-09 49 unsigned long addr, populate;
> 57319d80e Qiaowei Ren 2014-11-14 50
> eb099e5bc Dave Hansen 2015-06-07 51 /* Only bounds table can be allocated here */
> 613fcb7d3 Dave Hansen 2015-06-07 52 if (len != mpx_bt_size_bytes(mm))
> 57319d80e Qiaowei Ren 2014-11-14 53 return -EINVAL;
> 57319d80e Qiaowei Ren 2014-11-14 54
> 57319d80e Qiaowei Ren 2014-11-14 55 down_write(&mm->mmap_sem);
> 1fcfd8db7 Oleg Nesterov 2015-09-09 56 addr = do_mmap(NULL, 0, len, PROT_READ | PROT_WRITE,
> 897ab3e0c Mike Rapoport 2017-02-24 @57 MAP_ANONYMOUS | MAP_PRIVATE, VM_MPX, 0, &populate, NULL);
> 57319d80e Qiaowei Ren 2014-11-14 58 up_write(&mm->mmap_sem);
> 1fcfd8db7 Oleg Nesterov 2015-09-09 59 if (populate)
> 1fcfd8db7 Oleg Nesterov 2015-09-09 60 mm_populate(addr, populate);
> 57319d80e Qiaowei Ren 2014-11-14 61
> 1fcfd8db7 Oleg Nesterov 2015-09-09 62 return addr;
> 57319d80e Qiaowei Ren 2014-11-14 63 }
> fcc7ffd67 Dave Hansen 2014-11-14 64
>
> :::::: The code at line 57 was first introduced by commit
> :::::: 897ab3e0c49e24b62e2d54d165c7afec6bbca65b userfaultfd: non-cooperative: add event for memory unmaps
>
> :::::: TO: Mike Rapoport <rppt@linux.vnet.ibm.com>
> :::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all Intel Corporation
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [asm-generic:master 2/6] arch/x86//mm/mpx.c:57:26: error: 'MAP_PRIVATE' undeclared; did you mean 'DQF_PRIVATE'?
2019-02-18 16:44 ` Michael S. Tsirkin
@ 2019-02-18 16:52 ` Arnd Bergmann
2019-02-18 17:26 ` Michael S. Tsirkin
0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2019-02-18 16:52 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: kbuild test robot, kbuild-all, linux-arch
On Mon, Feb 18, 2019 at 5:44 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Tue, Feb 19, 2019 at 12:28:55AM +0800, kbuild test robot wrote:
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git master
> > head: 3c4fcc2648569c3fe573849f9254c8c3499ec648
> > commit: 9ac483109d19095e22414e46d38a6817520883b9 [2/6] arch: move common mmap flags to linux/mman.h
> > config: x86_64-kexec (attached as .config)
> > compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
> > reproduce:
> > git checkout 9ac483109d19095e22414e46d38a6817520883b9
> > # save the attached .config to linux build tree
> > make ARCH=x86_64
> >
> > All errors (new ones prefixed by >>):
> >
> > arch/x86//mm/mpx.c: In function 'mpx_mmap':
> > >> arch/x86//mm/mpx.c:57:26: error: 'MAP_PRIVATE' undeclared (first use in this function); did you mean 'DQF_PRIVATE'?
> > MAP_ANONYMOUS | MAP_PRIVATE, VM_MPX, 0, &populate, NULL);
> > ^~~~~~~~~~~
> > DQF_PRIVATE
> > arch/x86//mm/mpx.c:57:26: note: each undeclared identifier is reported only once for each function it appears in
>
> Arnd I think you are missing:
> x86/mpx: tweak header name
>
> The whole file is going away eventually:
> https://lkml.kernel.org/r/7de5232f-4bc1-5c85-00d5-cb646462577f@intel.com
>
> but to avoid breaking bisect I think it's needed.
Right, I misunderstood the earlier mails and assumed it wasn't really
needed even for building the current tree. Added it in now as well. I see that
there are various other files including asm/mman.h:
arch/arm/mm/hugetlbpage.c:#include <asm/mman.h>
arch/arm64/mm/hugetlbpage.c:#include <asm/mman.h>
arch/c6x/include/asm/cacheflush.h:#include <asm/mman.h>
arch/ia64/include/asm/pgtable.h:#include <asm/mman.h>
arch/ia64/mm/hugetlbpage.c:#include <asm/mman.h>
arch/mips/kernel/linux32.c:#include <asm/mman.h>
arch/mips/mm/hugetlbpage.c:#include <asm/mman.h>
arch/parisc/mm/hugetlbpage.c:#include <asm/mman.h>
arch/powerpc/include/asm/mman.h:#include <uapi/asm/mman.h>
arch/powerpc/mm/hugetlbpage-radix.c:#include <asm/mman.h>
arch/powerpc/mm/pkeys.c:#include <asm/mman.h>
arch/powerpc/mm/slice.c:#include <asm/mman.h>
arch/sh/mm/hugetlbpage.c:#include <asm/mman.h>
arch/sparc/include/asm/mman.h:#include <uapi/asm/mman.h>
arch/sparc/mm/hugetlbpage.c:#include <asm/mman.h>
arch/um/kernel/syscall.c:#include <asm/mman.h>
arch/x86/ia32/sys_ia32.c:#include <asm/mman.h>
arch/x86/mm/hugetlbpage.c:#include <asm/mman.h>
arch/x86/um/shared/sysdep/kernel-offsets.h:#include <asm/mman.h>
fs/eventpoll.c:#include <asm/mman.h>
include/uapi/linux/mman.h:#include <asm/mman.h>
mm/filemap.c:#include <asm/mman.h>
tools/include/uapi/linux/mman.h:#include <asm/mman.h>
virt/kvm/arm/arm.c:#include <asm/mman.h>
Did you check if we need to do the same change on any of the
other files? A lot of them are architecture specific and might not be
caught by the regular build testing.
Arnd
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [asm-generic:master 2/6] arch/x86//mm/mpx.c:57:26: error: 'MAP_PRIVATE' undeclared; did you mean 'DQF_PRIVATE'?
2019-02-18 16:52 ` Arnd Bergmann
@ 2019-02-18 17:26 ` Michael S. Tsirkin
0 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2019-02-18 17:26 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: kbuild test robot, kbuild-all, linux-arch
On Mon, Feb 18, 2019 at 05:52:09PM +0100, Arnd Bergmann wrote:
> On Mon, Feb 18, 2019 at 5:44 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> >
> > On Tue, Feb 19, 2019 at 12:28:55AM +0800, kbuild test robot wrote:
> > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git master
> > > head: 3c4fcc2648569c3fe573849f9254c8c3499ec648
> > > commit: 9ac483109d19095e22414e46d38a6817520883b9 [2/6] arch: move common mmap flags to linux/mman.h
> > > config: x86_64-kexec (attached as .config)
> > > compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
> > > reproduce:
> > > git checkout 9ac483109d19095e22414e46d38a6817520883b9
> > > # save the attached .config to linux build tree
> > > make ARCH=x86_64
> > >
> > > All errors (new ones prefixed by >>):
> > >
> > > arch/x86//mm/mpx.c: In function 'mpx_mmap':
> > > >> arch/x86//mm/mpx.c:57:26: error: 'MAP_PRIVATE' undeclared (first use in this function); did you mean 'DQF_PRIVATE'?
> > > MAP_ANONYMOUS | MAP_PRIVATE, VM_MPX, 0, &populate, NULL);
> > > ^~~~~~~~~~~
> > > DQF_PRIVATE
> > > arch/x86//mm/mpx.c:57:26: note: each undeclared identifier is reported only once for each function it appears in
> >
> > Arnd I think you are missing:
> > x86/mpx: tweak header name
> >
> > The whole file is going away eventually:
> > https://lkml.kernel.org/r/7de5232f-4bc1-5c85-00d5-cb646462577f@intel.com
> >
> > but to avoid breaking bisect I think it's needed.
>
> Right, I misunderstood the earlier mails and assumed it wasn't really
> needed even for building the current tree. Added it in now as well. I see that
> there are various other files including asm/mman.h:
I did my best to check the rest, yes. I don't think any of them are broken.
> arch/arm/mm/hugetlbpage.c:#include <asm/mman.h>
> arch/arm64/mm/hugetlbpage.c:#include <asm/mman.h>
> arch/c6x/include/asm/cacheflush.h:#include <asm/mman.h>
> arch/ia64/include/asm/pgtable.h:#include <asm/mman.h>
> arch/ia64/mm/hugetlbpage.c:#include <asm/mman.h>
> arch/mips/kernel/linux32.c:#include <asm/mman.h>
> arch/mips/mm/hugetlbpage.c:#include <asm/mman.h>
> arch/parisc/mm/hugetlbpage.c:#include <asm/mman.h>
> arch/powerpc/include/asm/mman.h:#include <uapi/asm/mman.h>
> arch/powerpc/mm/hugetlbpage-radix.c:#include <asm/mman.h>
> arch/powerpc/mm/pkeys.c:#include <asm/mman.h>
> arch/powerpc/mm/slice.c:#include <asm/mman.h>
> arch/sh/mm/hugetlbpage.c:#include <asm/mman.h>
> arch/sparc/include/asm/mman.h:#include <uapi/asm/mman.h>
> arch/sparc/mm/hugetlbpage.c:#include <asm/mman.h>
> arch/um/kernel/syscall.c:#include <asm/mman.h>
> arch/x86/ia32/sys_ia32.c:#include <asm/mman.h>
> arch/x86/mm/hugetlbpage.c:#include <asm/mman.h>
> arch/x86/um/shared/sysdep/kernel-offsets.h:#include <asm/mman.h>
> fs/eventpoll.c:#include <asm/mman.h>
> include/uapi/linux/mman.h:#include <asm/mman.h>
> mm/filemap.c:#include <asm/mman.h>
> tools/include/uapi/linux/mman.h:#include <asm/mman.h>
> virt/kvm/arm/arm.c:#include <asm/mman.h>
>
> Did you check if we need to do the same change on any of the
> other files? A lot of them are architecture specific and might not be
> caught by the regular build testing.
>
> Arnd
First let's check for direct issues:
$ git grep -e MAP_SHARED -e MAP_PRIVATE `git grep -l asm/mman.h`
arch/ia64/include/asm/pgtable.h: * version gets used for a shared memory segment with MAP_SHARED on.
include/uapi/linux/mman.h:#define MAP_SHARED 0x01 /* Share changes */
include/uapi/linux/mman.h:#define MAP_PRIVATE 0x02 /* Changes are private */
include/uapi/linux/mman.h:#define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */
Now it's possible that there's an indirect include. Let's find headers -
but note that any asm/mman.h header itself is not a problem.
$git grep -l asm/mman.h|fgrep -e .h|grep -v mman.h
arch/c6x/include/asm/cacheflush.h
arch/ia64/include/asm/pgtable.h
arch/x86/um/shared/sysdep/kernel-offsets.h
Analysis (only looking at arch specific files):
$ git grep -e MAP_SHARED -e MAP_PRIVATE `git grep -l asm/cacheflush.h arch/c6x/`
$ git grep -e MAP_SHARED -e MAP_PRIVATE `git grep -l asm/pgtable.h arch/ia64/`
$ git grep MAP_ `git grep -l kernel-offsets.h`
Having said that, once these patches are in I think the
next step would be to:
- patch CodingStyle to document the rule (already enforced by checkpatch.pl) that everyone
should include linux/foo.h in preference to asm/foo.h
- write a script to find and fix violations - they are probably not limited
to mman.h
--
MST
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-02-18 17:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-18 16:28 [asm-generic:master 2/6] arch/x86//mm/mpx.c:57:26: error: 'MAP_PRIVATE' undeclared; did you mean 'DQF_PRIVATE'? kbuild test robot
2019-02-18 16:44 ` Michael S. Tsirkin
2019-02-18 16:52 ` Arnd Bergmann
2019-02-18 17:26 ` Michael S. Tsirkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox