llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] KVM: SEV: Enforce minimum GHCB version requirement for SEV-SNP guests
       [not found] <20250711045408.95129-1-nikunj@amd.com>
@ 2025-07-11 21:42 ` kernel test robot
  2025-07-13 14:33   ` Nikunj A Dadhania
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2025-07-11 21:42 UTC (permalink / raw)
  To: Nikunj A Dadhania, seanjc, pbonzini, kvm
  Cc: llvm, oe-kbuild-all, thomas.lendacky, santosh.shukla, bp, nikunj,
	Michael Roth, stable

Hi Nikunj,

kernel test robot noticed the following build errors:

[auto build test ERROR on kvm/queue]
[also build test ERROR on kvm/next linus/master v6.16-rc5 next-20250711]
[cannot apply to kvm/linux-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Nikunj-A-Dadhania/KVM-SEV-Enforce-minimum-GHCB-version-requirement-for-SEV-SNP-guests/20250711-125527
base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
patch link:    https://lore.kernel.org/r/20250711045408.95129-1-nikunj%40amd.com
patch subject: [PATCH] KVM: SEV: Enforce minimum GHCB version requirement for SEV-SNP guests
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250712/202507120551.iDEiTBBN-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250712/202507120551.iDEiTBBN-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/202507120551.iDEiTBBN-lkp@intel.com/

All errors (new ones prefixed by >>):

>> arch/x86/kvm/svm/sev.c:426:6: error: use of undeclared identifier 'snp_active'
     426 |         if (snp_active && data->ghcb_version && data->ghcb_version < 2)
         |             ^
   1 error generated.


vim +/snp_active +426 arch/x86/kvm/svm/sev.c

   400	
   401	static int __sev_guest_init(struct kvm *kvm, struct kvm_sev_cmd *argp,
   402				    struct kvm_sev_init *data,
   403				    unsigned long vm_type)
   404	{
   405		struct kvm_sev_info *sev = to_kvm_sev_info(kvm);
   406		struct sev_platform_init_args init_args = {0};
   407		bool es_active = vm_type != KVM_X86_SEV_VM;
   408		u64 valid_vmsa_features = es_active ? sev_supported_vmsa_features : 0;
   409		int ret;
   410	
   411		if (kvm->created_vcpus)
   412			return -EINVAL;
   413	
   414		if (data->flags)
   415			return -EINVAL;
   416	
   417		if (data->vmsa_features & ~valid_vmsa_features)
   418			return -EINVAL;
   419	
   420		if (data->ghcb_version > GHCB_VERSION_MAX || (!es_active && data->ghcb_version))
   421			return -EINVAL;
   422	
   423		if (unlikely(sev->active))
   424			return -EINVAL;
   425	
 > 426		if (snp_active && data->ghcb_version && data->ghcb_version < 2)
   427			return -EINVAL;
   428	
   429		sev->active = true;
   430		sev->es_active = es_active;
   431		sev->vmsa_features = data->vmsa_features;
   432		sev->ghcb_version = data->ghcb_version;
   433	
   434		/*
   435		 * Currently KVM supports the full range of mandatory features defined
   436		 * by version 2 of the GHCB protocol, so default to that for SEV-ES
   437		 * guests created via KVM_SEV_INIT2.
   438		 */
   439		if (sev->es_active && !sev->ghcb_version)
   440			sev->ghcb_version = GHCB_VERSION_DEFAULT;
   441	
   442		if (vm_type == KVM_X86_SNP_VM)
   443			sev->vmsa_features |= SVM_SEV_FEAT_SNP_ACTIVE;
   444	
   445		ret = sev_asid_new(sev);
   446		if (ret)
   447			goto e_no_asid;
   448	
   449		init_args.probe = false;
   450		ret = sev_platform_init(&init_args);
   451		if (ret)
   452			goto e_free;
   453	
   454		/* This needs to happen after SEV/SNP firmware initialization. */
   455		if (vm_type == KVM_X86_SNP_VM) {
   456			ret = snp_guest_req_init(kvm);
   457			if (ret)
   458				goto e_free;
   459		}
   460	
   461		INIT_LIST_HEAD(&sev->regions_list);
   462		INIT_LIST_HEAD(&sev->mirror_vms);
   463		sev->need_init = false;
   464	
   465		kvm_set_apicv_inhibit(kvm, APICV_INHIBIT_REASON_SEV);
   466	
   467		return 0;
   468	
   469	e_free:
   470		argp->error = init_args.error;
   471		sev_asid_free(sev);
   472		sev->asid = 0;
   473	e_no_asid:
   474		sev->vmsa_features = 0;
   475		sev->es_active = false;
   476		sev->active = false;
   477		return ret;
   478	}
   479	

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: SEV: Enforce minimum GHCB version requirement for SEV-SNP guests
  2025-07-11 21:42 ` [PATCH] KVM: SEV: Enforce minimum GHCB version requirement for SEV-SNP guests kernel test robot
@ 2025-07-13 14:33   ` Nikunj A Dadhania
  0 siblings, 0 replies; 2+ messages in thread
From: Nikunj A Dadhania @ 2025-07-13 14:33 UTC (permalink / raw)
  To: kernel test robot, seanjc, pbonzini, kvm
  Cc: llvm, oe-kbuild-all, thomas.lendacky, santosh.shukla, bp,
	Michael Roth, stable

kernel test robot <lkp@intel.com> writes:

> Hi Nikunj,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on kvm/queue]
> [also build test ERROR on kvm/next linus/master v6.16-rc5 next-20250711]
> [cannot apply to kvm/linux-next]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url:    https://github.com/intel-lab-lkp/linux/commits/Nikunj-A-Dadhania/KVM-SEV-Enforce-minimum-GHCB-version-requirement-for-SEV-SNP-guests/20250711-125527
> base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
> patch link:    https://lore.kernel.org/r/20250711045408.95129-1-nikunj%40amd.com
> patch subject: [PATCH] KVM: SEV: Enforce minimum GHCB version requirement for SEV-SNP guests
> config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250712/202507120551.iDEiTBBN-lkp@intel.com/config)
> compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
> rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250712/202507120551.iDEiTBBN-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/202507120551.iDEiTBBN-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
>>> arch/x86/kvm/svm/sev.c:426:6: error: use of undeclared identifier 'snp_active'
>      426 |         if (snp_active && data->ghcb_version && data->ghcb_version < 2)
>          |             ^
>    1 error generated.

This was on top of SecureTSC hos patches that is having the change, will
sent v2 without this dependency.

Regards
Nikunj

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-13 14:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20250711045408.95129-1-nikunj@amd.com>
2025-07-11 21:42 ` [PATCH] KVM: SEV: Enforce minimum GHCB version requirement for SEV-SNP guests kernel test robot
2025-07-13 14:33   ` Nikunj A Dadhania

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).