File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -2203,12 +2203,6 @@ static int shutdown_interception(struct kvm_vcpu *vcpu)
2203
2203
struct kvm_run * kvm_run = vcpu -> run ;
2204
2204
struct vcpu_svm * svm = to_svm (vcpu );
2205
2205
2206
- /*
2207
- * The VM save area has already been encrypted so it
2208
- * cannot be reinitialized - just terminate.
2209
- */
2210
- if (sev_es_guest (vcpu -> kvm ))
2211
- return - EINVAL ;
2212
2206
2213
2207
/*
2214
2208
* VMCB is undefined after a SHUTDOWN intercept. INIT the vCPU to put
@@ -2217,9 +2211,14 @@ static int shutdown_interception(struct kvm_vcpu *vcpu)
2217
2211
* userspace. At a platform view, INIT is acceptable behavior as
2218
2212
* there exist bare metal platforms that automatically INIT the CPU
2219
2213
* in response to shutdown.
2214
+ *
2215
+ * The VM save area for SEV-ES guests has already been encrypted so it
2216
+ * cannot be reinitialized, i.e. synthesizing INIT is futile.
2220
2217
*/
2221
- clear_page (svm -> vmcb );
2222
- kvm_vcpu_reset (vcpu , true);
2218
+ if (!sev_es_guest (vcpu -> kvm )) {
2219
+ clear_page (svm -> vmcb );
2220
+ kvm_vcpu_reset (vcpu , true);
2221
+ }
2223
2222
2224
2223
kvm_run -> exit_reason = KVM_EXIT_SHUTDOWN ;
2225
2224
return 0 ;
You can’t perform that action at this time.
0 commit comments