KVM: SVM: add rdmsr support for AMD event registers
authorWei Huang <[email protected]>
Wed, 13 Aug 2014 16:06:14 +0000 (12:06 -0400)
committerPaolo Bonzini <[email protected]>
Tue, 19 Aug 2014 13:12:28 +0000 (15:12 +0200)
commitdc9b2d933a1d5782b70977024f862759c8ebb2f7
tree015dfa6138a56f51d7fde58a7cd6576cf7c3e3c3
parent30d1e0e806e5b2fadc297ba78f2d7afd6ba309cf
KVM: SVM: add rdmsr support for AMD event registers

Current KVM only supports RDMSR for K7_EVNTSEL0 and K7_PERFCTR0
MSRs. Reading the rest MSRs will trigger KVM to inject #GP into
guest VM. This causes a warning message "Failed to access perfctr
msr (MSR c0010001 is ffffffffffffffff)" on AMD host. This patch
adds RDMSR support for all K7_EVNTSELn and K7_PERFCTRn registers
and thus supresses the warning message.

Signed-off-by: Wei Huang <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
arch/x86/kvm/x86.c