]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
KVM: x86: fix return value for reserved EFER
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 24 May 2019 19:52:46 +0000 (21:52 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 24 May 2019 19:55:02 +0000 (21:55 +0200)
Commit 11988499e62b ("KVM: x86: Skip EFER vs. guest CPUID checks for
host-initiated writes", 2019-04-02) introduced a "return false" in a
function returning int, and anyway set_efer has a "nonzero on error"
conventon so it should be returning 1.

Reported-by: Pavel Machek <pavel@denx.de>
Fixes: 11988499e62b ("KVM: x86: Skip EFER vs. guest CPUID checks for host-initiated writes")
Cc: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c

index e7e57de50a3c0820c0149cecf4956245c56c220f..acb179f78fdcd2c9a512888da00e34832326cf29 100644 (file)
@@ -1298,7 +1298,7 @@ static int set_efer(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
        u64 efer = msr_info->data;
 
        if (efer & efer_reserved_bits)
-               return false;
+               return 1;
 
        if (!msr_info->host_initiated) {
                if (!__kvm_valid_efer(vcpu, efer))