Skip to content

Commit

Permalink
KVM: x86: fix return value for reserved EFER
Browse files Browse the repository at this point in the history
Commit 1198849 ("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: 1198849 ("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>
  • Loading branch information
Paolo Bonzini committed May 24, 2019
1 parent 883d25e commit 66f61c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 66f61c9

Please sign in to comment.