public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [dvyukov:dvyukov-prot-kernonly 1/1] include/linux/mman.h:109:67: error: use of undeclared identifier 'PROT_KERNONLY'
@ 2024-11-09 23:56 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-11-09 23:56 UTC (permalink / raw)
  To: Dmitry Vyukov; +Cc: llvm, oe-kbuild-all

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-11-09 23:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-09 23:56 [dvyukov:dvyukov-prot-kernonly 1/1] include/linux/mman.h:109:67: error: use of undeclared identifier 'PROT_KERNONLY' kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox