KVM: SEV: Init target VMCBs in sev_migrate_from
authorPeter Gonda <pgonda@google.com>
Thu, 23 Jun 2022 17:34:06 +0000 (10:34 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 24 Jun 2022 08:10:18 +0000 (04:10 -0400)
commit6defa24d3b12bbd418bc8526dea1cbc605265c06
treeee62722d600d3f8a2e94fefa741cb8bd0312edac
parentebdec859faa8cfbfef9f6c1f83d79dd6c8f4ab8c
KVM: SEV: Init target VMCBs in sev_migrate_from

The target VMCBs during an intra-host migration need to correctly setup
for running SEV and SEV-ES guests. Add sev_init_vmcb() function and make
sev_es_init_vmcb() static. sev_init_vmcb() uses the now private function
to init SEV-ES guests VMCBs when needed.

Fixes: 0b020f5af092 ("KVM: SEV: Add support for SEV-ES intra host migration")
Fixes: b56639318bb2 ("KVM: SEV: Add support for SEV intra host migration")
Signed-off-by: Peter Gonda <pgonda@google.com>
Cc: Marc Orr <marcorr@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Message-Id: <20220623173406.744645-1-pgonda@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/sev.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/svm/svm.h