lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date: Thu, 20 Jun 2024 02:15:35 +0800
From: kernel test robot <lkp@...el.com>
To: Palmer Dabbelt <palmer@...osinc.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: include/uapi/linux/bits.h:9:19: warning: right shift count >= width
 of type

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e5b3efbe1ab1793bb49ae07d56d0973267e65112
commit: 300ce44cbe2924aa83330fc5f24e035665f51b03 Merge patch series "Rework & improve riscv cmpxchg.h and atomic.h"
date:   7 weeks ago
config: riscv-randconfig-r042-20230811 (https://download.01.org/0day-ci/archive/20240620/202406200209.graMn6T6-lkp@intel.com/config)
compiler: riscv32-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240620/202406200209.graMn6T6-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406200209.graMn6T6-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from arch/riscv/include/asm/bitops.h:19,
                    from include/linux/bitops.h:68,
                    from include/linux/log2.h:12,
                    from kernel/bounds.c:13:
   include/asm-generic/bitops/__ffs.h: In function 'generic___ffs':
   include/asm-generic/bitops/__ffs.h:20:22: warning: right shift count >= width of type [-Wshift-count-overflow]
      20 |                 word >>= 32;
         |                      ^~~
   In file included from arch/riscv/include/asm/bitops.h:20:
   include/asm-generic/bitops/__fls.h: In function 'generic___fls':
   include/asm-generic/bitops/__fls.h:18:28: warning: left shift count >= width of type [-Wshift-count-overflow]
      18 |         if (!(word & (~0ul << 32))) {
         |                            ^~
   include/asm-generic/bitops/__fls.h:20:22: warning: left shift count >= width of type [-Wshift-count-overflow]
      20 |                 word <<= 32;
         |                      ^~~
   include/asm-generic/bitops/__fls.h:23:28: warning: left shift count >= width of type [-Wshift-count-overflow]
      23 |         if (!(word & (~0ul << (BITS_PER_LONG-16)))) {
         |                            ^~
   include/asm-generic/bitops/__fls.h:27:28: warning: left shift count >= width of type [-Wshift-count-overflow]
      27 |         if (!(word & (~0ul << (BITS_PER_LONG-8)))) {
         |                            ^~
   include/asm-generic/bitops/__fls.h:31:28: warning: left shift count >= width of type [-Wshift-count-overflow]
      31 |         if (!(word & (~0ul << (BITS_PER_LONG-4)))) {
         |                            ^~
   include/asm-generic/bitops/__fls.h:35:28: warning: left shift count >= width of type [-Wshift-count-overflow]
      35 |         if (!(word & (~0ul << (BITS_PER_LONG-2)))) {
         |                            ^~
   include/asm-generic/bitops/__fls.h:39:28: warning: left shift count >= width of type [-Wshift-count-overflow]
      39 |         if (!(word & (~0ul << (BITS_PER_LONG-1))))
         |                            ^~
   In file included from arch/riscv/include/asm/bitops.h:19,
                    from include/linux/bitops.h:68,
                    from include/linux/thread_info.h:27,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/riscv/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:79,
                    from include/linux/spinlock.h:56,
                    from include/linux/mmzone.h:8,
                    from include/linux/gfp.h:7,
                    from include/linux/mm.h:7,
                    from arch/riscv/kernel/asm-offsets.c:10:
   include/asm-generic/bitops/__ffs.h: In function 'generic___ffs':
   include/asm-generic/bitops/__ffs.h:20:22: warning: right shift count >= width of type [-Wshift-count-overflow]
      20 |                 word >>= 32;
         |                      ^~~
   In file included from arch/riscv/include/asm/bitops.h:20:
   include/asm-generic/bitops/__fls.h: In function 'generic___fls':
   include/asm-generic/bitops/__fls.h:18:28: warning: left shift count >= width of type [-Wshift-count-overflow]
      18 |         if (!(word & (~0ul << 32))) {
         |                            ^~
   include/asm-generic/bitops/__fls.h:20:22: warning: left shift count >= width of type [-Wshift-count-overflow]
      20 |                 word <<= 32;
         |                      ^~~
   include/asm-generic/bitops/__fls.h:23:28: warning: left shift count >= width of type [-Wshift-count-overflow]
      23 |         if (!(word & (~0ul << (BITS_PER_LONG-16)))) {
         |                            ^~
   include/asm-generic/bitops/__fls.h:27:28: warning: left shift count >= width of type [-Wshift-count-overflow]
      27 |         if (!(word & (~0ul << (BITS_PER_LONG-8)))) {
         |                            ^~
   include/asm-generic/bitops/__fls.h:31:28: warning: left shift count >= width of type [-Wshift-count-overflow]
      31 |         if (!(word & (~0ul << (BITS_PER_LONG-4)))) {
         |                            ^~
   include/asm-generic/bitops/__fls.h:35:28: warning: left shift count >= width of type [-Wshift-count-overflow]
      35 |         if (!(word & (~0ul << (BITS_PER_LONG-2)))) {
         |                            ^~
   include/asm-generic/bitops/__fls.h:39:28: warning: left shift count >= width of type [-Wshift-count-overflow]
      39 |         if (!(word & (~0ul << (BITS_PER_LONG-1))))
         |                            ^~
   In file included from include/linux/atomic.h:7,
                    from include/linux/cpumask.h:14,
                    from include/linux/smp.h:13,
                    from include/linux/lockdep.h:14,
                    from include/linux/spinlock.h:63:
   arch/riscv/include/asm/atomic.h: At top level:
   arch/riscv/include/asm/atomic.h:15:4: error: #error "64-bit atomics require XLEN to be at least 64"
      15 | #  error "64-bit atomics require XLEN to be at least 64"
         |    ^~~~~
   In file included from include/linux/bits.h:7,
                    from include/linux/ratelimit_types.h:5,
                    from include/linux/printk.h:9,
                    from include/asm-generic/bug.h:22,
                    from arch/riscv/include/asm/bug.h:83,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/mm.h:6:
   include/linux/atomic/atomic-arch-fallback.h: In function 'raw_atomic64_xchg':
>> include/uapi/linux/bits.h:9:19: warning: right shift count >= width of type [-Wshift-count-overflow]
       9 |          (~_UL(0) >> (__BITS_PER_LONG - 1 - (h))))
         |                   ^~
   include/linux/bits.h:35:38: note: in expansion of macro '__GENMASK'
      35 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:17:24: note: in expansion of macro 'GENMASK'
      17 |         ulong __mask = GENMASK(((sizeof(*p)) * BITS_PER_BYTE) - 1, 0)   \
         |                        ^~~~~~~
   arch/riscv/include/asm/cmpxchg.h:58:17: note: in expansion of macro '__arch_xchg_masked'
      58 |                 __arch_xchg_masked(prepend, append,                     \
         |                 ^~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:85:9: note: in expansion of macro '_arch_xchg'
      85 |         _arch_xchg(ptr, x, ".aqrl", "", "")
         |         ^~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:12:18: note: in expansion of macro 'arch_xchg'
      12 | #define raw_xchg arch_xchg
         |                  ^~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:4047:16: note: in expansion of macro 'raw_xchg'
    4047 |         return raw_xchg(&v->counter, new);
         |                ^~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h: In function 'raw_atomic64_xchg_acquire':
>> include/uapi/linux/bits.h:9:19: warning: right shift count >= width of type [-Wshift-count-overflow]
       9 |          (~_UL(0) >> (__BITS_PER_LONG - 1 - (h))))
         |                   ^~
   include/linux/bits.h:35:38: note: in expansion of macro '__GENMASK'
      35 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:17:24: note: in expansion of macro 'GENMASK'
      17 |         ulong __mask = GENMASK(((sizeof(*p)) * BITS_PER_BYTE) - 1, 0)   \
         |                        ^~~~~~~
   arch/riscv/include/asm/cmpxchg.h:58:17: note: in expansion of macro '__arch_xchg_masked'
      58 |                 __arch_xchg_masked(prepend, append,                     \
         |                 ^~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:79:9: note: in expansion of macro '_arch_xchg'
      79 |         _arch_xchg(ptr, x, "", "", RISCV_ACQUIRE_BARRIER)
         |         ^~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:22:26: note: in expansion of macro 'arch_xchg_acquire'
      22 | #define raw_xchg_acquire arch_xchg_acquire
         |                          ^~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:4074:16: note: in expansion of macro 'raw_xchg_acquire'
    4074 |         return raw_xchg_acquire(&v->counter, new);
         |                ^~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h: In function 'raw_atomic64_xchg_release':
>> include/uapi/linux/bits.h:9:19: warning: right shift count >= width of type [-Wshift-count-overflow]
       9 |          (~_UL(0) >> (__BITS_PER_LONG - 1 - (h))))
         |                   ^~
   include/linux/bits.h:35:38: note: in expansion of macro '__GENMASK'
      35 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:17:24: note: in expansion of macro 'GENMASK'
      17 |         ulong __mask = GENMASK(((sizeof(*p)) * BITS_PER_BYTE) - 1, 0)   \
         |                        ^~~~~~~
   arch/riscv/include/asm/cmpxchg.h:58:17: note: in expansion of macro '__arch_xchg_masked'
      58 |                 __arch_xchg_masked(prepend, append,                     \
         |                 ^~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:82:9: note: in expansion of macro '_arch_xchg'
      82 |         _arch_xchg(ptr, x, "", RISCV_RELEASE_BARRIER, "")
         |         ^~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:34:26: note: in expansion of macro 'arch_xchg_release'
      34 | #define raw_xchg_release arch_xchg_release
         |                          ^~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:4100:16: note: in expansion of macro 'raw_xchg_release'
    4100 |         return raw_xchg_release(&v->counter, new);
         |                ^~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h: In function 'raw_atomic64_xchg_relaxed':
>> include/uapi/linux/bits.h:9:19: warning: right shift count >= width of type [-Wshift-count-overflow]
       9 |          (~_UL(0) >> (__BITS_PER_LONG - 1 - (h))))
         |                   ^~
   include/linux/bits.h:35:38: note: in expansion of macro '__GENMASK'
      35 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:17:24: note: in expansion of macro 'GENMASK'
      17 |         ulong __mask = GENMASK(((sizeof(*p)) * BITS_PER_BYTE) - 1, 0)   \
         |                        ^~~~~~~
   arch/riscv/include/asm/cmpxchg.h:58:17: note: in expansion of macro '__arch_xchg_masked'
      58 |                 __arch_xchg_masked(prepend, append,                     \
         |                 ^~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:76:9: note: in expansion of macro '_arch_xchg'
      76 |         _arch_xchg(ptr, x, "", "", "")
         |         ^~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:46:26: note: in expansion of macro 'arch_xchg_relaxed'
      46 | #define raw_xchg_relaxed arch_xchg_relaxed
         |                          ^~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:4123:16: note: in expansion of macro 'raw_xchg_relaxed'
    4123 |         return raw_xchg_relaxed(&v->counter, new);
         |                ^~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h: In function 'raw_atomic64_cmpxchg':
>> include/uapi/linux/bits.h:9:19: warning: right shift count >= width of type [-Wshift-count-overflow]
       9 |          (~_UL(0) >> (__BITS_PER_LONG - 1 - (h))))
         |                   ^~
   include/linux/bits.h:35:38: note: in expansion of macro '__GENMASK'
      35 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:109:24: note: in expansion of macro 'GENMASK'
     109 |         ulong __mask = GENMASK(((sizeof(*p)) * BITS_PER_BYTE) - 1, 0)   \
         |                        ^~~~~~~
   arch/riscv/include/asm/cmpxchg.h:162:17: note: in expansion of macro '__arch_cmpxchg_masked'
     162 |                 __arch_cmpxchg_masked(sc_sfx, prepend, append,          \
         |                 ^~~~~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:189:9: note: in expansion of macro '_arch_cmpxchg'
     189 |         _arch_cmpxchg((ptr), (o), (n), ".rl", "", "     fence rw, rw\n")
         |         ^~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg'
      55 | #define raw_cmpxchg arch_cmpxchg
         |                     ^~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:4152:16: note: in expansion of macro 'raw_cmpxchg'
    4152 |         return raw_cmpxchg(&v->counter, old, new);
         |                ^~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h: In function 'raw_atomic64_cmpxchg_acquire':
>> include/uapi/linux/bits.h:9:19: warning: right shift count >= width of type [-Wshift-count-overflow]
       9 |          (~_UL(0) >> (__BITS_PER_LONG - 1 - (h))))
         |                   ^~
   include/linux/bits.h:35:38: note: in expansion of macro '__GENMASK'
      35 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:109:24: note: in expansion of macro 'GENMASK'
     109 |         ulong __mask = GENMASK(((sizeof(*p)) * BITS_PER_BYTE) - 1, 0)   \
         |                        ^~~~~~~
   arch/riscv/include/asm/cmpxchg.h:162:17: note: in expansion of macro '__arch_cmpxchg_masked'
     162 |                 __arch_cmpxchg_masked(sc_sfx, prepend, append,          \
         |                 ^~~~~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:183:9: note: in expansion of macro '_arch_cmpxchg'
     183 |         _arch_cmpxchg((ptr), (o), (n), "", "", RISCV_ACQUIRE_BARRIER)
         |         ^~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:65:29: note: in expansion of macro 'arch_cmpxchg_acquire'
      65 | #define raw_cmpxchg_acquire arch_cmpxchg_acquire
         |                             ^~~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:4181:16: note: in expansion of macro 'raw_cmpxchg_acquire'
    4181 |         return raw_cmpxchg_acquire(&v->counter, old, new);
         |                ^~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h: In function 'raw_atomic64_cmpxchg_release':
>> include/uapi/linux/bits.h:9:19: warning: right shift count >= width of type [-Wshift-count-overflow]
       9 |          (~_UL(0) >> (__BITS_PER_LONG - 1 - (h))))
         |                   ^~
   include/linux/bits.h:35:38: note: in expansion of macro '__GENMASK'
      35 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:109:24: note: in expansion of macro 'GENMASK'
     109 |         ulong __mask = GENMASK(((sizeof(*p)) * BITS_PER_BYTE) - 1, 0)   \
         |                        ^~~~~~~
   arch/riscv/include/asm/cmpxchg.h:162:17: note: in expansion of macro '__arch_cmpxchg_masked'
     162 |                 __arch_cmpxchg_masked(sc_sfx, prepend, append,          \
         |                 ^~~~~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:186:9: note: in expansion of macro '_arch_cmpxchg'
     186 |         _arch_cmpxchg((ptr), (o), (n), "", RISCV_RELEASE_BARRIER, "")
         |         ^~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:77:29: note: in expansion of macro 'arch_cmpxchg_release'
      77 | #define raw_cmpxchg_release arch_cmpxchg_release
         |                             ^~~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:4209:16: note: in expansion of macro 'raw_cmpxchg_release'
    4209 |         return raw_cmpxchg_release(&v->counter, old, new);
         |                ^~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h: In function 'raw_atomic64_cmpxchg_relaxed':
>> include/uapi/linux/bits.h:9:19: warning: right shift count >= width of type [-Wshift-count-overflow]
       9 |          (~_UL(0) >> (__BITS_PER_LONG - 1 - (h))))
         |                   ^~
   include/linux/bits.h:35:38: note: in expansion of macro '__GENMASK'
      35 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:109:24: note: in expansion of macro 'GENMASK'
     109 |         ulong __mask = GENMASK(((sizeof(*p)) * BITS_PER_BYTE) - 1, 0)   \
         |                        ^~~~~~~
   arch/riscv/include/asm/cmpxchg.h:162:17: note: in expansion of macro '__arch_cmpxchg_masked'
     162 |                 __arch_cmpxchg_masked(sc_sfx, prepend, append,          \
         |                 ^~~~~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:180:9: note: in expansion of macro '_arch_cmpxchg'
     180 |         _arch_cmpxchg((ptr), (o), (n), "", "", "")
         |         ^~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:89:29: note: in expansion of macro 'arch_cmpxchg_relaxed'
      89 | #define raw_cmpxchg_relaxed arch_cmpxchg_relaxed
         |                             ^~~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:4234:16: note: in expansion of macro 'raw_cmpxchg_relaxed'
    4234 |         return raw_cmpxchg_relaxed(&v->counter, old, new);
         |                ^~~~~~~~~~~~~~~~~~~
   In file included from include/linux/cpumask.h:13:
   include/linux/cpumask.h: In function 'cpumask_setall':
   include/linux/bitmap.h:223:44: warning: right shift count >= width of type [-Wshift-count-overflow]
     223 | #define BITMAP_LAST_WORD_MASK(nbits) (~0UL >> (-(nbits) & (BITS_PER_LONG - 1)))
         |                                            ^~
   include/linux/cpumask.h:543:41: note: in expansion of macro 'BITMAP_LAST_WORD_MASK'
     543 |                 cpumask_bits(dstp)[0] = BITMAP_LAST_WORD_MASK(nr_cpumask_bits);
         |                                         ^~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/compiler_types.h:89,
                    from <command-line>:
   include/linux/smp.h: At top level:
   include/linux/smp.h:34:33: error: requested alignment '20' is not a positive power of 2
      34 |         __aligned(sizeof(struct __call_single_data));
         |                                 ^~~~~~~~~~~~~~~~~~
   include/linux/compiler_attributes.h:33:68: note: in definition of macro '__aligned'
      33 | #define __aligned(x)                    __attribute__((__aligned__(x)))
         |                                                                    ^
   In file included from include/linux/init.h:5,
                    from include/linux/printk.h:6:
   include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, lru) == offsetof(struct folio, lru)"
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                         ^~~~~~~~~~~~~~
   include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
      77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
         |                                  ^~~~~~~~~~~~~~~
   include/linux/mm_types.h:386:9: note: in expansion of macro 'static_assert'
     386 |         static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
         |         ^~~~~~~~~~~~~
   include/linux/mm_types.h:388:1: note: in expansion of macro 'FOLIO_MATCH'
     388 | FOLIO_MATCH(lru, lru);
         | ^~~~~~~~~~~
   include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, mapping) == offsetof(struct folio, mapping)"
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                         ^~~~~~~~~~~~~~
   include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
      77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
         |                                  ^~~~~~~~~~~~~~~
   include/linux/mm_types.h:386:9: note: in expansion of macro 'static_assert'
     386 |         static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
         |         ^~~~~~~~~~~~~
   include/linux/mm_types.h:389:1: note: in expansion of macro 'FOLIO_MATCH'
     389 | FOLIO_MATCH(mapping, mapping);
         | ^~~~~~~~~~~
   include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, compound_head) == offsetof(struct folio, lru)"
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                         ^~~~~~~~~~~~~~
   include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
      77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
         |                                  ^~~~~~~~~~~~~~~
   include/linux/mm_types.h:386:9: note: in expansion of macro 'static_assert'
     386 |         static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
         |         ^~~~~~~~~~~~~
   include/linux/mm_types.h:390:1: note: in expansion of macro 'FOLIO_MATCH'
     390 | FOLIO_MATCH(compound_head, lru);
         | ^~~~~~~~~~~
   include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, index) == offsetof(struct folio, index)"
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                         ^~~~~~~~~~~~~~
   include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
      77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
         |                                  ^~~~~~~~~~~~~~~
   include/linux/mm_types.h:386:9: note: in expansion of macro 'static_assert'
     386 |         static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
         |         ^~~~~~~~~~~~~
   include/linux/mm_types.h:391:1: note: in expansion of macro 'FOLIO_MATCH'
     391 | FOLIO_MATCH(index, index);
         | ^~~~~~~~~~~
   include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, private) == offsetof(struct folio, private)"
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                         ^~~~~~~~~~~~~~
   include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
      77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
         |                                  ^~~~~~~~~~~~~~~
   include/linux/mm_types.h:386:9: note: in expansion of macro 'static_assert'
     386 |         static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
         |         ^~~~~~~~~~~~~
   include/linux/mm_types.h:392:1: note: in expansion of macro 'FOLIO_MATCH'
     392 | FOLIO_MATCH(private, private);
         | ^~~~~~~~~~~
   include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, _mapcount) == offsetof(struct folio, _mapcount)"


vim +9 include/uapi/linux/bits.h

3c7a8e190bc580 Paolo Bonzini 2023-12-12   6  
3c7a8e190bc580 Paolo Bonzini 2023-12-12   7  #define __GENMASK(h, l) \
3c7a8e190bc580 Paolo Bonzini 2023-12-12   8          (((~_UL(0)) - (_UL(1) << (l)) + 1) & \
3c7a8e190bc580 Paolo Bonzini 2023-12-12  @9           (~_UL(0) >> (__BITS_PER_LONG - 1 - (h))))
3c7a8e190bc580 Paolo Bonzini 2023-12-12  10  

:::::: The code at line 9 was first introduced by commit
:::::: 3c7a8e190bc580813ddd9259f62971c8d2a6b5ad uapi: introduce uapi-friendly macros for GENMASK

:::::: TO: Paolo Bonzini <pbonzini@...hat.com>
:::::: CC: Paolo Bonzini <pbonzini@...hat.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ