Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1407709

Re: [PATCH] KVM: Handle MSR_IA32_PERF_CTL

From "Gabriel L. Somlo" <gsomlo@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] KVM: Handle MSR_IA32_PERF_CTL
Date 2016-05-26 22:50 +0200
Message-ID <rDaoa-2BP-9@gated-at.bofh.it> (permalink)
References <rCYdk-3zo-21@gated-at.bofh.it> <rDaet-2yj-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, May 26, 2016 at 10:39:31PM +0200, Radim Krčmář wrote:
> 2016-05-26 10:32+0300, kmeaw@yandex-team.ru:
> > From: Dmitry Bilunov <kmeaw@yandex-team.ru>
> > 
> > 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 <kmeaw@yandex-team.ru>
> > ---
> > 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?

After setting /sys/module/kvm/parameters/ignore_msrs, all I get in
dmesg after firing up OS X is:

	vcpu0 ignored rdmsr: 0x199

So no, I don't think it would try to write it.

HTH,
--Gabriel

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] KVM: Handle MSR_IA32_PERF_CTL kmeaw@yandex-team.ru - 2016-05-26 09:50 +0200
  Re: [PATCH] KVM: Handle MSR_IA32_PERF_CTL Radim Krčmář <rkrcmar@redhat.com> - 2016-05-26 22:40 +0200
    Re: [PATCH] KVM: Handle MSR_IA32_PERF_CTL "Gabriel L. Somlo" <gsomlo@gmail.com> - 2016-05-26 22:50 +0200
      Re: [PATCH] KVM: Handle MSR_IA32_PERF_CTL Radim Krčmář <rkrcmar@redhat.com> - 2016-05-27 17:30 +0200
        Re: [PATCH] KVM: Handle MSR_IA32_PERF_CTL Radim Krčmář <rkrcmar@redhat.com> - 2016-05-27 17:40 +0200
          Re: [PATCH] KVM: Handle MSR_IA32_PERF_CTL Paolo Bonzini <pbonzini@redhat.com> - 2016-05-31 10:00 +0200
  Re: [PATCH] KVM: Handle MSR_IA32_PERF_CTL Radim Krčmář <rkrcmar@redhat.com> - 2016-05-27 17:30 +0200

csiph-web