[kvm:queue 16/30] arch/x86/kvm/vmx/tdx.c:627:18: error: 'struct kvm_arch' has no member named 'has_private_mem'

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

 



Hi Fuad,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
head:   79150772457f4d45e38b842d786240c36bb1f97f
commit: 7221fa63c070975edd88fa684e191cda37bf6c28 [16/30] KVM: x86: Rename kvm->arch.has_private_mem to kvm->arch.supports_gmem
config: x86_64-buildonly-randconfig-003-20250614 (https://download.01.org/0day-ci/archive/20250614/202506140800.swbOU0sS-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250614/202506140800.swbOU0sS-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/202506140800.swbOU0sS-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

   arch/x86/kvm/vmx/tdx.c: In function 'tdx_vm_init':
>> arch/x86/kvm/vmx/tdx.c:627:18: error: 'struct kvm_arch' has no member named 'has_private_mem'
     627 |         kvm->arch.has_private_mem = true;
         |                  ^
   arch/x86/kvm/vmx/tdx.c: In function 'tdx_vcpu_init_mem_region':
   arch/x86/kvm/vmx/tdx.c:3167:28: error: implicit declaration of function 'kvm_gmem_populate'; did you mean 'vmemmap_populate'? [-Werror=implicit-function-declaration]
    3167 |                 gmem_ret = kvm_gmem_populate(kvm, gpa_to_gfn(region.gpa),
         |                            ^~~~~~~~~~~~~~~~~
         |                            vmemmap_populate
   cc1: some warnings being treated as errors


vim +627 arch/x86/kvm/vmx/tdx.c

8d032b683c29930 Isaku Yamahata 2025-02-25  621  
8d032b683c29930 Isaku Yamahata 2025-02-25  622  int tdx_vm_init(struct kvm *kvm)
8d032b683c29930 Isaku Yamahata 2025-02-25  623  {
0186dd29a251866 Isaku Yamahata 2025-01-14  624  	struct kvm_tdx *kvm_tdx = to_kvm_tdx(kvm);
0186dd29a251866 Isaku Yamahata 2025-01-14  625  
8d032b683c29930 Isaku Yamahata 2025-02-25  626  	kvm->arch.has_protected_state = true;
8d032b683c29930 Isaku Yamahata 2025-02-25 @627  	kvm->arch.has_private_mem = true;
90fe64a94d54757 Yan Zhao       2025-02-24  628  	kvm->arch.disabled_quirks |= KVM_X86_QUIRK_IGNORE_GUEST_PAT;
8d032b683c29930 Isaku Yamahata 2025-02-25  629  
7d10ffb1acac2c1 Isaku Yamahata 2024-11-12  630  	/*
7d10ffb1acac2c1 Isaku Yamahata 2024-11-12  631  	 * Because guest TD is protected, VMM can't parse the instruction in TD.
7d10ffb1acac2c1 Isaku Yamahata 2024-11-12  632  	 * Instead, guest uses MMIO hypercall.  For unmodified device driver,
7d10ffb1acac2c1 Isaku Yamahata 2024-11-12  633  	 * #VE needs to be injected for MMIO and #VE handler in TD converts MMIO
7d10ffb1acac2c1 Isaku Yamahata 2024-11-12  634  	 * instruction into MMIO hypercall.
7d10ffb1acac2c1 Isaku Yamahata 2024-11-12  635  	 *
7d10ffb1acac2c1 Isaku Yamahata 2024-11-12  636  	 * SPTE value for MMIO needs to be setup so that #VE is injected into
7d10ffb1acac2c1 Isaku Yamahata 2024-11-12  637  	 * TD instead of triggering EPT MISCONFIG.
7d10ffb1acac2c1 Isaku Yamahata 2024-11-12  638  	 * - RWX=0 so that EPT violation is triggered.
7d10ffb1acac2c1 Isaku Yamahata 2024-11-12  639  	 * - suppress #VE bit is cleared to inject #VE.
7d10ffb1acac2c1 Isaku Yamahata 2024-11-12  640  	 */
7d10ffb1acac2c1 Isaku Yamahata 2024-11-12  641  	kvm_mmu_set_mmio_spte_value(kvm, 0);
7d10ffb1acac2c1 Isaku Yamahata 2024-11-12  642  
f94f4a97e66543b Isaku Yamahata 2024-10-30  643  	/*
f94f4a97e66543b Isaku Yamahata 2024-10-30  644  	 * TDX has its own limit of maximum vCPUs it can support for all
f94f4a97e66543b Isaku Yamahata 2024-10-30  645  	 * TDX guests in addition to KVM_MAX_VCPUS.  TDX module reports
f94f4a97e66543b Isaku Yamahata 2024-10-30  646  	 * such limit via the MAX_VCPU_PER_TD global metadata.  In
f94f4a97e66543b Isaku Yamahata 2024-10-30  647  	 * practice, it reflects the number of logical CPUs that ALL
f94f4a97e66543b Isaku Yamahata 2024-10-30  648  	 * platforms that the TDX module supports can possibly have.
f94f4a97e66543b Isaku Yamahata 2024-10-30  649  	 *
f94f4a97e66543b Isaku Yamahata 2024-10-30  650  	 * Limit TDX guest's maximum vCPUs to the number of logical CPUs
f94f4a97e66543b Isaku Yamahata 2024-10-30  651  	 * the platform has.  Simply forwarding the MAX_VCPU_PER_TD to
f94f4a97e66543b Isaku Yamahata 2024-10-30  652  	 * userspace would result in an unpredictable ABI.
f94f4a97e66543b Isaku Yamahata 2024-10-30  653  	 */
f94f4a97e66543b Isaku Yamahata 2024-10-30  654  	kvm->max_vcpus = min_t(int, kvm->max_vcpus, num_present_cpus());
f94f4a97e66543b Isaku Yamahata 2024-10-30  655  
0186dd29a251866 Isaku Yamahata 2025-01-14  656  	kvm_tdx->state = TD_STATE_UNINITIALIZED;
0186dd29a251866 Isaku Yamahata 2025-01-14  657  
0186dd29a251866 Isaku Yamahata 2025-01-14  658  	return 0;
8d032b683c29930 Isaku Yamahata 2025-02-25  659  }
8d032b683c29930 Isaku Yamahata 2025-02-25  660  

:::::: The code at line 627 was first introduced by commit
:::::: 8d032b683c299302aa8b5fbce17b9b87a138a5f5 KVM: TDX: create/destroy VM structure

:::::: TO: Isaku Yamahata <isaku.yamahata@xxxxxxxxx>
:::::: CC: Paolo Bonzini <pbonzini@xxxxxxxxxx>

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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux