[agraf-2.6:kvm-kho-gmem-test 24/27] arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:6808:17: error: 'KVM_ARCH_FLAG_VM_COUNTER_OFFSET' undeclared; did you mean 'KVM_ARM_SET_COUNTER_OFFSET'?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://github.com/agraf/linux-2.6.git kvm-kho-gmem-test
head:   9a58862a298a63bad21d05191e28b857063bb9dc
commit: eac026594b9dc0e92a0093a3443b9bc973be99a4 [24/27] XXX WIP
config: powerpc-powernv_defconfig (https://download.01.org/0day-ci/archive/20240505/202405050557.AzQbDCw0-lkp@xxxxxxxxx/config)
compiler: powerpc64le-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240505/202405050557.AzQbDCw0-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/202405050557.AzQbDCw0-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

   In file included from include/linux/bug.h:5,
                    from arch/powerpc/include/asm/mmu.h:142,
                    from arch/powerpc/include/asm/paca.h:18,
                    from arch/powerpc/include/asm/current.h:13,
                    from include/linux/mutex.h:14,
                    from include/linux/kvm_types.h:23,
                    from include/kvm/iodev.h:6,
                    from arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:16:
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c: In function 'kvm_kho_write_vcpu':
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:4433:49: error: 'struct kvm_vcpu_arch' has no member named 'ctxt'
    4433 |                         .addr = __pa(&vcpu->arch.ctxt),
         |                                                 ^
   arch/powerpc/include/asm/bug.h:88:32: note: in definition of macro 'WARN_ON'
      88 |         int __ret_warn_on = !!(x);                              \
         |                                ^
   arch/powerpc/include/asm/page.h:217:9: note: in expansion of macro 'VIRTUAL_WARN_ON'
     217 |         VIRTUAL_WARN_ON((unsigned long)(x) < PAGE_OFFSET);              \
         |         ^~~~~~~~~~~~~~~
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:4433:33: note: in expansion of macro '__pa'
    4433 |                         .addr = __pa(&vcpu->arch.ctxt),
         |                                 ^~~~
   In file included from arch/powerpc/include/asm/mmu.h:144:
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:4433:49: error: 'struct kvm_vcpu_arch' has no member named 'ctxt'
    4433 |                         .addr = __pa(&vcpu->arch.ctxt),
         |                                                 ^
   arch/powerpc/include/asm/page.h:218:25: note: in definition of macro '__pa'
     218 |         (unsigned long)(x) & 0x0fffffffffffffffUL;                      \
         |                         ^
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:4434:49: error: 'struct kvm_vcpu_arch' has no member named 'ctxt'
    4434 |                         .len = sizeof(vcpu->arch.ctxt),
         |                                                 ^
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c: In function 'kvm_kho_write_vm':
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:4477:55: error: 'struct kvm_arch' has no member named 'timer_data'
    4477 |         ret |= fdt_property(fdt, "voffset", &kvm->arch.timer_data.voffset, sizeof(u64));
         |                                                       ^
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:4478:55: error: 'struct kvm_arch' has no member named 'timer_data'
    4478 |         ret |= fdt_property(fdt, "poffset", &kvm->arch.timer_data.poffset, sizeof(u64));
         |                                                       ^
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c: At top level:
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:4524:49: warning: 'struct kvm_s2_mmu' declared inside parameter list will not be visible outside of this definition or declaration
    4524 | int kvm_init_stage2_mmu(struct kvm *kvm, struct kvm_s2_mmu *mmu, unsigned long type);
         |                                                 ^~~~~~~~~~
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c: In function 'kvm_unwrap_file':
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:4552:58: error: 'struct kvm_arch' has no member named 'mmu'
    4552 |                 ret = kvm_init_stage2_mmu(kvm, &kvm->arch.mmu, 0);
         |                                                          ^
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c: In function 'kvm_wrap_vm':
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:4604:48: error: 'struct kvm_arch' has no member named 'mmu'
    4604 |         r = kvm_init_stage2_mmu(kvm, &kvm->arch.mmu, 0);
         |                                                ^
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c: In function 'kvm_kho_recover_vcpu':
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:6750:27: error: 'struct kvm_vcpu_arch' has no member named 'ctxt'
    6750 |         memcpy(&vcpu->arch.ctxt, old_ctxt, sizeof(*old_ctxt));
         |                           ^
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:6750:50: error: invalid application of 'sizeof' to incomplete type 'struct kvm_cpu_context'
    6750 |         memcpy(&vcpu->arch.ctxt, old_ctxt, sizeof(*old_ctxt));
         |                                                  ^
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c: In function 'kvm_kho_recover_vm':
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:6801:18: error: 'struct kvm_arch' has no member named 'timer_data'
    6801 |         kvm->arch.timer_data.poffset = *poffset;
         |                  ^
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:6806:18: error: 'struct kvm_arch' has no member named 'timer_data'
    6806 |         kvm->arch.timer_data.voffset = *voffset;
         |                  ^
>> arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:6808:17: error: 'KVM_ARCH_FLAG_VM_COUNTER_OFFSET' undeclared (first use in this function); did you mean 'KVM_ARM_SET_COUNTER_OFFSET'?
    6808 |         set_bit(KVM_ARCH_FLAG_VM_COUNTER_OFFSET, &kvm->arch.flags);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |                 KVM_ARM_SET_COUNTER_OFFSET
   arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:6808:17: note: each undeclared identifier is reported only once for each function it appears in
>> arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:6808:60: error: 'struct kvm_arch' has no member named 'flags'
    6808 |         set_bit(KVM_ARCH_FLAG_VM_COUNTER_OFFSET, &kvm->arch.flags);
         |                                                            ^


vim +6808 arch/powerpc/kvm/../../../virt/kvm/kvm_main.c

  6765	
  6766	static int kvm_kho_recover_vm(const void *fdt, int node)
  6767	{
  6768		int ret = 0;
  6769		int vcpu_off;
  6770		struct kvm *kvm = NULL;
  6771		struct file *file;
  6772		const struct kvm_memory_slot *slots;
  6773		const u64 *voffset, *poffset;
  6774		const ulong *handle;
  6775		int nr_slots;
  6776		int l, i;
  6777	
  6778		if (fdt_node_check_compatible(fdt, node, "kvm,vm-v1"))
  6779			return -EINVAL;
  6780	
  6781		handle = fdt_getprop(fdt, node, "handle", &l);
  6782		if (!handle || l != sizeof(ulong))
  6783			return -EINVAL;
  6784	
  6785		// XXX On aarch64, the type defines IPA size. Needs to recover from original
  6786		ret = kvm_dev.fops->unlocked_ioctl(NULL, KVM_CREATE_VM, 0);
  6787		if (ret < 0)
  6788			return ret;
  6789	
  6790		file = fget_raw(ret);
  6791		kvm = file->private_data;
  6792	
  6793		ret = close_fd(ret);
  6794		if (ret)
  6795			return ret;
  6796	
  6797		/* TODO: Should go into arch code */
  6798		poffset = fdt_getprop(fdt, node, "poffset", &l);
  6799		if (!poffset)
  6800			return -EINVAL;
  6801		kvm->arch.timer_data.poffset = *poffset;
  6802	
  6803		voffset = fdt_getprop(fdt, node, "voffset", &l);
  6804		if (!voffset)
  6805			return -EINVAL;
  6806		kvm->arch.timer_data.voffset = *voffset;
  6807	
> 6808		set_bit(KVM_ARCH_FLAG_VM_COUNTER_OFFSET, &kvm->arch.flags);
  6809	
  6810		/* Recover memslots */
  6811		slots = fdt_getprop(fdt, node, "slots", &l);
  6812		if (!slots)
  6813			return -EINVAL;
  6814	
  6815		nr_slots = l / sizeof(*slots);
  6816		for (i = 0; i < nr_slots; i++) {
  6817			const struct kvm_memory_slot *slot = &slots[i];
  6818			struct kvm_userspace_memory_region2 mem = {
  6819				.slot = slot->id,
  6820				.flags = slot->flags,
  6821				.guest_phys_addr = slot->base_gfn << PAGE_SHIFT,
  6822				.memory_size = slot->npages << PAGE_SHIFT,
  6823				.userspace_addr = slot->userspace_addr,
  6824				/* TODO: memfd */
  6825			};
  6826	
  6827			ret = kvm_set_memory_region(kvm, &mem);
  6828			if (ret)
  6829				return ret;
  6830		}
  6831	
  6832		/* Put it onto the fdbox dangling queue */
  6833		ret = fdbox_add_dangling(file, *handle);
  6834		if (ret)
  6835			return ret;
  6836	
  6837		fdt_for_each_subnode(vcpu_off, fdt, node) {
  6838			ret = kvm_kho_recover_vcpu(fdt, vcpu_off, kvm, file);
  6839			if (ret)
  6840				return ret;
  6841		}
  6842	
  6843		return ret;
  6844	}
  6845	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux