public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [kas:uffd/rfc-v2 3/7] include/linux/userfaultfd_k.h:167:55: warning: shift count >= width of type
@ 2026-04-19  0:15 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-04-19  0:15 UTC (permalink / raw)
  To: Kiryl Shutsemau (Meta); +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git uffd/rfc-v2
head:   8f55f0ce2de130272cb80eee2434a185922b3340
commit: a5a0f28bfc37d5fb52d9268238be0f8280ca737c [3/7] userfaultfd: add UFFDIO_REGISTER_MODE_RWP
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20260419/202604190854.w97I47Zr-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260419/202604190854.w97I47Zr-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/202604190854.w97I47Zr-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from fs/exec.c:82:
   In file included from fs/../mm/internal.h:13:
   In file included from include/linux/mm_inline.h:10:
>> include/linux/userfaultfd_k.h:167:55: warning: shift count >= width of type [-Wshift-count-overflow]
     167 |         return vma->vm_flags & (VM_UFFD_WP | VM_UFFD_MINOR | VM_UFFD_RWP);
         |                                                              ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
   In file included from fs/exec.c:82:
   In file included from fs/../mm/internal.h:13:
   In file included from include/linux/mm_inline.h:10:
   include/linux/userfaultfd_k.h:199:25: warning: shift count >= width of type [-Wshift-count-overflow]
     199 |         return vma->vm_flags & VM_UFFD_RWP;
         |                                ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
   In file included from fs/exec.c:82:
   In file included from fs/../mm/internal.h:13:
   In file included from include/linux/mm_inline.h:10:
   include/linux/userfaultfd_k.h:216:25: warning: shift count >= width of type [-Wshift-count-overflow]
     216 |         return vma->vm_flags & __VM_UFFD_FLAGS;
         |                                ^~~~~~~~~~~~~~~
   include/linux/userfaultfd_k.h:25:5: note: expanded from macro '__VM_UFFD_FLAGS'
      25 |                          VM_UFFD_RWP)
         |                          ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
   In file included from fs/exec.c:82:
   In file included from fs/../mm/internal.h:13:
   In file included from include/linux/mm_inline.h:10:
   include/linux/userfaultfd_k.h:223:14: warning: shift count >= width of type [-Wshift-count-overflow]
     223 |         vm_flags &= __VM_UFFD_FLAGS;
         |                     ^~~~~~~~~~~~~~~
   include/linux/userfaultfd_k.h:25:5: note: expanded from macro '__VM_UFFD_FLAGS'
      25 |                          VM_UFFD_RWP)
         |                          ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
   In file included from fs/exec.c:82:
   In file included from fs/../mm/internal.h:13:
   In file included from include/linux/mm_inline.h:10:
   include/linux/userfaultfd_k.h:237:15: warning: shift count >= width of type [-Wshift-count-overflow]
     237 |         vm_flags &= ~VM_UFFD_RWP;
         |                      ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
   5 warnings generated.
--
   In file included from fs/userfaultfd.c:18:
   In file included from include/linux/mm_inline.h:10:
>> include/linux/userfaultfd_k.h:167:55: warning: shift count >= width of type [-Wshift-count-overflow]
     167 |         return vma->vm_flags & (VM_UFFD_WP | VM_UFFD_MINOR | VM_UFFD_RWP);
         |                                                              ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
   In file included from fs/userfaultfd.c:18:
   In file included from include/linux/mm_inline.h:10:
   include/linux/userfaultfd_k.h:199:25: warning: shift count >= width of type [-Wshift-count-overflow]
     199 |         return vma->vm_flags & VM_UFFD_RWP;
         |                                ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
   In file included from fs/userfaultfd.c:18:
   In file included from include/linux/mm_inline.h:10:
   include/linux/userfaultfd_k.h:216:25: warning: shift count >= width of type [-Wshift-count-overflow]
     216 |         return vma->vm_flags & __VM_UFFD_FLAGS;
         |                                ^~~~~~~~~~~~~~~
   include/linux/userfaultfd_k.h:25:5: note: expanded from macro '__VM_UFFD_FLAGS'
      25 |                          VM_UFFD_RWP)
         |                          ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
   In file included from fs/userfaultfd.c:18:
   In file included from include/linux/mm_inline.h:10:
   include/linux/userfaultfd_k.h:223:14: warning: shift count >= width of type [-Wshift-count-overflow]
     223 |         vm_flags &= __VM_UFFD_FLAGS;
         |                     ^~~~~~~~~~~~~~~
   include/linux/userfaultfd_k.h:25:5: note: expanded from macro '__VM_UFFD_FLAGS'
      25 |                          VM_UFFD_RWP)
         |                          ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
   In file included from fs/userfaultfd.c:18:
   In file included from include/linux/mm_inline.h:10:
   include/linux/userfaultfd_k.h:237:15: warning: shift count >= width of type [-Wshift-count-overflow]
     237 |         vm_flags &= ~VM_UFFD_RWP;
         |                      ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
>> fs/userfaultfd.c:220:15: warning: shift count >= width of type [-Wshift-count-overflow]
     220 |         if (reason & VM_UFFD_RWP)
         |                      ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
   fs/userfaultfd.c:328:39: warning: shift count >= width of type [-Wshift-count-overflow]
     328 |                 if (pmd_protnone(_pmd) && (reason & VM_UFFD_RWP))
         |                                                     ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
   fs/userfaultfd.c:357:39: warning: shift count >= width of type [-Wshift-count-overflow]
     357 |         if (pte_protnone(ptent) && (reason & VM_UFFD_RWP))
         |                                              ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
   fs/userfaultfd.c:418:28: warning: shift count >= width of type [-Wshift-count-overflow]
     418 |         VM_WARN_ON_ONCE(reason & ~__VM_UFFD_FLAGS);
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
   include/linux/userfaultfd_k.h:25:5: note: expanded from macro '__VM_UFFD_FLAGS'
      25 |                          VM_UFFD_RWP)
         |                          ^
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/mmdebug.h:123:50: note: expanded from macro 'VM_WARN_ON_ONCE'
     123 | #define VM_WARN_ON_ONCE(cond) (void)WARN_ON_ONCE(cond)
         |                                     ~~~~~~~~~~~~~^~~~~
   include/asm-generic/bug.h:180:18: note: expanded from macro 'WARN_ON_ONCE'
     180 |         DO_ONCE_LITE_IF(condition, WARN_ON, 1)
         |         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
   include/linux/once_lite.h:28:27: note: expanded from macro 'DO_ONCE_LITE_IF'
      28 |                 bool __ret_do_once = !!(condition);                     \
         |                                         ^~~~~~~~~
   fs/userfaultfd.c:1317:15: warning: shift count >= width of type [-Wshift-count-overflow]
    1317 |                 vm_flags |= VM_UFFD_RWP;
         |                             ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
   fs/userfaultfd.c:1360:24: warning: shift count >= width of type [-Wshift-count-overflow]
    1359 |                 VM_WARN_ON_ONCE(!!cur->vm_userfaultfd_ctx.ctx ^
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1360 |                                 !!(cur->vm_flags & __VM_UFFD_FLAGS));
         |                                 ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
   include/linux/userfaultfd_k.h:25:5: note: expanded from macro '__VM_UFFD_FLAGS'
      25 |                          VM_UFFD_RWP)
         |                          ^
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/mmdebug.h:123:50: note: expanded from macro 'VM_WARN_ON_ONCE'
     123 | #define VM_WARN_ON_ONCE(cond) (void)WARN_ON_ONCE(cond)
         |                                     ~~~~~~~~~~~~~^~~~~
   include/asm-generic/bug.h:180:18: note: expanded from macro 'WARN_ON_ONCE'
     180 |         DO_ONCE_LITE_IF(condition, WARN_ON, 1)
         |         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
   include/linux/once_lite.h:28:27: note: expanded from macro 'DO_ONCE_LITE_IF'
      28 |                 bool __ret_do_once = !!(condition);                     \
         |                                         ^~~~~~~~~
   fs/userfaultfd.c:1511:24: warning: shift count >= width of type [-Wshift-count-overflow]
    1510 |                 VM_WARN_ON_ONCE(!!cur->vm_userfaultfd_ctx.ctx ^
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1511 |                                 !!(cur->vm_flags & __VM_UFFD_FLAGS));
         |                                 ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
   include/linux/userfaultfd_k.h:25:5: note: expanded from macro '__VM_UFFD_FLAGS'
      25 |                          VM_UFFD_RWP)
--
   In file included from mm/memory.c:44:
   In file included from include/linux/mm_inline.h:10:
>> include/linux/userfaultfd_k.h:167:55: warning: shift count >= width of type [-Wshift-count-overflow]
     167 |         return vma->vm_flags & (VM_UFFD_WP | VM_UFFD_MINOR | VM_UFFD_RWP);
         |                                                              ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
   In file included from mm/memory.c:44:
   In file included from include/linux/mm_inline.h:10:
   include/linux/userfaultfd_k.h:199:25: warning: shift count >= width of type [-Wshift-count-overflow]
     199 |         return vma->vm_flags & VM_UFFD_RWP;
         |                                ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
   In file included from mm/memory.c:44:
   In file included from include/linux/mm_inline.h:10:
   include/linux/userfaultfd_k.h:216:25: warning: shift count >= width of type [-Wshift-count-overflow]
     216 |         return vma->vm_flags & __VM_UFFD_FLAGS;
         |                                ^~~~~~~~~~~~~~~
   include/linux/userfaultfd_k.h:25:5: note: expanded from macro '__VM_UFFD_FLAGS'
      25 |                          VM_UFFD_RWP)
         |                          ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
   In file included from mm/memory.c:44:
   In file included from include/linux/mm_inline.h:10:
   include/linux/userfaultfd_k.h:223:14: warning: shift count >= width of type [-Wshift-count-overflow]
     223 |         vm_flags &= __VM_UFFD_FLAGS;
         |                     ^~~~~~~~~~~~~~~
   include/linux/userfaultfd_k.h:25:5: note: expanded from macro '__VM_UFFD_FLAGS'
      25 |                          VM_UFFD_RWP)
         |                          ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
   In file included from mm/memory.c:44:
   In file included from include/linux/mm_inline.h:10:
   include/linux/userfaultfd_k.h:237:15: warning: shift count >= width of type [-Wshift-count-overflow]
     237 |         vm_flags &= ~VM_UFFD_RWP;
         |                      ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
   mm/memory.c:1485:26: warning: shift count >= width of type [-Wshift-count-overflow]
    1485 |         if (dst_vma->vm_flags & VM_COPY_ON_FORK)
         |                                 ^~~~~~~~~~~~~~~
   include/linux/mm.h:643:65: note: expanded from macro 'VM_COPY_ON_FORK'
     643 | #define VM_COPY_ON_FORK (VM_PFNMAP | VM_MIXEDMAP | VM_UFFD_WP | VM_UFFD_RWP | \
         |                                                                 ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
   mm/memory.c:6069:31: warning: shift count >= width of type [-Wshift-count-overflow]
    6069 |         return handle_userfault(vmf, VM_UFFD_RWP);
         |                                      ^~~~~~~~~~~
   include/linux/mm.h:501:21: note: expanded from macro 'VM_UFFD_RWP'
     501 | #define VM_UFFD_RWP     INIT_VM_FLAG(UFFD_RWP)
         |                         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/mm.h:402:28: note: expanded from macro 'INIT_VM_FLAG'
     402 | #define INIT_VM_FLAG(name) BIT((__force int) VMA_ ## name ## _BIT)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                        ^  ~~~~
..


vim +167 include/linux/userfaultfd_k.h

   153	
   154	/*
   155	 * Never enable huge pmd sharing on some uffd registered vmas:
   156	 *
   157	 * - VM_UFFD_WP VMAs, because write protect information is per pgtable entry.
   158	 *
   159	 * - VM_UFFD_MINOR VMAs, because otherwise we would never get minor faults for
   160	 *   VMAs which share huge pmds. (If you have two mappings to the same
   161	 *   underlying pages, and fault in the non-UFFD-registered one with a write,
   162	 *   with huge pmd sharing this would *also* setup the second UFFD-registered
   163	 *   mapping, and we'd not get minor faults.)
   164	 */
   165	static inline bool uffd_disable_huge_pmd_share(struct vm_area_struct *vma)
   166	{
 > 167		return vma->vm_flags & (VM_UFFD_WP | VM_UFFD_MINOR | VM_UFFD_RWP);
   168	}
   169	

-- 
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:[~2026-04-19  0:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-19  0:15 [kas:uffd/rfc-v2 3/7] include/linux/userfaultfd_k.h:167:55: warning: shift count >= width of type 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