mirror of
https://github.com/torvalds/linux.git
synced 2024-11-16 17:12:06 +00:00
KVM: x86 emulator: correctly mask pmc index bits in RDPMC instruction emulation
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
565f3be217
commit
270c6c79f4
@ -413,7 +413,7 @@ int kvm_pmu_read_pmc(struct kvm_vcpu *vcpu, unsigned pmc, u64 *data)
|
||||
struct kvm_pmc *counters;
|
||||
u64 ctr;
|
||||
|
||||
pmc &= (3u << 30) - 1;
|
||||
pmc &= ~(3u << 30);
|
||||
if (!fixed && pmc >= pmu->nr_arch_gp_counters)
|
||||
return 1;
|
||||
if (fixed && pmc >= pmu->nr_arch_fixed_counters)
|
||||
|
Loading…
Reference in New Issue
Block a user