[linux-next:master 14650/16300] arch/riscv/kernel/kernel_mode_vector.c:27:13: sparse: sparse: cast removes address space '__rcu' of expression

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   5453bc3279e9f8578ac3e534d476240e40c879e1
commit: b5060a4aa33d7d78a8c1837ab08ef0c81ea96650 [14650/16300] RISC-V: KVM: fix vcpu vector context handling for kernel-mode vector
config: riscv-randconfig-r131-20260819 (https://download.01.org/0day-ci/archive/20260819/[email protected]/config)
compiler: riscv64-linux-gcc (GCC) 16.1.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260819/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)
   WARNING: invalid argument to '-march': '_zacas_zabha'
>> arch/riscv/kernel/kernel_mode_vector.c:27:13: sparse: sparse: cast removes address space '__rcu' of expression
>> arch/riscv/kernel/kernel_mode_vector.c:27:13: sparse: sparse: incompatible types in comparison expression (different address spaces):
   arch/riscv/kernel/kernel_mode_vector.c:27:13: sparse:    void ( [noderef] __rcu * )( ... )
   arch/riscv/kernel/kernel_mode_vector.c:27:13: sparse:    void ( * )( ... )
   arch/riscv/kernel/kernel_mode_vector.c:30:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
   arch/riscv/kernel/kernel_mode_vector.c:30:9: sparse:    void ( [noderef] __rcu * )( ... )
   arch/riscv/kernel/kernel_mode_vector.c:30:9: sparse:    void ( * )( ... )
   arch/riscv/kernel/kernel_mode_vector.c:36:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
   arch/riscv/kernel/kernel_mode_vector.c:36:9: sparse:    void ( [noderef] __rcu * )( ... )
   arch/riscv/kernel/kernel_mode_vector.c:36:9: sparse:    void ( * )( ... )
   arch/riscv/kernel/kernel_mode_vector.c:111:41: sparse: sparse: cast removes address space '__rcu' of expression
   arch/riscv/kernel/kernel_mode_vector.c:111:41: sparse: sparse: incompatible types in comparison expression (different address spaces):
   arch/riscv/kernel/kernel_mode_vector.c:111:41: sparse:    void ( [noderef] __rcu * )( ... )
   arch/riscv/kernel/kernel_mode_vector.c:111:41: sparse:    void ( * )( ... )

vim +/__rcu +27 arch/riscv/kernel/kernel_mode_vector.c

    24	
    25	void kvm_riscv_register_vctx_callback(void (*func)(void))
    26	{
  > 27		if (WARN_ON_ONCE(rcu_access_pointer(kvm_flush_vector_ctx_callback)))
    28			return;
    29	
    30		rcu_assign_pointer(kvm_flush_vector_ctx_callback, func);
    31	}
    32	EXPORT_SYMBOL_GPL(kvm_riscv_register_vctx_callback);
    33	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.