Skip to content

Commit

Permalink
KVM: x86: remove bogus #GP injection
Browse files Browse the repository at this point in the history
There is no need to inject a #GP from kvm_mtrr_set_msr, kvm_emulate_wrmsr will
handle it.

Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Paolo Bonzini committed Dec 15, 2020
1 parent 1c04d8c commit 9caec4b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions arch/x86/kvm/mtrr.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,8 @@ bool kvm_mtrr_valid(struct kvm_vcpu *vcpu, u32 msr, u64 data)
} else
/* MTRR mask */
mask |= 0x7ff;
if (data & mask) {
kvm_inject_gp(vcpu, 0);
return false;
}

return true;
return (data & mask) == 0;
}
EXPORT_SYMBOL_GPL(kvm_mtrr_valid);

Expand Down

0 comments on commit 9caec4b

Please sign in to comment.