Skip to content
Commit 0c2df2a1 authored by Dmitry Bilunov's avatar Dmitry Bilunov Committed by Radim Krčmář
Browse files

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: default avatarDmitry Bilunov <kmeaw@yandex-team.ru>
Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
parent b19ee2ff
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment