]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: SEV: Move init of SNP guest state into sev_init_vmcb()
authorSean Christopherson <seanjc@google.com>
Tue, 19 Aug 2025 23:48:30 +0000 (16:48 -0700)
committerSean Christopherson <seanjc@google.com>
Thu, 21 Aug 2025 15:44:49 +0000 (08:44 -0700)
commit3d4e882e3439593b406fa226bcdd48c92d2222a6
treea1fe4f8feff5e9e0c2428557c5b3f1bd50e497da
parent34bd82aab15b8b9e8e9d923267283c84aa8c2789
KVM: SEV: Move init of SNP guest state into sev_init_vmcb()

Move the initialization of SNP guest state from svm_vcpu_reset() into
sev_init_vmcb() to reduce the number of paths that deal with INIT/RESET
for SEV+ vCPUs from 4+ to 1.  Plumb in @init_event as necessary.

Opportunistically check for an SNP guest outside of
sev_snp_init_protected_guest_state() so that sev_init_vmcb() is consistent
with respect to checking for SEV-ES+ and SNP+ guests.

No functional change intended.

Reviewed-by: Nikunj A Dadhania <nikunj@amd.com>
Link: https://lore.kernel.org/r/20250819234833.3080255-6-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/sev.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/svm/svm.h