aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2012-02-16 07:44:11 -0500
committerAvi Kivity <avi@redhat.com>2012-03-08 07:10:24 -0500
commit270c6c79f4e15e599f47174ecedad932463af7a2 (patch)
tree551493b3175eb9ec80a92aab806fadc6ce0c758e /arch/x86/kvm
parent565f3be2174611f364405bbea2d86e153c2e7e78 (diff)
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>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/pmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c
index 7aad5446f393..3e48c1d3edcd 100644
--- a/arch/x86/kvm/pmu.c
+++ b/arch/x86/kvm/pmu.c
@@ -413,7 +413,7 @@ int kvm_pmu_read_pmc(struct kvm_vcpu *vcpu, unsigned pmc, u64 *data)
413 struct kvm_pmc *counters; 413 struct kvm_pmc *counters;
414 u64 ctr; 414 u64 ctr;
415 415
416 pmc &= (3u << 30) - 1; 416 pmc &= ~(3u << 30);
417 if (!fixed && pmc >= pmu->nr_arch_gp_counters) 417 if (!fixed && pmc >= pmu->nr_arch_gp_counters)
418 return 1; 418 return 1;
419 if (fixed && pmc >= pmu->nr_arch_fixed_counters) 419 if (fixed && pmc >= pmu->nr_arch_fixed_counters)