arch/riscv/kvm/vcpu_config.c:81:17: sparse: sparse: incorrect type in assignment (different base types)
From: kernel test robot
Date: Tue May 05 2026 - 15:06:44 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a293ec25d59dd96309058c70df5a4dd0f889a1e4
commit: 6ed523e2b6129d7dd4aab801a610930d85b2d3f8 RISC-V: KVM: Factor-out VCPU config into separate sources
date: 5 weeks ago
config: riscv-randconfig-r111-20260505 (https://download.01.org/0day-ci/archive/20260506/202605060232.PcNtMxLY-lkp@xxxxxxxxx/config)
compiler: riscv64-linux-gcc (GCC) 8.5.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260506/202605060232.PcNtMxLY-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
| Fixes: 6ed523e2b612 ("RISC-V: KVM: Factor-out VCPU config into separate sources")
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605060232.PcNtMxLY-lkp@xxxxxxxxx/
sparse warnings: (new ones prefixed by >>)
>> arch/riscv/kvm/vcpu_config.c:81:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long @@ got restricted __le64 [usertype] @@
arch/riscv/kvm/vcpu_config.c:81:17: sparse: expected unsigned long
arch/riscv/kvm/vcpu_config.c:81:17: sparse: got restricted __le64 [usertype]
arch/riscv/kvm/vcpu_config.c:82:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long @@ got restricted __le64 [usertype] @@
arch/riscv/kvm/vcpu_config.c:82:17: sparse: expected unsigned long
arch/riscv/kvm/vcpu_config.c:82:17: sparse: got restricted __le64 [usertype]
arch/riscv/kvm/vcpu_config.c:83:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long @@ got restricted __le64 [usertype] @@
arch/riscv/kvm/vcpu_config.c:83:17: sparse: expected unsigned long
arch/riscv/kvm/vcpu_config.c:83:17: sparse: got restricted __le64 [usertype]
arch/riscv/kvm/vcpu_config.c:85:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long @@ got restricted __le64 [usertype] @@
arch/riscv/kvm/vcpu_config.c:85:25: sparse: expected unsigned long
arch/riscv/kvm/vcpu_config.c:85:25: sparse: got restricted __le64 [usertype]
arch/riscv/kvm/vcpu_config.c:87:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long @@ got restricted __le64 [usertype] @@
arch/riscv/kvm/vcpu_config.c:87:25: sparse: expected unsigned long
arch/riscv/kvm/vcpu_config.c:87:25: sparse: got restricted __le64 [usertype]
arch/riscv/kvm/vcpu_config.c:89:33: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long @@ got restricted __le64 [usertype] @@
arch/riscv/kvm/vcpu_config.c:89:33: sparse: expected unsigned long
arch/riscv/kvm/vcpu_config.c:89:33: sparse: got restricted __le64 [usertype]
vim +81 arch/riscv/kvm/vcpu_config.c
73
74 void kvm_riscv_vcpu_config_load(struct kvm_vcpu *vcpu)
75 {
76 struct kvm_vcpu_config *cfg = &vcpu->arch.cfg;
77 void *nsh;
78
79 if (kvm_riscv_nacl_sync_csr_available()) {
80 nsh = nacl_shmem();
> 81 nacl_csr_write(nsh, CSR_HEDELEG, cfg->hedeleg);
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki