Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: x86: clarify leave_smm() return value

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>

+5 -5
+3 -3
arch/x86/kvm/svm/svm.c
··· 4884 4884 if (nested_svm_check_cached_vmcb12(vcpu) < 0) 4885 4885 goto unmap_save; 4886 4886 4887 - ret = enter_svm_guest_mode(vcpu, smram64->svm_guest_vmcb_gpa, vmcb12, false); 4888 - 4889 - if (ret) 4887 + if (enter_svm_guest_mode(vcpu, smram64->svm_guest_vmcb_gpa, 4888 + vmcb12, false) != 0) 4890 4889 goto unmap_save; 4891 4890 4891 + ret = 0; 4892 4892 svm->nested.nested_run_pending = 1; 4893 4893 4894 4894 unmap_save:
+2 -2
arch/x86/kvm/vmx/vmx.c
··· 8533 8533 return 1; 8534 8534 8535 8535 ret = nested_vmx_enter_non_root_mode(vcpu, false); 8536 - if (ret) 8537 - return ret; 8536 + if (ret != NVMX_VMENTRY_SUCCESS) 8537 + return 1; 8538 8538 8539 8539 vmx->nested.nested_run_pending = 1; 8540 8540 vmx->nested.smm.guest_mode = false;