Re: [linuxppc:merge-test 6/19] arch/powerpc/kvm/powerpc.c:262:19: error: dereferencing pointer to incomplete type 'struct kvmppc_vcore'

Amit Machhiwal <[email protected]> Tue, 4 Aug 2026 16:07:06 +0530
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
On 2026/08/03 06:26 AM, kernel test robot wrote:
> tree:   https://github.com/linuxppc/linux merge-test
> head:   f5ee8a918bf98d0bb46b91ffbb4283a64f17c3fd
> commit: a7452640914469676b5fcffee80ee045525bddb8 [6/19] KVM: PPC: Book3S HV: Validate arch_compat against host compatibility mode
> config: powerpc64-randconfig-002-20260803 (https://download.01.org/0day-ci/archive/20260803/[email protected]/config)
> compiler: powerpc64-linux-gcc (GCC) 8.5.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260803/[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/powerpc/kvm/powerpc.c: In function 'kvmppc_sanity_check':
> >> arch/powerpc/kvm/powerpc.c:262:19: error: dereferencing pointer to incomplete type 'struct kvmppc_vcore'
>       vcpu->arch.vcore->arch_compat == PVR_ARCH_INVALID)
>                       ^~

Looks like the branch has an older version of the patch applied. I
checked the powerpc64-randconfig-002-20260803 config which has below KVM
configs enabled.

  CONFIG_KVM_GUEST=y
  CONFIG_KVM_COMMON=y
  CONFIG_KVM_MMIO=y
  CONFIG_KVM_VFIO=y
  CONFIG_KVM_COMPAT=y
  CONFIG_HAVE_KVM_IRQ_BYPASS=y
  CONFIG_KVM=y
  CONFIG_KVM_BOOKE_HV=y
  # CONFIG_KVM_EXIT_TIMING is not set
  CONFIG_KVM_E500MC=y
  # CONFIG_KVM_MPIC is not set

The v5 of patch already gates the reported block inside
CONFIG_KVM_BOOK3S_HV_POSSIBLE which will avoid such build failures.

v5: https://lore.kernel.org/all/[email protected]/

@Maddy, could you please pick the latest version which was sent on Jul
14.

Thanks,
Amit

> 
> 
> vim +262 arch/powerpc/kvm/powerpc.c
> 
>    252	
>    253	int kvmppc_sanity_check(struct kvm_vcpu *vcpu)
>    254	{
>    255		int r = false;
>    256	
>    257		/* We have to know what CPU to virtualize */
>    258		if (!vcpu->arch.pvr)
>    259			goto out;
>    260	
>    261		if (vcpu->arch.vcore &&
>  > 262			vcpu->arch.vcore->arch_compat == PVR_ARCH_INVALID)
>    263			goto out;
>    264	
>    265		/* PAPR only works with book3s_64 */
>    266		if ((vcpu->arch.cpu_type != KVM_CPU_3S_64) && vcpu->arch.papr_enabled)
>    267			goto out;
>    268	
>    269		/* HV KVM can only do PAPR mode for now */
>    270		if (!vcpu->arch.papr_enabled && is_kvmppc_hv_enabled(vcpu->kvm))
>    271			goto out;
>    272	
> 
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki