Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [jpoimboe:sframe-2.2 5/9] kernel/unwind/user.c:191:18: warning: shift count >= width of type
@ 2024-10-21  8:57 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-10-21  8:57 UTC (permalink / raw)
  To: Josh Poimboeuf; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git sframe-2.2
head:   757574ba1822accfdae6ec405421f5e2df48fe52
commit: d76cec29ef1d2284f0024c60d736b5ed01f89792 [5/9] unwind: Add deferred userspace unwinding API
config: i386-defconfig (https://download.01.org/0day-ci/archive/20241021/202410211608.b342Ychx-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241021/202410211608.b342Ychx-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/202410211608.b342Ychx-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> kernel/unwind/user.c:191:18: warning: shift count >= width of type [-Wshift-count-overflow]
     191 |                 cookie &= (1UL << 48) - 1;
         |                                ^  ~~
   1 warning generated.


vim +191 kernel/unwind/user.c

   173	
   174	int unwind_user_deferred(struct unwind_callback *callback, u64 *ctx_cookie, void *data)
   175	{
   176		u64 cookie = current->unwind_ctx_cookie;
   177	
   178		if (WARN_ON_ONCE(in_nmi() || !irqs_disabled()))
   179			return -EINVAL;
   180	
   181		if (WARN_ON_ONCE(!callback->func || callback->idx < 0))
   182			return -EINVAL;
   183	
   184		if (!cookie) {
   185			u64 cpu = smp_processor_id();
   186	
   187			BUILD_BUG_ON(NR_CPUS > 65535);
   188	
   189			cookie = __this_cpu_read(ctx_ctr);
   190			cookie++;
 > 191			cookie &= (1UL << 48) - 1;
   192			cookie |= cpu << 48;
   193			__this_cpu_write(ctx_ctr, cookie);
   194	
   195			current->unwind_ctx_cookie = cookie;
   196			task_work_add(current, &current->unwind_work, TWA_RESUME);
   197		}
   198	
   199		if (ctx_cookie)
   200			*ctx_cookie = cookie;
   201	
   202		current->unwind_pending |= (1 << callback->idx);
   203		current->unwind_privs[callback->idx] = data;
   204	
   205		return 0;
   206	}
   207	

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

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

only message in thread, other threads:[~2024-10-21  8:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-21  8:57 [jpoimboe:sframe-2.2 5/9] kernel/unwind/user.c:191:18: 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