Thread (16 messages) 16 messages, 3 authors, 2012-05-13
STALE5176d

[PATCH 05/11] KVM: x86 emulator: correctly mask pmc index bits in RDPMC instruction emulation

From: Avi Kivity <hidden>
Date: 2012-05-09 13:10:41
Also in: kvm
Subsystem: kernel virtual machine for x86 (kvm/x86), the rest, x86 architecture (32-bit and 64-bit) · Maintainers: Sean Christopherson, Paolo Bonzini, Linus Torvalds, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen

From: Gleb Natapov <redacted>

Signed-off-by: Gleb Natapov <redacted>
Signed-off-by: Avi Kivity <redacted>
(cherry picked from commit 270c6c79f4e15e599f47174ecedad932463af7a2)
---
 arch/x86/kvm/pmu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c
index 7aad544..3e48c1d 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)
 	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)
-- 
1.7.10.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help