Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [jpoimboe:sframe-2.2 5/9] kernel/unwind/user.c:191:18: warning: shift count >= width of type
Date: Mon, 21 Oct 2024 16:57:19 +0800	[thread overview]
Message-ID: <202410211608.b342Ychx-lkp@intel.com> (raw)

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

                 reply	other threads:[~2024-10-21  8:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202410211608.b342Ychx-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jpoimboe@kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox