Skip to content

Commit

Permalink
KVM: x86 emulator: correctly mask pmc index bits in RDPMC instruction…
Browse files Browse the repository at this point in the history
… emulation

Signed-off-by: Gleb Natapov <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
  • Loading branch information
Gleb Natapov authored and avikivity committed Mar 8, 2012
1 parent 565f3be commit 270c6c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kvm/pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 270c6c7

Please sign in to comment.