kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [kvm:queue 14/30] arch/x86/kvm/vmx/tdx.c:3167:28: error: implicit declaration of function 'kvm_gmem_populate'; did you mean 'vmemmap_populate'?
@ 2025-06-13 23:52 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-06-13 23:52 UTC (permalink / raw)
  To: Fuad Tabba
  Cc: oe-kbuild-all, kvm, Farrah Chen, Paolo Bonzini, Ira Weiny,
	Gavin Shan, Shivank Garg, Vlastimil Babka, David Hildenbrand

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: ec772b9375ae2bb6b4bd0442c0b396f9f5440882 [14/30] KVM: Rename CONFIG_KVM_GENERIC_PRIVATE_MEM to CONFIG_KVM_GENERIC_GMEM_POPULATE
config: x86_64-buildonly-randconfig-003-20250614 (https://download.01.org/0day-ci/archive/20250614/202506140732.sMHshe1f-lkp@intel.com/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/202506140732.sMHshe1f-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506140732.sMHshe1f-lkp@intel.com/

All errors (new ones prefixed by >>):

   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 +3167 arch/x86/kvm/vmx/tdx.c

c846b451d3c5d4b Isaku Yamahata 2024-11-12  3122  
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3123  static int tdx_vcpu_init_mem_region(struct kvm_vcpu *vcpu, struct kvm_tdx_cmd *cmd)
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3124  {
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3125  	struct vcpu_tdx *tdx = to_tdx(vcpu);
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3126  	struct kvm *kvm = vcpu->kvm;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3127  	struct kvm_tdx *kvm_tdx = to_kvm_tdx(kvm);
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3128  	struct kvm_tdx_init_mem_region region;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3129  	struct tdx_gmem_post_populate_arg arg;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3130  	long gmem_ret;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3131  	int ret;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3132  
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3133  	if (tdx->state != VCPU_TD_STATE_INITIALIZED)
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3134  		return -EINVAL;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3135  
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3136  	guard(mutex)(&kvm->slots_lock);
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3137  
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3138  	/* Once TD is finalized, the initial guest memory is fixed. */
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3139  	if (kvm_tdx->state == TD_STATE_RUNNABLE)
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3140  		return -EINVAL;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3141  
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3142  	if (cmd->flags & ~KVM_TDX_MEASURE_MEMORY_REGION)
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3143  		return -EINVAL;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3144  
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3145  	if (copy_from_user(&region, u64_to_user_ptr(cmd->data), sizeof(region)))
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3146  		return -EFAULT;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3147  
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3148  	if (!PAGE_ALIGNED(region.source_addr) || !PAGE_ALIGNED(region.gpa) ||
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3149  	    !region.nr_pages ||
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3150  	    region.gpa + (region.nr_pages << PAGE_SHIFT) <= region.gpa ||
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3151  	    !vt_is_tdx_private_gpa(kvm, region.gpa) ||
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3152  	    !vt_is_tdx_private_gpa(kvm, region.gpa + (region.nr_pages << PAGE_SHIFT) - 1))
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3153  		return -EINVAL;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3154  
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3155  	kvm_mmu_reload(vcpu);
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3156  	ret = 0;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3157  	while (region.nr_pages) {
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3158  		if (signal_pending(current)) {
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3159  			ret = -EINTR;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3160  			break;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3161  		}
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3162  
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3163  		arg = (struct tdx_gmem_post_populate_arg) {
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3164  			.vcpu = vcpu,
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3165  			.flags = cmd->flags,
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3166  		};
c846b451d3c5d4b Isaku Yamahata 2024-11-12 @3167  		gmem_ret = kvm_gmem_populate(kvm, gpa_to_gfn(region.gpa),
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3168  					     u64_to_user_ptr(region.source_addr),
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3169  					     1, tdx_gmem_post_populate, &arg);
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3170  		if (gmem_ret < 0) {
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3171  			ret = gmem_ret;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3172  			break;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3173  		}
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3174  
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3175  		if (gmem_ret != 1) {
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3176  			ret = -EIO;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3177  			break;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3178  		}
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3179  
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3180  		region.source_addr += PAGE_SIZE;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3181  		region.gpa += PAGE_SIZE;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3182  		region.nr_pages--;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3183  
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3184  		cond_resched();
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3185  	}
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3186  
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3187  	if (copy_to_user(u64_to_user_ptr(cmd->data), &region, sizeof(region)))
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3188  		ret = -EFAULT;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3189  	return ret;
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3190  }
c846b451d3c5d4b Isaku Yamahata 2024-11-12  3191  

:::::: The code at line 3167 was first introduced by commit
:::::: c846b451d3c5d4ba304bbeeaf7aa9a04bb432408 KVM: TDX: Add an ioctl to create initial guest memory

:::::: TO: Isaku Yamahata <isaku.yamahata@intel.com>
:::::: CC: Paolo Bonzini <pbonzini@redhat.com>

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-06-13 23:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-13 23:52 [kvm:queue 14/30] arch/x86/kvm/vmx/tdx.c:3167:28: error: implicit declaration of function 'kvm_gmem_populate'; did you mean 'vmemmap_populate'? kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).