Commit 79b78f5e authored by Paolo Bonzini's avatar Paolo Bonzini Committed by Kleber Sacilotto de Souza

KVM: x86: fix return value for reserved EFER

BugLink: https://bugs.launchpad.net/bugs/1832661

commit 66f61c92 upstream.

Commit 11988499 ("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: default avatarPavel Machek <pavel@denx.de>
Fixes: 11988499 ("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: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 8c605a7b
...@@ -1094,7 +1094,7 @@ static int set_efer(struct kvm_vcpu *vcpu, struct msr_data *msr_info) ...@@ -1094,7 +1094,7 @@ static int set_efer(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
u64 efer = msr_info->data; u64 efer = msr_info->data;
if (efer & efer_reserved_bits) if (efer & efer_reserved_bits)
return false; return 1;
if (!msr_info->host_initiated) { if (!msr_info->host_initiated) {
if (!__kvm_valid_efer(vcpu, efer)) if (!__kvm_valid_efer(vcpu, efer))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment