From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH] KVM: Handle MSR_IA32_PERF_CTL Date: Thu, 26 May 2016 22:39:31 +0200 Message-ID: <20160526203931.GB25334@potion> References: <770161464247923@webcorp02g.yandex-team.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, gleb@kernel.org, pbonzini@redhat.com To: kmeaw@yandex-team.ru Return-path: Content-Disposition: inline In-Reply-To: <770161464247923@webcorp02g.yandex-team.ru> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 2016-05-26 10:32+0300, kmeaw@yandex-team.ru: > From: Dmitry Bilunov > > 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. Most notably it fixes an issue with MacOS X 10.10 kernel. > > Signed-off-by: Dmitry Bilunov > --- > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > @@ -2050,6 +2051,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) > case MSR_VM_HSAVE_PA: > case MSR_AMD64_PATCH_LOADER: > case MSR_AMD64_BU_CFG2: > + case MSR_IA32_PERF_CTL: > break; Does MacOS X write it too? Thanks.