arch/riscv/kvm/vcpu_vector.c:102:19: error: incompatible pointer types initializing 'struct kvm_vcpu *' with an expression of type 'typeof_unqual (*(kvm_get_running_vcpus()))' (aka 'struct kvm_vcpu_common *')
kernel test robot
build bottree: git://git.infradead.org/users/dwmw2/linux vsm2/vsm-min head: 73f14216b586db8fb3211410b88fbcdff5a96c0a commit: 75bb49aa924fb9151f7e1fe441ff0eafbc996dae [14/123] kvm: Make kvm_running_vcpus point to struct kvm_vcpu_common config: riscv-allyesconfig (https://download.01.org/0day-ci/archive/20261111/[email protected]/config) compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project e73e336290028f26553b46c9fba844c13da38c9c) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261111/[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]/
All errors (new ones prefixed by >>):
>> arch/riscv/kvm/vcpu_vector.c:102:19: error: incompatible pointer types initializing 'struct kvm_vcpu *' with an expression of type 'typeof_unqual (*(kvm_get_running_vcpus()))' (aka 'struct kvm_vcpu_common *') [-Wincompatible-pointer-types]
102 | struct kvm_vcpu *vcpu = *this_cpu_ptr(kvm_get_running_vcpus());
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1 error generated.
vim +102 arch/riscv/kvm/vcpu_vector.c
b5060a4aa33d7d Andy Chiu 2026-08-03 99
b5060a4aa33d7d Andy Chiu 2026-08-03 100 void kvm_riscv_vcpu_flush_vector(void)
b5060a4aa33d7d Andy Chiu 2026-08-03 101 {
b5060a4aa33d7d Andy Chiu 2026-08-03 @102 struct kvm_vcpu *vcpu = *this_cpu_ptr(kvm_get_running_vcpus());
b5060a4aa33d7d Andy Chiu 2026-08-03 103
b5060a4aa33d7d Andy Chiu 2026-08-03 104 /*
b5060a4aa33d7d Andy Chiu 2026-08-03 105 * Only reached from __riscv_flush_vector_context() when RISCV_V_VCPU_CTX is set, which
b5060a4aa33d7d Andy Chiu 2026-08-03 106 * always have kvm_get_running_vcpus non-NULL.
b5060a4aa33d7d Andy Chiu 2026-08-03 107 */
b5060a4aa33d7d Andy Chiu 2026-08-03 108 if (WARN_ON_ONCE(!vcpu))
b5060a4aa33d7d Andy Chiu 2026-08-03 109 return;
b5060a4aa33d7d Andy Chiu 2026-08-03 110
b5060a4aa33d7d Andy Chiu 2026-08-03 111 kvm_riscv_vcpu_guest_vector_save(&vcpu->arch.guest_context, vcpu->arch.isa);
b5060a4aa33d7d Andy Chiu 2026-08-03 112
b5060a4aa33d7d Andy Chiu 2026-08-03 113 if ((vcpu->arch.guest_context.sstatus & SR_VS) != SR_VS_OFF)
b5060a4aa33d7d Andy Chiu 2026-08-03 114 riscv_v_flags_set(riscv_v_flags() | RISCV_V_VCPU_NEED_RESTORE);
b5060a4aa33d7d Andy Chiu 2026-08-03 115 }
b5060a4aa33d7d Andy Chiu 2026-08-03 116 :::::: The code at line 102 was first introduced by commit
:::::: b5060a4aa33d7d78a8c1837ab08ef0c81ea96650 RISC-V: KVM: fix vcpu vector context handling for kernel-mode vector
:::::: TO: Andy Chiu <[email protected]>
:::::: CC: Anup Patel <[email protected]>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki