Skip to content

Commit 8164a5f

Browse files
tlendackybonzini
authored andcommitted
KVM: SVM: Cannot re-initialize the VMCB after shutdown with SEV-ES
When a SHUTDOWN VMEXIT is encountered, normally the VMCB is re-initialized so that the guest can be re-launched. But when a guest is running as an SEV-ES guest, the VMSA cannot be re-initialized because it has been encrypted. For now, just return -EINVAL to prevent a possible attempt at a guest reset. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Message-Id: <aa6506000f6f3a574de8dbcdab0707df844cb00c.1607620209.git.thomas.lendacky@amd.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent bc624d9 commit 8164a5f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

arch/x86/kvm/svm/svm.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2010,6 +2010,13 @@ static int shutdown_interception(struct vcpu_svm *svm)
20102010
{
20112011
struct kvm_run *kvm_run = svm->vcpu.run;
20122012

2013+
/*
2014+
* The VM save area has already been encrypted so it
2015+
* cannot be reinitialized - just terminate.
2016+
*/
2017+
if (sev_es_guest(svm->vcpu.kvm))
2018+
return -EINVAL;
2019+
20132020
/*
20142021
* VMCB is undefined after a SHUTDOWN intercept
20152022
* so reinitialize it.

0 commit comments

Comments
 (0)