diff options
author | Dmitry Bilunov <kmeaw@yandex-team.ru> | 2016-05-31 10:38:24 -0400 |
---|---|---|
committer | Radim Krčmář <rkrcmar@redhat.com> | 2016-06-02 11:38:50 -0400 |
commit | 0c2df2a1affd183ba9c114915f42a2d464b4f58f (patch) | |
tree | 1dc70df96a3da4d1cbe420b5225c2fc2ed631118 /arch/x86 | |
parent | b19ee2ff3b287fea48a2896a381e31319394fe58 (diff) |
KVM: Handle MSR_IA32_PERF_CTL
Intel CPUs having Turbo Boost feature implement an MSR to provide a
control interface via rdmsr/wrmsr instructions. One could detect the
presence of this feature by issuing one of these instructions and
handling the #GP exception which is generated in case the referenced MSR
is not implemented by the CPU.
KVM's vCPU model behaves exactly as a real CPU in this case by injecting
a fault when MSR_IA32_PERF_CTL is called (which KVM does not support).
However, some operating systems use this register during an early boot
stage in which their kernel is not capable of handling #GP correctly,
causing #DP and finally a triple fault effectively resetting the vCPU.
This patch implements a dummy handler for MSR_IA32_PERF_CTL to avoid the
crashes.
Signed-off-by: Dmitry Bilunov <kmeaw@yandex-team.ru>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/x86.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index c805cf494154..d0a5b4b4e64d 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -2314,6 +2314,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) | |||
2314 | case MSR_AMD64_NB_CFG: | 2314 | case MSR_AMD64_NB_CFG: |
2315 | case MSR_FAM10H_MMIO_CONF_BASE: | 2315 | case MSR_FAM10H_MMIO_CONF_BASE: |
2316 | case MSR_AMD64_BU_CFG2: | 2316 | case MSR_AMD64_BU_CFG2: |
2317 | case MSR_IA32_PERF_CTL: | ||
2317 | msr_info->data = 0; | 2318 | msr_info->data = 0; |
2318 | break; | 2319 | break; |
2319 | case MSR_K7_EVNTSEL0 ... MSR_K7_EVNTSEL3: | 2320 | case MSR_K7_EVNTSEL0 ... MSR_K7_EVNTSEL3: |