kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Dmitry Bilunov <kmeaw@yandex-team.ru>
Cc: pbonzini@redhat.com, gsomlo@gmail.com,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	gleb@kernel.org
Subject: Re: [PATCH] KVM: Handle MSR_IA32_PERF_CTL
Date: Tue, 31 May 2016 16:57:22 +0200	[thread overview]
Message-ID: <20160531145722.GA30930@potion> (raw)
In-Reply-To: <1464705504-18243-1-git-send-email-kmeaw@yandex-team.ru>

2016-05-31 17:38+0300, 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.
> 
> Signed-off-by: Dmitry Bilunov <kmeaw@yandex-team.ru>
> ---

Applied, thank you.

>  arch/x86/kvm/x86.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index c805cf4..d0a5b4b 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)
>  	case MSR_AMD64_NB_CFG:
>  	case MSR_FAM10H_MMIO_CONF_BASE:
>  	case MSR_AMD64_BU_CFG2:
> +	case MSR_IA32_PERF_CTL:
>  		msr_info->data = 0;
>  		break;
>  	case MSR_K7_EVNTSEL0 ... MSR_K7_EVNTSEL3:
> -- 
> 2.8.2
> 

  reply	other threads:[~2016-05-31 14:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-26  7:32 [PATCH] KVM: Handle MSR_IA32_PERF_CTL kmeaw
2016-05-26 20:39 ` Radim Krčmář
2016-05-26 20:44   ` Gabriel L. Somlo
     [not found]     ` <920591464331762@webcorp02f.yandex-team.ru>
2016-05-27 15:22       ` Radim Krčmář
2016-05-27 15:38         ` Radim Krčmář
2016-05-31  7:53           ` Paolo Bonzini
2016-05-31 13:05             ` Radim Krčmář
     [not found]             ` <1317601464689200@webcorp01d.yandex-team.ru>
2016-05-31 13:16               ` [PATCH v3] " Radim Krčmář
2016-05-31 14:38                 ` [PATCH] " Dmitry Bilunov
2016-05-31 14:57                   ` Radim Krčmář [this message]
2016-05-27 15:28 ` Radim Krčmář

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160531145722.GA30930@potion \
    --to=rkrcmar@redhat.com \
    --cc=gleb@kernel.org \
    --cc=gsomlo@gmail.com \
    --cc=kmeaw@yandex-team.ru \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).