arch/x86/include/asm/msr.h:132:9: sparse: sparse: cast truncates bits from constant value (1000000ff becomes ff)
From: kernel test robot
Date: Wed Mar 25 2026 - 06:47:07 EST
Hi Xin,
FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: bbeb83d3182abe0d245318e274e8531e5dd7a948
commit: 519be7da37b955164c59aacaee6d6ac89f4bbe15 x86/msr: Convert __wrmsr() uses to native_wrmsr{,q}() uses
date: 11 months ago
config: x86_64-randconfig-r122-20260325 (https://download.01.org/0day-ci/archive/20260325/202603251800.lgPYqV2b-lkp@xxxxxxxxx/config)
compiler: gcc-13 (Debian 13.3.0-16) 13.3.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260325/202603251800.lgPYqV2b-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603251800.lgPYqV2b-lkp@xxxxxxxxx/
sparse warnings: (new ones prefixed by >>)
arch/x86/events/intel/uncore_snb.c: note: in included file:
>> arch/x86/include/asm/msr.h:132:9: sparse: sparse: cast truncates bits from constant value (1000000ff becomes ff)
vim +132 arch/x86/include/asm/msr.h
125
126 /* Can be uninlined because referenced by paravirt */
127 static inline void notrace
128 native_write_msr(u32 msr, u32 low, u32 high)
129 {
130 u64 val = (u64)high << 32 | low;
131
> 132 native_wrmsrq(msr, val);
133
134 if (tracepoint_enabled(write_msr))
135 do_trace_write_msr(msr, val, 0);
136 }
137
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki