From: kernel test robot <lkp@intel.com>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [dvyukov:dvyukov-prot-kernonly 1/1] include/linux/mman.h:109:67: error: use of undeclared identifier 'PROT_KERNONLY'
Date: Sun, 10 Nov 2024 07:56:09 +0800 [thread overview]
Message-ID: <202411100710.Xsw5WJSG-lkp@intel.com> (raw)
tree: https://github.com/dvyukov/linux dvyukov-prot-kernonly
head: 37187db99b42dfb9784b42cb759c3f628de0d808
commit: 37187db99b42dfb9784b42cb759c3f628de0d808 [1/1] mm: add PROT_KERNONLY
config: mips-mtx1_defconfig (https://download.01.org/0day-ci/archive/20241110/202411100710.Xsw5WJSG-lkp@intel.com/config)
compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241110/202411100710.Xsw5WJSG-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411100710.Xsw5WJSG-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from mm/filemap.c:26:
>> include/linux/mman.h:109:67: error: use of undeclared identifier 'PROT_KERNONLY'
return (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC | PROT_SEM | PROT_KERNONLY)) == 0;
^
include/linux/mman.h:147:30: error: use of undeclared identifier 'PROT_KERNONLY'
_calc_vm_trans(prot, PROT_KERNONLY, VM_KERNONLY) |
^
include/linux/mman.h:147:30: error: use of undeclared identifier 'PROT_KERNONLY'
include/linux/mman.h:147:30: error: use of undeclared identifier 'PROT_KERNONLY'
include/linux/mman.h:147:30: error: use of undeclared identifier 'PROT_KERNONLY'
include/linux/mman.h:147:30: error: use of undeclared identifier 'PROT_KERNONLY'
include/linux/mman.h:147:30: error: use of undeclared identifier 'PROT_KERNONLY'
include/linux/mman.h:159:9: warning: division by zero is undefined [-Wdivision-by-zero]
_calc_vm_trans(flags, MAP_SYNC, VM_SYNC ) |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mman.h:135:48: note: expanded from macro '_calc_vm_trans'
((bit1) <= (bit2) ? ((x) & (bit1)) * ((bit2) / (bit1)) \
^ ~~~~~~
include/linux/mman.h:159:9: warning: division by zero is undefined [-Wdivision-by-zero]
_calc_vm_trans(flags, MAP_SYNC, VM_SYNC ) |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mman.h:136:21: note: expanded from macro '_calc_vm_trans'
: ((x) & (bit1)) / ((bit1) / (bit2))))
^ ~~~~~~~~~~~~~~~~~
include/linux/mman.h:160:9: warning: division by zero is undefined [-Wdivision-by-zero]
_calc_vm_trans(flags, MAP_STACK, VM_NOHUGEPAGE) |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mman.h:136:21: note: expanded from macro '_calc_vm_trans'
: ((x) & (bit1)) / ((bit1) / (bit2))))
^ ~~~~~~~~~~~~~~~~~
3 warnings and 7 errors generated.
--
In file included from mm/swap.c:21:
>> include/linux/mman.h:109:67: error: use of undeclared identifier 'PROT_KERNONLY'
return (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC | PROT_SEM | PROT_KERNONLY)) == 0;
^
include/linux/mman.h:147:30: error: use of undeclared identifier 'PROT_KERNONLY'
_calc_vm_trans(prot, PROT_KERNONLY, VM_KERNONLY) |
^
include/linux/mman.h:147:30: error: use of undeclared identifier 'PROT_KERNONLY'
include/linux/mman.h:147:30: error: use of undeclared identifier 'PROT_KERNONLY'
include/linux/mman.h:147:30: error: use of undeclared identifier 'PROT_KERNONLY'
include/linux/mman.h:147:30: error: use of undeclared identifier 'PROT_KERNONLY'
include/linux/mman.h:147:30: error: use of undeclared identifier 'PROT_KERNONLY'
include/linux/mman.h:159:9: warning: division by zero is undefined [-Wdivision-by-zero]
_calc_vm_trans(flags, MAP_SYNC, VM_SYNC ) |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mman.h:135:48: note: expanded from macro '_calc_vm_trans'
((bit1) <= (bit2) ? ((x) & (bit1)) * ((bit2) / (bit1)) \
^ ~~~~~~
include/linux/mman.h:159:9: warning: division by zero is undefined [-Wdivision-by-zero]
_calc_vm_trans(flags, MAP_SYNC, VM_SYNC ) |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mman.h:136:21: note: expanded from macro '_calc_vm_trans'
: ((x) & (bit1)) / ((bit1) / (bit2))))
^ ~~~~~~~~~~~~~~~~~
include/linux/mman.h:160:9: warning: division by zero is undefined [-Wdivision-by-zero]
_calc_vm_trans(flags, MAP_STACK, VM_NOHUGEPAGE) |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mman.h:136:21: note: expanded from macro '_calc_vm_trans'
: ((x) & (bit1)) / ((bit1) / (bit2))))
^ ~~~~~~~~~~~~~~~~~
In file included from mm/swap.c:44:
In file included from include/trace/events/pagemap.h:83:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:21:
In file included from include/linux/trace_events.h:6:
In file included from include/linux/ring_buffer.h:7:
include/linux/poll.h:136:27: warning: division by zero is undefined [-Wdivision-by-zero]
M(RDNORM) | M(RDBAND) | M(WRNORM) | M(WRBAND) |
^~~~~~~~~
include/linux/poll.h:134:32: note: expanded from macro 'M'
#define M(X) (__force __poll_t)__MAP(val, POLL##X, (__force __u16)EPOLL##X)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/poll.h:120:51: note: expanded from macro '__MAP'
(from < to ? (v & from) * (to/from) : (v & from) / (from/to))
^ ~~~~~~~~~
include/linux/poll.h:136:39: warning: division by zero is undefined [-Wdivision-by-zero]
M(RDNORM) | M(RDBAND) | M(WRNORM) | M(WRBAND) |
^~~~~~~~~
include/linux/poll.h:134:32: note: expanded from macro 'M'
#define M(X) (__force __poll_t)__MAP(val, POLL##X, (__force __u16)EPOLL##X)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/poll.h:120:51: note: expanded from macro '__MAP'
(from < to ? (v & from) * (to/from) : (v & from) / (from/to))
^ ~~~~~~~~~
5 warnings and 7 errors generated.
vim +/PROT_KERNONLY +109 include/linux/mman.h
99
100 #ifndef arch_validate_prot
101 /*
102 * This is called from mprotect(). PROT_GROWSDOWN and PROT_GROWSUP have
103 * already been masked out.
104 *
105 * Returns true if the prot flags are valid
106 */
107 static inline bool arch_validate_prot(unsigned long prot, unsigned long addr)
108 {
> 109 return (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC | PROT_SEM | PROT_KERNONLY)) == 0;
110 }
111 #define arch_validate_prot arch_validate_prot
112 #endif
113
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-11-09 23:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202411100710.Xsw5WJSG-lkp@intel.com \
--to=lkp@intel.com \
--cc=dvyukov@google.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/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.