]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: rdpmc emulation checks the counter incorrectly
authorNadav Amit <namit@cs.technion.ac.il>
Mon, 2 Jun 2014 15:34:09 +0000 (18:34 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 18 Jun 2014 15:46:18 +0000 (17:46 +0200)
commitc750e45e5b6cb9e3293796e314335f9c71a126e6
tree6cec4548ccd3e2357512aa028c4ab8f1f61b9ffc
parentca679bb4864fcdb18d256b8b99cfbcd91e11ab68
KVM: x86: rdpmc emulation checks the counter incorrectly

The rdpmc emulation checks that the counter (ECX) is not higher than 2, without
taking into considerations bits 30:31 role (e.g., bit 30 marks whether the
counter is fixed). The fix uses the pmu information for checking the validity
of the pmu counter.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_emulate.h
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/emulate.c
arch/x86/kvm/pmu.c
arch/x86/kvm/x86.c