]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
x86: KVM: svm: Fix a check in nested_svm_vmrun()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 27 Aug 2019 09:38:52 +0000 (12:38 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 11 Sep 2019 15:28:01 +0000 (17:28 +0200)
We refactored this code a bit and accidentally deleted the "-" character
from "-EINVAL".  The kvm_vcpu_map() function never returns positive
EINVAL.

Fixes: c8e16b78c614 ("x86: KVM: svm: eliminate hardcoded RIP advancement from vmrun_interception()")
Cc: stable@vger.kernel.org
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm.c

index fdeaf8f44949cb866b13dc2a41673f072e4f3f8d..2854aafc489e87e668851449c2d076f3bca8e7ed 100644 (file)
@@ -3598,7 +3598,7 @@ static int nested_svm_vmrun(struct vcpu_svm *svm)
        vmcb_gpa = svm->vmcb->save.rax;
 
        ret = kvm_vcpu_map(&svm->vcpu, gpa_to_gfn(vmcb_gpa), &map);
-       if (ret == EINVAL) {
+       if (ret == -EINVAL) {
                kvm_inject_gp(&svm->vcpu, 0);
                return 1;
        } else if (ret) {