All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] compiler_types: mark __compiletime_assert failure as __noreturn
@ 2021-10-14 13:23 Miguel Ojeda
  2021-10-14 15:01 ` Peter Zijlstra
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Miguel Ojeda @ 2021-10-14 13:23 UTC (permalink / raw)
  To: Nathan Chancellor, Nick Desaulniers
  Cc: Kees Cook, Peter Zijlstra, Miguel Ojeda, linux-kernel, llvm

`__compiletime_assert` declares a fake `extern` function
which appears (to the compiler) to be called when the test fails.

Therefore, compilers may emit possibly-uninitialized warnings
in some cases, even if it will be an error anyway (for compilers
supporting the `error` attribute, e.g. GCC and Clang >= 14)
or a link failure (for those that do not, e.g. Clang < 14).

Annotating the fake function as `__noreturn` gives them
the information they need to avoid the warning,
e.g. see https://godbolt.org/z/x1v69jjYY.

Link: https://lore.kernel.org/llvm/202110100514.3h9CI4s0-lkp@intel.com/
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
 include/linux/compiler_types.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index b6ff83a714ca..ca1a66b8cd2f 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -298,7 +298,13 @@ struct ftrace_likely_data {
 #ifdef __OPTIMIZE__
 # define __compiletime_assert(condition, msg, prefix, suffix)		\
 	do {								\
-		extern void prefix ## suffix(void) __compiletime_error(msg); \
+		/*							\
+		 * __noreturn is needed to give the compiler enough	\
+		 * information to avoid certain possibly-uninitialized	\
+		 * warnings (regardless of the build failing).		\
+		 */							\
+		__noreturn extern void prefix ## suffix(void)		\
+			__compiletime_error(msg);			\
 		if (!(condition))					\
 			prefix ## suffix();				\
 	} while (0)
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread
* Re: [PATCH] compiler_types: mark __compiletime_assert failure as __noreturn
@ 2021-11-06  9:19 kernel test robot
  0 siblings, 0 replies; 17+ messages in thread
From: kernel test robot @ 2021-11-06  9:19 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 16202 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20211014132331.GA4811@kernel.org>
References: <20211014132331.GA4811@kernel.org>
TO: Miguel Ojeda <ojeda@kernel.org>

Hi Miguel,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.15]
[cannot apply to next-20211106]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Miguel-Ojeda/compiler_types-mark-__compiletime_assert-failure-as-__noreturn/20211014-212525
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 348949d9a4440abdab3b1dc99a9bb660e8c7da7c
:::::: branch date: 3 weeks ago
:::::: commit date: 3 weeks ago
config: x86_64-randconfig-c007-20211015 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project acb3b187c4c88650a6a717a1bcb234d27d0d7f54)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/dbc83335c8484937120e562d531c7f401aa944b2
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Miguel-Ojeda/compiler_types-mark-__compiletime_assert-failure-as-__noreturn/20211014-212525
        git checkout dbc83335c8484937120e562d531c7f401aa944b2
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
           ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:300:2: note: expanded from macro '__compiletime_assert'
           do {                                                            \
           ^
   drivers/hwmon/asus_atk0110.c:220:2: note: 'value' declared without an initial value
           u64 value;
           ^~~~~~~~~
   drivers/hwmon/asus_atk0110.c:223:8: note: Calling 'atk_read_value'
           err = atk_read_value(s, &value);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwmon/asus_atk0110.c:635:6: note: Assuming field 'is_valid' is false
           if (!sensor->is_valid ||
               ^~~~~~~~~~~~~~~~~
   drivers/hwmon/asus_atk0110.c:635:24: note: Left side of '||' is true
           if (!sensor->is_valid ||
                                 ^
   drivers/hwmon/asus_atk0110.c:637:7: note: Assuming field 'old_interface' is false
                   if (sensor->data->old_interface)
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwmon/asus_atk0110.c:637:3: note: Taking false branch
                   if (sensor->data->old_interface)
                   ^
   drivers/hwmon/asus_atk0110.c:640:10: note: Calling 'atk_read_value_new'
                           err = atk_read_value_new(sensor, value);
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwmon/asus_atk0110.c:609:8: note: Calling 'atk_gitm'
           obj = atk_gitm(data, sensor->id);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwmon/asus_atk0110.c:547:6: note: Assuming 'status' is equal to AE_OK
           if (status != AE_OK) {
               ^~~~~~~~~~~~~~~
   drivers/hwmon/asus_atk0110.c:547:2: note: Taking false branch
           if (status != AE_OK) {
           ^
   drivers/hwmon/asus_atk0110.c:555:6: note: Assuming field 'length' is >= 8
           if (obj->buffer.length < 8) {
               ^~~~~~~~~~~~~~~~~~~~~~
   drivers/hwmon/asus_atk0110.c:555:2: note: Taking false branch
           if (obj->buffer.length < 8) {
           ^
   drivers/hwmon/asus_atk0110.c:561:2: note: Returning pointer (loaded from 'obj'), which participates in a condition later
           return obj;
           ^~~~~~~~~~
   drivers/hwmon/asus_atk0110.c:609:8: note: Returning from 'atk_gitm'
           obj = atk_gitm(data, sensor->id);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwmon/asus_atk0110.c:610:6: note: Calling 'IS_ERR'
           if (IS_ERR(obj))
               ^~~~~~~~~~~
   include/linux/err.h:36:9: note: Assuming the condition is true
           return IS_ERR_VALUE((unsigned long)ptr);
                  ^
   include/linux/err.h:22:34: note: expanded from macro 'IS_ERR_VALUE'
   #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/err.h:36:2: note: Returning the value 1, which participates in a condition later
           return IS_ERR_VALUE((unsigned long)ptr);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwmon/asus_atk0110.c:610:6: note: Returning from 'IS_ERR'
           if (IS_ERR(obj))
               ^~~~~~~~~~~
   drivers/hwmon/asus_atk0110.c:610:2: note: Taking true branch
           if (IS_ERR(obj))
           ^
   drivers/hwmon/asus_atk0110.c:611:3: note: Returning value, which participates in a condition later
                   return PTR_ERR(obj);
                   ^~~~~~~~~~~~~~~~~~~
   drivers/hwmon/asus_atk0110.c:640:10: note: Returning from 'atk_read_value_new'
                           err = atk_read_value_new(sensor, value);
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwmon/asus_atk0110.c:642:7: note: Assuming 'err' is 0
                   if (err)
                       ^~~
   drivers/hwmon/asus_atk0110.c:642:3: note: Taking false branch
                   if (err)
                   ^
   drivers/hwmon/asus_atk0110.c:647:24: note: Assigned value is garbage or undefined
                   sensor->cached_value = *value;
                                        ^ ~~~~~~
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
>> mm/memory.c:1132:20: warning: Value stored to 'src_mm' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct mm_struct *src_mm = src_vma->vm_mm;
                             ^~~~~~   ~~~~~~~~~~~~~~
   mm/memory.c:1132:20: note: Value stored to 'src_mm' during its initialization is never read
           struct mm_struct *src_mm = src_vma->vm_mm;
                             ^~~~~~   ~~~~~~~~~~~~~~
   mm/memory.c:1169:20: warning: Value stored to 'src_mm' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct mm_struct *src_mm = src_vma->vm_mm;
                             ^~~~~~   ~~~~~~~~~~~~~~
   mm/memory.c:1169:20: note: Value stored to 'src_mm' during its initialization is never read
           struct mm_struct *src_mm = src_vma->vm_mm;
                             ^~~~~~   ~~~~~~~~~~~~~~
   mm/memory.c:2543:3: warning: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
                   pte_unmap_unlock(mapped_pte, ptl);
                   ^
   include/linux/mm.h:2274:2: note: expanded from macro 'pte_unmap_unlock'
           spin_unlock(ptl);                               \
           ^
   mm/memory.c:2715:9: note: Calling '__apply_to_page_range'
           return __apply_to_page_range(mm, addr, size, fn, data, false);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/memory.c:2667:14: note: Assuming 'addr' is < 'end'
           if (WARN_ON(addr >= end))
                       ^
   include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   mm/memory.c:2667:6: note: Taking false branch
           if (WARN_ON(addr >= end))
               ^
   include/asm-generic/bug.h:122:2: note: expanded from macro 'WARN_ON'
           if (unlikely(__ret_warn_on))                                    \
           ^
   mm/memory.c:2667:2: note: Taking false branch
           if (WARN_ON(addr >= end))
           ^
   mm/memory.c:2672:10: note: Assuming the condition is false
                   next = pgd_addr_end(addr, end);
                          ^
   include/linux/pgtable.h:761:3: note: expanded from macro 'pgd_addr_end'
           (__boundary - 1 < (end) - 1)? __boundary: (end);                \
            ^~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/memory.c:2672:10: note: '?' condition is false
                   next = pgd_addr_end(addr, end);
                          ^
   include/linux/pgtable.h:761:2: note: expanded from macro 'pgd_addr_end'
           (__boundary - 1 < (end) - 1)? __boundary: (end);                \
           ^
   mm/memory.c:2673:7: note: Assuming the condition is false
                   if (pgd_none(*pgd) && !create)
                       ^~~~~~~~~~~~~~
   mm/memory.c:2673:22: note: Left side of '&&' is false
                   if (pgd_none(*pgd) && !create)
                                      ^
   mm/memory.c:2675:7: note: Taking false branch
                   if (WARN_ON_ONCE(pgd_leaf(*pgd)))
                       ^
   include/asm-generic/bug.h:105:2: note: expanded from macro 'WARN_ON_ONCE'
           if (unlikely(__ret_warn_on))                            \
           ^
   mm/memory.c:2675:3: note: Taking false branch
                   if (WARN_ON_ONCE(pgd_leaf(*pgd)))
                   ^
   mm/memory.c:2677:7: note: Assuming the condition is false
                   if (!pgd_none(*pgd) && WARN_ON_ONCE(pgd_bad(*pgd))) {
                       ^~~~~~~~~~~~~~~
   mm/memory.c:2677:23: note: Left side of '&&' is false
                   if (!pgd_none(*pgd) && WARN_ON_ONCE(pgd_bad(*pgd))) {
                                       ^
   mm/memory.c:2682:9: note: Calling 'apply_to_p4d_range'
                   err = apply_to_p4d_range(mm, pgd, addr, next,
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/memory.c:2630:6: note: 'create' is false
           if (create) {
               ^~~~~~
   mm/memory.c:2630:2: note: Taking false branch
           if (create) {
           ^
   mm/memory.c:2638:10: note: Assuming the condition is false
                   next = p4d_addr_end(addr, end);
                          ^
   include/linux/pgtable.h:767:3: note: expanded from macro 'p4d_addr_end'
           (__boundary - 1 < (end) - 1)? __boundary: (end);                \
            ^~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/memory.c:2638:10: note: '?' condition is false
                   next = p4d_addr_end(addr, end);
                          ^
   include/linux/pgtable.h:767:2: note: expanded from macro 'p4d_addr_end'
           (__boundary - 1 < (end) - 1)? __boundary: (end);                \
           ^
   mm/memory.c:2639:7: note: Calling 'p4d_none'
                   if (p4d_none(*p4d) && !create)
                       ^~~~~~~~~~~~~~
   arch/x86/include/asm/pgtable.h:872:9: note: Assuming the condition is false
           return (native_p4d_val(p4d) & ~(_PAGE_KNL_ERRATUM_MASK)) == 0;
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/include/asm/pgtable.h:872:2: note: Returning zero, which participates in a condition later
           return (native_p4d_val(p4d) & ~(_PAGE_KNL_ERRATUM_MASK)) == 0;
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/memory.c:2639:7: note: Returning from 'p4d_none'
                   if (p4d_none(*p4d) && !create)

vim +/src_mm +1132 mm/memory.c

^1da177e4c3f41 Linus Torvalds   2005-04-16  1125  
c78f463649d60f Peter Xu         2020-10-13  1126  static inline int
c78f463649d60f Peter Xu         2020-10-13  1127  copy_pmd_range(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma,
c78f463649d60f Peter Xu         2020-10-13  1128  	       pud_t *dst_pud, pud_t *src_pud, unsigned long addr,
c78f463649d60f Peter Xu         2020-10-13  1129  	       unsigned long end)
^1da177e4c3f41 Linus Torvalds   2005-04-16  1130  {
c78f463649d60f Peter Xu         2020-10-13  1131  	struct mm_struct *dst_mm = dst_vma->vm_mm;
c78f463649d60f Peter Xu         2020-10-13 @1132  	struct mm_struct *src_mm = src_vma->vm_mm;
^1da177e4c3f41 Linus Torvalds   2005-04-16  1133  	pmd_t *src_pmd, *dst_pmd;
^1da177e4c3f41 Linus Torvalds   2005-04-16  1134  	unsigned long next;
^1da177e4c3f41 Linus Torvalds   2005-04-16  1135  
^1da177e4c3f41 Linus Torvalds   2005-04-16  1136  	dst_pmd = pmd_alloc(dst_mm, dst_pud, addr);
^1da177e4c3f41 Linus Torvalds   2005-04-16  1137  	if (!dst_pmd)
^1da177e4c3f41 Linus Torvalds   2005-04-16  1138  		return -ENOMEM;
^1da177e4c3f41 Linus Torvalds   2005-04-16  1139  	src_pmd = pmd_offset(src_pud, addr);
^1da177e4c3f41 Linus Torvalds   2005-04-16  1140  	do {
^1da177e4c3f41 Linus Torvalds   2005-04-16  1141  		next = pmd_addr_end(addr, end);
84c3fc4e9c563d Zi Yan           2017-09-08  1142  		if (is_swap_pmd(*src_pmd) || pmd_trans_huge(*src_pmd)
84c3fc4e9c563d Zi Yan           2017-09-08  1143  			|| pmd_devmap(*src_pmd)) {
71e3aac0724ffe Andrea Arcangeli 2011-01-13  1144  			int err;
c78f463649d60f Peter Xu         2020-10-13  1145  			VM_BUG_ON_VMA(next-addr != HPAGE_PMD_SIZE, src_vma);
8f34f1eac3820f Peter Xu         2021-06-30  1146  			err = copy_huge_pmd(dst_mm, src_mm, dst_pmd, src_pmd,
8f34f1eac3820f Peter Xu         2021-06-30  1147  					    addr, dst_vma, src_vma);
71e3aac0724ffe Andrea Arcangeli 2011-01-13  1148  			if (err == -ENOMEM)
71e3aac0724ffe Andrea Arcangeli 2011-01-13  1149  				return -ENOMEM;
71e3aac0724ffe Andrea Arcangeli 2011-01-13  1150  			if (!err)
71e3aac0724ffe Andrea Arcangeli 2011-01-13  1151  				continue;
71e3aac0724ffe Andrea Arcangeli 2011-01-13  1152  			/* fall through */
71e3aac0724ffe Andrea Arcangeli 2011-01-13  1153  		}
^1da177e4c3f41 Linus Torvalds   2005-04-16  1154  		if (pmd_none_or_clear_bad(src_pmd))
^1da177e4c3f41 Linus Torvalds   2005-04-16  1155  			continue;
c78f463649d60f Peter Xu         2020-10-13  1156  		if (copy_pte_range(dst_vma, src_vma, dst_pmd, src_pmd,
c78f463649d60f Peter Xu         2020-10-13  1157  				   addr, next))
^1da177e4c3f41 Linus Torvalds   2005-04-16  1158  			return -ENOMEM;
^1da177e4c3f41 Linus Torvalds   2005-04-16  1159  	} while (dst_pmd++, src_pmd++, addr = next, addr != end);
^1da177e4c3f41 Linus Torvalds   2005-04-16  1160  	return 0;
^1da177e4c3f41 Linus Torvalds   2005-04-16  1161  }
^1da177e4c3f41 Linus Torvalds   2005-04-16  1162  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34210 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: [PATCH] compiler_types: mark __compiletime_assert failure as __noreturn
@ 2021-11-07  8:28 kernel test robot
  0 siblings, 0 replies; 17+ messages in thread
From: kernel test robot @ 2021-11-07  8:28 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 46568 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20211014132331.GA4811@kernel.org>
References: <20211014132331.GA4811@kernel.org>
TO: Miguel Ojeda <ojeda@kernel.org>

Hi Miguel,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.15]
[cannot apply to next-20211106]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Miguel-Ojeda/compiler_types-mark-__compiletime_assert-failure-as-__noreturn/20211014-212525
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 348949d9a4440abdab3b1dc99a9bb660e8c7da7c
:::::: branch date: 3 weeks ago
:::::: commit date: 3 weeks ago
config: riscv-randconfig-c006-20211014 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project acb3b187c4c88650a6a717a1bcb234d27d0d7f54)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/0day-ci/linux/commit/dbc83335c8484937120e562d531c7f401aa944b2
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Miguel-Ojeda/compiler_types-mark-__compiletime_assert-failure-as-__noreturn/20211014-212525
        git checkout dbc83335c8484937120e562d531c7f401aa944b2
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   kernel/bpf/core.c:962:2: note: Loop condition is false.  Exiting loop
           BUILD_BUG_ON(BPF_REG_AX  + 1 != MAX_BPF_JIT_REG);
           ^
   include/linux/build_bug.h:50:2: note: expanded from macro 'BUILD_BUG_ON'
           BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
           ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:300:2: note: expanded from macro '__compiletime_assert'
           do {                                                            \
           ^
   kernel/bpf/core.c:963:2: note: Taking false branch
           BUILD_BUG_ON(MAX_BPF_REG + 1 != MAX_BPF_JIT_REG);
           ^
   include/linux/build_bug.h:50:2: note: expanded from macro 'BUILD_BUG_ON'
           BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
           ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   kernel/bpf/core.c:963:2: note: Loop condition is false.  Exiting loop
           BUILD_BUG_ON(MAX_BPF_REG + 1 != MAX_BPF_JIT_REG);
           ^
   include/linux/build_bug.h:50:2: note: expanded from macro 'BUILD_BUG_ON'
           BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
           ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:300:2: note: expanded from macro '__compiletime_assert'
           do {                                                            \
           ^
   kernel/bpf/core.c:982:6: note: Assuming field 'dst_reg' is not equal to __MAX_BPF_REG
           if (from->dst_reg == BPF_REG_AX || from->src_reg == BPF_REG_AX)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/bpf/core.c:982:6: note: Left side of '||' is false
   kernel/bpf/core.c:982:37: note: Assuming field 'src_reg' is not equal to __MAX_BPF_REG
           if (from->dst_reg == BPF_REG_AX || from->src_reg == BPF_REG_AX)
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/bpf/core.c:982:2: note: Taking false branch
           if (from->dst_reg == BPF_REG_AX || from->src_reg == BPF_REG_AX)
           ^
   kernel/bpf/core.c:985:6: note: Assuming field 'imm' is not equal to 0
           if (from->imm == 0 &&
               ^~~~~~~~~~~~~~
   kernel/bpf/core.c:985:21: note: Left side of '&&' is false
           if (from->imm == 0 &&
                              ^
   kernel/bpf/core.c:992:2: note: Control jumps to 'case 0:'  at line 1068
           switch (from->code) {
           ^
   kernel/bpf/core.c:1069:54: note: The right operand of '^' is a garbage value
                   *to++ = BPF_ALU32_IMM(BPF_MOV, BPF_REG_AX, imm_rnd ^ aux[0].imm);
                                                                      ^
   include/linux/filter.h:124:12: note: expanded from macro 'BPF_ALU32_IMM'
                   .imm   = IMM })
                            ^~~
   Suppressed 13 warnings (13 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   11 warnings generated.
>> mm/gup.c:708:2: warning: Value stored to 'page' is never read [clang-analyzer-deadcode.DeadStores]
           page = follow_trans_huge_pmd(vma, address, pmd, flags);
           ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/gup.c:708:2: note: Value stored to 'page' is never read
           page = follow_trans_huge_pmd(vma, address, pmd, flags);
           ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/gup.c:1294:13: warning: Dereference of null pointer (loaded from variable 'unlocked') [clang-analyzer-core.NullDereference]
                   *unlocked = true;
                    ~~~~~~~~ ^
   mm/gup.c:1268:6: note: Assuming 'unlocked' is null
           if (unlocked)
               ^~~~~~~~
   mm/gup.c:1268:2: note: Taking false branch
           if (unlocked)
           ^
   mm/gup.c:1273:6: note: Assuming 'vma' is non-null
           if (!vma || address < vma->vm_start)
               ^~~~
   mm/gup.c:1273:6: note: Left side of '||' is false
   mm/gup.c:1273:14: note: Assuming 'address' is >= field 'vm_start'
           if (!vma || address < vma->vm_start)
                       ^~~~~~~~~~~~~~~~~~~~~~~
   mm/gup.c:1273:2: note: Taking false branch
           if (!vma || address < vma->vm_start)
           ^
   mm/gup.c:1276:7: note: Calling 'vma_permits_fault'
           if (!vma_permits_fault(vma, fault_flags))
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/gup.c:1210:18: note: Assuming the condition is false
           bool write   = !!(fault_flags & FAULT_FLAG_WRITE);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/gup.c:1211:18: note: Assuming the condition is false
           bool foreign = !!(fault_flags & FAULT_FLAG_REMOTE);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/gup.c:1212:24: note: 'write' is true
           vm_flags_t vm_flags = write ? VM_WRITE : VM_READ;
                                 ^~~~~
   mm/gup.c:1212:24: note: '?' condition is true
   mm/gup.c:1214:6: note: Assuming the condition is false
           if (!(vm_flags & vma->vm_flags))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/gup.c:1214:2: note: Taking false branch
           if (!(vm_flags & vma->vm_flags))
           ^
   mm/gup.c:1224:7: note: Calling 'arch_vma_access_permitted'
           if (!arch_vma_access_permitted(vma, write, false, foreign))
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/mm_hooks.h:29:2: note: Returning the value 1, which participates in a condition later
           return true;
           ^~~~~~~~~~~
   mm/gup.c:1224:7: note: Returning from 'arch_vma_access_permitted'
           if (!arch_vma_access_permitted(vma, write, false, foreign))
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/gup.c:1224:2: note: Taking false branch
           if (!arch_vma_access_permitted(vma, write, false, foreign))
           ^
   mm/gup.c:1227:2: note: Returning the value 1, which participates in a condition later
           return true;
           ^~~~~~~~~~~
   mm/gup.c:1276:7: note: Returning from 'vma_permits_fault'
           if (!vma_permits_fault(vma, fault_flags))
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/gup.c:1276:2: note: Taking false branch
           if (!vma_permits_fault(vma, fault_flags))
           ^
   mm/gup.c:1279:7: note: Assuming the condition is false
           if ((fault_flags & FAULT_FLAG_KILLABLE) &&
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/gup.c:1279:42: note: Left side of '&&' is false
           if ((fault_flags & FAULT_FLAG_KILLABLE) &&
                                                   ^
   mm/gup.c:1284:6: note: Assuming the condition is false
           if (ret & VM_FAULT_ERROR) {
               ^~~~~~~~~~~~~~~~~~~~
   mm/gup.c:1284:2: note: Taking false branch
           if (ret & VM_FAULT_ERROR) {
           ^
   mm/gup.c:1292:6: note: Assuming the condition is true
           if (ret & VM_FAULT_RETRY) {
               ^~~~~~~~~~~~~~~~~~~~
   mm/gup.c:1292:2: note: Taking true branch
           if (ret & VM_FAULT_RETRY) {
           ^
   mm/gup.c:1294:13: note: Dereference of null pointer (loaded from variable 'unlocked')
                   *unlocked = true;
                    ~~~~~~~~ ^
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
--
                   ^        ~~~~~~
   lib/assoc_array.c:409:3: note: Value stored to 'cursor' is never read
                   cursor = parent;
                   ^        ~~~~~~
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
   lib/debugobjects.c:502:9: warning: Value stored to 'hint' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
                   void *hint = descr->debug_hint ?
                         ^~~~   ~~~~~~~~~~~~~~~~~~~
   lib/debugobjects.c:502:9: note: Value stored to 'hint' during its initialization is never read
                   void *hint = descr->debug_hint ?
                         ^~~~   ~~~~~~~~~~~~~~~~~~~
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   lib/math/reciprocal_div.c:51:14: warning: The result of the left shift is undefined due to shifting by '64', which is greater or equal to the width of type 'unsigned long long' [clang-analyzer-core.UndefinedBinaryOperatorResult]
           mlow = 1ULL << (32 + l);
                       ^  ~~~~~~~~
   lib/math/reciprocal_div.c:47:2: note: Taking false branch
           WARN(l == 32,
           ^
   include/asm-generic/bug.h:174:2: note: expanded from macro 'WARN'
           no_printk(format);                                              \
           ^
   include/linux/printk.h:131:2: note: expanded from macro 'no_printk'
           if (0)                                          \
           ^
   lib/math/reciprocal_div.c:51:14: note: The result of the left shift is undefined due to shifting by '64', which is greater or equal to the width of type 'unsigned long long'
           mlow = 1ULL << (32 + l);
                       ^  ~~~~~~~~
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   8 warnings generated.
   Suppressed 8 warnings (8 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   15 warnings generated.
   Suppressed 15 warnings (15 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   12 warnings generated.
   mm/shmem.c:1362:2: warning: Value stored to 'index' is never read [clang-analyzer-deadcode.DeadStores]
           index = page->index;
           ^       ~~~~~~~~~~~
   mm/shmem.c:1362:2: note: Value stored to 'index' is never read
           index = page->index;
           ^       ~~~~~~~~~~~
>> mm/shmem.c:1554:24: warning: Value stored to 'mapping' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct address_space *mapping = info->vfs_inode.i_mapping;
                                 ^~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/shmem.c:1554:24: note: Value stored to 'mapping' during its initialization is never read
           struct address_space *mapping = info->vfs_inode.i_mapping;
                                 ^~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 10 warnings (9 in non-user code, 1 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   11 warnings generated.
   mm/percpu.c:276:44: warning: The result of the left shift is undefined because the left operand is negative [clang-analyzer-core.UndefinedBinaryOperatorResult]
           return pcpu_unit_offsets[cpu] + (page_idx << PAGE_SHIFT);
                                                     ^
   mm/percpu.c:2247:2: note: Calling 'pcpu_reclaim_populated'
           pcpu_reclaim_populated();
           ^~~~~~~~~~~~~~~~~~~~~~~~
   mm/percpu.c:2143:2: note: 'debug_locks' is 0
           lockdep_assert_held(&pcpu_lock);
           ^
   include/linux/lockdep.h:316:2: note: expanded from macro 'lockdep_assert_held'
           lockdep_assert(lockdep_is_held(l) != LOCK_STATE_NOT_HELD)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/lockdep.h:310:15: note: expanded from macro 'lockdep_assert'
           do { WARN_ON(debug_locks && !(cond)); } while (0)
                        ^~~~~~~~~~~
   include/asm-generic/bug.h:166:25: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   mm/percpu.c:2143:2: note: Left side of '&&' is false
           lockdep_assert_held(&pcpu_lock);
           ^
   include/linux/lockdep.h:316:2: note: expanded from macro 'lockdep_assert_held'
           lockdep_assert(lockdep_is_held(l) != LOCK_STATE_NOT_HELD)
           ^
   include/linux/lockdep.h:310:27: note: expanded from macro 'lockdep_assert'
           do { WARN_ON(debug_locks && !(cond)); } while (0)
                                    ^
   mm/percpu.c:2143:2: note: Loop condition is false.  Exiting loop
           lockdep_assert_held(&pcpu_lock);
           ^
   include/linux/lockdep.h:316:2: note: expanded from macro 'lockdep_assert_held'
           lockdep_assert(lockdep_is_held(l) != LOCK_STATE_NOT_HELD)
           ^
   include/linux/lockdep.h:310:2: note: expanded from macro 'lockdep_assert'
           do { WARN_ON(debug_locks && !(cond)); } while (0)
           ^
   mm/percpu.c:2151:2: note: Loop condition is true.  Entering loop body
           while (!list_empty(&pcpu_chunk_lists[pcpu_to_depopulate_slot])) {
           ^
   mm/percpu.c:2152:11: note: Left side of '&&' is false
                   chunk = list_first_entry(&pcpu_chunk_lists[pcpu_to_depopulate_slot],
                           ^
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
           list_entry((ptr)->next, type, member)
           ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   include/linux/kernel.h:495:61: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
                                                                      ^
   mm/percpu.c:2152:11: note: Taking false branch
                   chunk = list_first_entry(&pcpu_chunk_lists[pcpu_to_depopulate_slot],
                           ^
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
           list_entry((ptr)->next, type, member)
           ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   mm/percpu.c:2152:11: note: Loop condition is false.  Exiting loop
                   chunk = list_first_entry(&pcpu_chunk_lists[pcpu_to_depopulate_slot],
                           ^
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
--
           ^
   include/asm-generic/rwonce.h:36:2: note: expanded from macro 'compiletime_assert_rwonce_type'
           compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
           ^
   include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   include/linux/skbuff.h:1942:2: note: Loop condition is false.  Exiting loop
           WRITE_ONCE(prev->next, newsk);
           ^
   include/asm-generic/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE'
           compiletime_assert_rwonce_type(x);                              \
           ^
   include/asm-generic/rwonce.h:36:2: note: expanded from macro 'compiletime_assert_rwonce_type'
           compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
           ^
   include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:300:2: note: expanded from macro '__compiletime_assert'
           do {                                                            \
           ^
   include/linux/skbuff.h:1942:2: note: Dereference of null pointer
           WRITE_ONCE(prev->next, newsk);
           ^
   include/asm-generic/rwonce.h:61:2: note: expanded from macro 'WRITE_ONCE'
           __WRITE_ONCE(x, val);                                           \
           ^~~~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:55:30: note: expanded from macro '__WRITE_ONCE'
           *(volatile typeof(x) *)&(x) = (val);                            \
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
   include/linux/skbuff.h:2048:2: warning: 2nd function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
           __skb_insert(newsk, next->prev, next, list);
           ^
   net/tipc/bcast.c:565:2: note: Calling 'tipc_bcbase_xmit'
           tipc_bcbase_xmit(net, &xmitq);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/tipc/bcast.c:184:2: note: Taking false branch
           if (skb_queue_empty(xmitq))
           ^
   net/tipc/bcast.c:189:6: note: Assuming 'bearer_id' is < 0
           if (bearer_id >= 0) {
               ^~~~~~~~~~~~~~
   net/tipc/bcast.c:189:2: note: Taking false branch
           if (bearer_id >= 0) {
           ^
   net/tipc/bcast.c:195:2: note: Calling '__skb_queue_head_init'
           __skb_queue_head_init(&_xmitq);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/tipc/bcast.c:195:2: note: Returning from '__skb_queue_head_init'
           __skb_queue_head_init(&_xmitq);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/tipc/bcast.c:196:2: note: Loop condition is true.  Entering loop body
           for (bearer_id = 0; bearer_id < MAX_BEARERS; bearer_id++) {
           ^
   net/tipc/bcast.c:197:7: note: Assuming the condition is false
                   if (!bb->dests[bearer_id])
                       ^~~~~~~~~~~~~~~~~~~~~
   net/tipc/bcast.c:197:3: note: Taking false branch
                   if (!bb->dests[bearer_id])
                   ^
   net/tipc/bcast.c:200:3: note: Loop condition is true.  Entering loop body
                   skb_queue_walk(xmitq, skb) {
                   ^
   include/linux/skbuff.h:3537:3: note: expanded from macro 'skb_queue_walk'
                   for (skb = (queue)->next;                                       \
                   ^
   net/tipc/bcast.c:202:8: note: Assuming '_skb' is non-null
                           if (!_skb)
                               ^~~~~
   net/tipc/bcast.c:202:4: note: Taking false branch
                           if (!_skb)
                           ^
   net/tipc/bcast.c:204:4: note: Calling '__skb_queue_tail'
                           __skb_queue_tail(&_xmitq, _skb);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/skbuff.h:2081:2: note: Calling '__skb_queue_before'
           __skb_queue_before(list, (struct sk_buff *)list, newsk);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/skbuff.h:2048:2: note: 2nd function call argument is an uninitialized value
           __skb_insert(newsk, next->prev, next, list);
           ^                   ~~~~~~~~~~
   Suppressed 14 warnings (14 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   10 warnings generated.
>> mm/migrate.c:1633:3: warning: Value stored to 'gfp_mask' is never read [clang-analyzer-deadcode.DeadStores]
                   gfp_mask |= GFP_TRANSHUGE;
                   ^
   mm/migrate.c:1633:3: note: Value stored to 'gfp_mask' is never read
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   18 warnings generated.
   drivers/char/ipmi/ipmi_ssif.c:817:37: warning: Array access (via field 'rsp') results in a null pointer dereference [clang-analyzer-core.NullDereference]
                   if ((result < 0) || (len < 3) || (msg->rsp[2] != 0)) {
                                                     ^    ~~~
   drivers/char/ipmi/ipmi_ssif.c:618:6: note: Assuming 'result' is >= 0
           if (result < 0) {
               ^~~~~~~~~~
   drivers/char/ipmi/ipmi_ssif.c:618:2: note: Taking false branch
           if (result < 0) {
           ^
   drivers/char/ipmi/ipmi_ssif.c:642:7: note: Assuming 'len' is > 1
           if ((len > 1) && (ssif_info->multi_pos == 0)
                ^~~~~~~
   drivers/char/ipmi/ipmi_ssif.c:642:6: note: Left side of '&&' is true
           if ((len > 1) && (ssif_info->multi_pos == 0)
               ^
   drivers/char/ipmi/ipmi_ssif.c:642:20: note: Assuming field 'multi_pos' is equal to 0
           if ((len > 1) && (ssif_info->multi_pos == 0)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/char/ipmi/ipmi_ssif.c:642:6: note: Left side of '&&' is true
           if ((len > 1) && (ssif_info->multi_pos == 0)
               ^
   drivers/char/ipmi/ipmi_ssif.c:643:9: note: Assuming the condition is false
                                   && (data[0] == 0x00) && (data[1] == 0x01)) {
                                       ^~~~~~~~~~~~~~~
   drivers/char/ipmi/ipmi_ssif.c:643:26: note: Left side of '&&' is false
                                   && (data[0] == 0x00) && (data[1] == 0x01)) {
                                                        ^
   drivers/char/ipmi/ipmi_ssif.c:661:24: note: Field 'multi_pos' is 0
           } else if (ssif_info->multi_pos) {
                                 ^
   drivers/char/ipmi/ipmi_ssif.c:661:9: note: Taking false branch
           } else if (ssif_info->multi_pos) {
                  ^
   drivers/char/ipmi/ipmi_ssif.c:732:6: note: 'result' is >= 0
           if (result < 0) {
               ^~~~~~
   drivers/char/ipmi/ipmi_ssif.c:732:2: note: Taking false branch
           if (result < 0) {
           ^
   drivers/char/ipmi/ipmi_ssif.c:739:6: note: Assuming the condition is false
           if (ssif_info->ssif_debug & SSIF_DEBUG_STATE)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/char/ipmi/ipmi_ssif.c:739:2: note: Taking false branch
           if (ssif_info->ssif_debug & SSIF_DEBUG_STATE)
           ^
   drivers/char/ipmi/ipmi_ssif.c:744:10: note: Calling 'ipmi_ssif_lock_cond'
           flags = ipmi_ssif_lock_cond(ssif_info, &oflags);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/char/ipmi/ipmi_ssif.c:311:2: note: Value assigned to field 'curr_msg'
           spin_lock_irqsave(&ssif_info->lock, *flags);
           ^
   include/linux/spinlock.h:393:2: note: expanded from macro 'spin_lock_irqsave'
           raw_spin_lock_irqsave(spinlock_check(lock), flags);     \
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/spinlock.h:256:11: note: expanded from macro 'raw_spin_lock_irqsave'
                   flags = _raw_spin_lock_irqsave(lock);   \
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/char/ipmi/ipmi_ssif.c:311:2: note: Value assigned to field 'ssif_state', which participates in a condition later
           spin_lock_irqsave(&ssif_info->lock, *flags);
           ^
   include/linux/spinlock.h:393:2: note: expanded from macro 'spin_lock_irqsave'
           raw_spin_lock_irqsave(spinlock_check(lock), flags);     \
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/spinlock.h:256:11: note: expanded from macro 'raw_spin_lock_irqsave'
                   flags = _raw_spin_lock_irqsave(lock);   \
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/char/ipmi/ipmi_ssif.c:311:2: note: Loop condition is false.  Exiting loop
           spin_lock_irqsave(&ssif_info->lock, *flags);
           ^
   include/linux/spinlock.h:393:2: note: expanded from macro 'spin_lock_irqsave'
           raw_spin_lock_irqsave(spinlock_check(lock), flags);     \
           ^
   include/linux/spinlock.h:254:2: note: expanded from macro 'raw_spin_lock_irqsave'
           do {                                            \
           ^
   drivers/char/ipmi/ipmi_ssif.c:311:2: note: Loop condition is false.  Exiting loop
           spin_lock_irqsave(&ssif_info->lock, *flags);
           ^
   include/linux/spinlock.h:391:43: note: expanded from macro 'spin_lock_irqsave'

vim +/page +708 mm/gup.c

69e68b4f03135d Kirill A. Shutemov 2014-06-04  610  
080dbb618b4bc2 Aneesh Kumar K.V   2017-07-06  611  static struct page *follow_pmd_mask(struct vm_area_struct *vma,
080dbb618b4bc2 Aneesh Kumar K.V   2017-07-06  612  				    unsigned long address, pud_t *pudp,
df06b37ffe5a44 Keith Busch        2018-10-26  613  				    unsigned int flags,
df06b37ffe5a44 Keith Busch        2018-10-26  614  				    struct follow_page_context *ctx)
69e68b4f03135d Kirill A. Shutemov 2014-06-04  615  {
688272809fcce5 Huang Ying         2018-06-07  616  	pmd_t *pmd, pmdval;
69e68b4f03135d Kirill A. Shutemov 2014-06-04  617  	spinlock_t *ptl;
69e68b4f03135d Kirill A. Shutemov 2014-06-04  618  	struct page *page;
69e68b4f03135d Kirill A. Shutemov 2014-06-04  619  	struct mm_struct *mm = vma->vm_mm;
69e68b4f03135d Kirill A. Shutemov 2014-06-04  620  
080dbb618b4bc2 Aneesh Kumar K.V   2017-07-06  621  	pmd = pmd_offset(pudp, address);
688272809fcce5 Huang Ying         2018-06-07  622  	/*
688272809fcce5 Huang Ying         2018-06-07  623  	 * The READ_ONCE() will stabilize the pmdval in a register or
688272809fcce5 Huang Ying         2018-06-07  624  	 * on the stack so that it will stop changing under the code.
688272809fcce5 Huang Ying         2018-06-07  625  	 */
688272809fcce5 Huang Ying         2018-06-07  626  	pmdval = READ_ONCE(*pmd);
688272809fcce5 Huang Ying         2018-06-07  627  	if (pmd_none(pmdval))
69e68b4f03135d Kirill A. Shutemov 2014-06-04  628  		return no_page_table(vma, flags);
be9d30458913f7 Wei Yang           2020-01-30  629  	if (pmd_huge(pmdval) && is_vm_hugetlb_page(vma)) {
e66f17ff71772b Naoya Horiguchi    2015-02-11  630  		page = follow_huge_pmd(mm, address, pmd, flags);
e66f17ff71772b Naoya Horiguchi    2015-02-11  631  		if (page)
4bbd4c776a63a0 Kirill A. Shutemov 2014-06-04  632  			return page;
e66f17ff71772b Naoya Horiguchi    2015-02-11  633  		return no_page_table(vma, flags);
4bbd4c776a63a0 Kirill A. Shutemov 2014-06-04  634  	}
688272809fcce5 Huang Ying         2018-06-07  635  	if (is_hugepd(__hugepd(pmd_val(pmdval)))) {
4dc71451a2078e Aneesh Kumar K.V   2017-07-06  636  		page = follow_huge_pd(vma, address,
688272809fcce5 Huang Ying         2018-06-07  637  				      __hugepd(pmd_val(pmdval)), flags,
4dc71451a2078e Aneesh Kumar K.V   2017-07-06  638  				      PMD_SHIFT);
4dc71451a2078e Aneesh Kumar K.V   2017-07-06  639  		if (page)
4dc71451a2078e Aneesh Kumar K.V   2017-07-06  640  			return page;
4dc71451a2078e Aneesh Kumar K.V   2017-07-06  641  		return no_page_table(vma, flags);
4dc71451a2078e Aneesh Kumar K.V   2017-07-06  642  	}
84c3fc4e9c563d Zi Yan             2017-09-08  643  retry:
688272809fcce5 Huang Ying         2018-06-07  644  	if (!pmd_present(pmdval)) {
84c3fc4e9c563d Zi Yan             2017-09-08  645  		if (likely(!(flags & FOLL_MIGRATION)))
84c3fc4e9c563d Zi Yan             2017-09-08  646  			return no_page_table(vma, flags);
84c3fc4e9c563d Zi Yan             2017-09-08  647  		VM_BUG_ON(thp_migration_supported() &&
688272809fcce5 Huang Ying         2018-06-07  648  				  !is_pmd_migration_entry(pmdval));
688272809fcce5 Huang Ying         2018-06-07  649  		if (is_pmd_migration_entry(pmdval))
84c3fc4e9c563d Zi Yan             2017-09-08  650  			pmd_migration_entry_wait(mm, pmd);
688272809fcce5 Huang Ying         2018-06-07  651  		pmdval = READ_ONCE(*pmd);
688272809fcce5 Huang Ying         2018-06-07  652  		/*
688272809fcce5 Huang Ying         2018-06-07  653  		 * MADV_DONTNEED may convert the pmd to null because
c1e8d7c6a7a682 Michel Lespinasse  2020-06-08  654  		 * mmap_lock is held in read mode
688272809fcce5 Huang Ying         2018-06-07  655  		 */
688272809fcce5 Huang Ying         2018-06-07  656  		if (pmd_none(pmdval))
688272809fcce5 Huang Ying         2018-06-07  657  			return no_page_table(vma, flags);
84c3fc4e9c563d Zi Yan             2017-09-08  658  		goto retry;
84c3fc4e9c563d Zi Yan             2017-09-08  659  	}
688272809fcce5 Huang Ying         2018-06-07  660  	if (pmd_devmap(pmdval)) {
3565fce3a6597e Dan Williams       2016-01-15  661  		ptl = pmd_lock(mm, pmd);
df06b37ffe5a44 Keith Busch        2018-10-26  662  		page = follow_devmap_pmd(vma, address, pmd, flags, &ctx->pgmap);
3565fce3a6597e Dan Williams       2016-01-15  663  		spin_unlock(ptl);
3565fce3a6597e Dan Williams       2016-01-15  664  		if (page)
3565fce3a6597e Dan Williams       2016-01-15  665  			return page;
3565fce3a6597e Dan Williams       2016-01-15  666  	}
688272809fcce5 Huang Ying         2018-06-07  667  	if (likely(!pmd_trans_huge(pmdval)))
df06b37ffe5a44 Keith Busch        2018-10-26  668  		return follow_page_pte(vma, address, pmd, flags, &ctx->pgmap);
6742d293cbe01d Kirill A. Shutemov 2016-01-15  669  
688272809fcce5 Huang Ying         2018-06-07  670  	if ((flags & FOLL_NUMA) && pmd_protnone(pmdval))
db08f2030a173f Aneesh Kumar K.V   2017-02-24  671  		return no_page_table(vma, flags);
db08f2030a173f Aneesh Kumar K.V   2017-02-24  672  
84c3fc4e9c563d Zi Yan             2017-09-08  673  retry_locked:
69e68b4f03135d Kirill A. Shutemov 2014-06-04  674  	ptl = pmd_lock(mm, pmd);
688272809fcce5 Huang Ying         2018-06-07  675  	if (unlikely(pmd_none(*pmd))) {
688272809fcce5 Huang Ying         2018-06-07  676  		spin_unlock(ptl);
688272809fcce5 Huang Ying         2018-06-07  677  		return no_page_table(vma, flags);
688272809fcce5 Huang Ying         2018-06-07  678  	}
84c3fc4e9c563d Zi Yan             2017-09-08  679  	if (unlikely(!pmd_present(*pmd))) {
84c3fc4e9c563d Zi Yan             2017-09-08  680  		spin_unlock(ptl);
84c3fc4e9c563d Zi Yan             2017-09-08  681  		if (likely(!(flags & FOLL_MIGRATION)))
84c3fc4e9c563d Zi Yan             2017-09-08  682  			return no_page_table(vma, flags);
84c3fc4e9c563d Zi Yan             2017-09-08  683  		pmd_migration_entry_wait(mm, pmd);
84c3fc4e9c563d Zi Yan             2017-09-08  684  		goto retry_locked;
84c3fc4e9c563d Zi Yan             2017-09-08  685  	}
6742d293cbe01d Kirill A. Shutemov 2016-01-15  686  	if (unlikely(!pmd_trans_huge(*pmd))) {
6742d293cbe01d Kirill A. Shutemov 2016-01-15  687  		spin_unlock(ptl);
df06b37ffe5a44 Keith Busch        2018-10-26  688  		return follow_page_pte(vma, address, pmd, flags, &ctx->pgmap);
6742d293cbe01d Kirill A. Shutemov 2016-01-15  689  	}
4066c119483af8 Yang Shi           2021-04-29  690  	if (flags & FOLL_SPLIT_PMD) {
6742d293cbe01d Kirill A. Shutemov 2016-01-15  691  		int ret;
6742d293cbe01d Kirill A. Shutemov 2016-01-15  692  		page = pmd_page(*pmd);
6742d293cbe01d Kirill A. Shutemov 2016-01-15  693  		if (is_huge_zero_page(page)) {
6742d293cbe01d Kirill A. Shutemov 2016-01-15  694  			spin_unlock(ptl);
6742d293cbe01d Kirill A. Shutemov 2016-01-15  695  			ret = 0;
78ddc534734190 Kirill A. Shutemov 2016-01-15  696  			split_huge_pmd(vma, pmd, address);
337d9abf1cd1a5 Naoya Horiguchi    2016-07-26  697  			if (pmd_trans_unstable(pmd))
337d9abf1cd1a5 Naoya Horiguchi    2016-07-26  698  				ret = -EBUSY;
4066c119483af8 Yang Shi           2021-04-29  699  		} else {
bfe7b00de6d1e2 Song Liu           2019-09-23  700  			spin_unlock(ptl);
bfe7b00de6d1e2 Song Liu           2019-09-23  701  			split_huge_pmd(vma, pmd, address);
bfe7b00de6d1e2 Song Liu           2019-09-23  702  			ret = pte_alloc(mm, pmd) ? -ENOMEM : 0;
69e68b4f03135d Kirill A. Shutemov 2014-06-04  703  		}
6742d293cbe01d Kirill A. Shutemov 2016-01-15  704  
6742d293cbe01d Kirill A. Shutemov 2016-01-15  705  		return ret ? ERR_PTR(ret) :
df06b37ffe5a44 Keith Busch        2018-10-26  706  			follow_page_pte(vma, address, pmd, flags, &ctx->pgmap);
69e68b4f03135d Kirill A. Shutemov 2014-06-04  707  	}
6742d293cbe01d Kirill A. Shutemov 2016-01-15 @708  	page = follow_trans_huge_pmd(vma, address, pmd, flags);
6742d293cbe01d Kirill A. Shutemov 2016-01-15  709  	spin_unlock(ptl);
df06b37ffe5a44 Keith Busch        2018-10-26  710  	ctx->page_mask = HPAGE_PMD_NR - 1;
6742d293cbe01d Kirill A. Shutemov 2016-01-15  711  	return page;
69e68b4f03135d Kirill A. Shutemov 2014-06-04  712  }
4bbd4c776a63a0 Kirill A. Shutemov 2014-06-04  713  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31445 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-12-02  6:24 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-14 13:23 [PATCH] compiler_types: mark __compiletime_assert failure as __noreturn Miguel Ojeda
2021-10-14 15:01 ` Peter Zijlstra
2021-10-14 17:48   ` Nick Desaulniers
2021-10-14 18:33     ` Miguel Ojeda
2021-10-14 18:41       ` Miguel Ojeda
2021-10-14 18:55         ` Nick Desaulniers
2021-10-14 19:33           ` Miguel Ojeda
2021-10-15  7:55           ` Rasmus Villemoes
2021-10-15  8:11     ` Rasmus Villemoes
2021-10-15 12:36       ` Miguel Ojeda
2021-10-14 17:26 ` Nathan Chancellor
2021-10-14 17:36 ` Nick Desaulniers
2021-10-21 23:20 ` Miguel Ojeda
2021-12-02  6:12 ` Dan Carpenter
2021-12-02  6:24   ` Dan Carpenter
2021-11-06  9:19 kernel test robot
2021-11-07  8:28 kernel test robot

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.