The return value of vmx_leave_smm() is unrelated from that of
nested_vmx_enter_non_root_mode(). Check explicitly for success
(which happens to be 0) and return 1 just like everywhere
else in vmx_leave_smm().
Likewise, in svm_leave_smm() return 0/1 instead of the 0/1/-errno
returned by tenter_svm_guest_mode().
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
if (nested_svm_check_cached_vmcb12(vcpu) < 0)
goto unmap_save;
- ret = enter_svm_guest_mode(vcpu, smram64->svm_guest_vmcb_gpa, vmcb12, false);
-
- if (ret)
+ if (enter_svm_guest_mode(vcpu, smram64->svm_guest_vmcb_gpa,
+ vmcb12, false) != 0)
goto unmap_save;
+ ret = 0;
svm->nested.nested_run_pending = 1;
unmap_save:
return 1;
ret = nested_vmx_enter_non_root_mode(vcpu, false);
- if (ret)
- return ret;
+ if (ret != NVMX_VMENTRY_SUCCESS)
+ return 1;
vmx->nested.nested_run_pending = 1;
vmx->nested.smm.guest_mode = false;