From: Paolo Bonzini <pbonzini@redhat.com>
To: Matthias Lange <matthias.lange@kernkonzept.com>,
kvm@vger.kernel.org, Gleb Natapov <gleb@redhat.com>
Subject: Re: [PATCH] KVM: svm: virtualize MSR reads from MC4_MISC1
Date: Wed, 09 Jul 2014 18:26:23 +0200 [thread overview]
Message-ID: <53BD6D2F.8070504@redhat.com> (raw)
In-Reply-To: <1403785327-1357-2-git-send-email-matthias.lange@kernkonzept.com>
Il 26/06/2014 14:22, Matthias Lange ha scritto:
> Linux' AMD MCE code tries to read from the MC4_MISC1 (0xc0000408) MSR. Because
> this read is not virtualized within KVM, a GPE is injected into the guest.
> This patch handles guest reads from MC4_MISC and returns 0 to the guest.
>
> Signed-off-by: Matthias Lange <matthias.lange@kernkonzept.com>
> ---
> arch/x86/kvm/x86.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 24d70d4..d5a305b 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -2530,6 +2530,9 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
> return 1;
> data = vcpu->arch.osvw.status;
> break;
> + case 0xc0000408: /* MC4_MISC1 */
> + data = 0;
> + break;
> default:
> if (kvm_pmu_msr(vcpu, msr))
> return kvm_pmu_get_msr(vcpu, msr, pdata);
>
Why don't you have to do the same with MC4_MISC0?
Is your kernel compiled with or without CONFIG_PARAVIRT? Paravirt does
.read_msr = native_read_msr_safe,
.write_msr = native_write_msr_safe,
so you shouldn't get these #GP exceptions.
Paolo
next prev parent reply other threads:[~2014-07-09 16:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-26 12:22 [PATCH] KVM: svm: virtualize MSR reads from MC4_MISC1 Matthias Lange
2014-06-26 12:22 ` Matthias Lange
2014-07-09 16:26 ` Paolo Bonzini [this message]
2014-07-10 9:31 ` Matthias Lange
2014-07-11 7:14 ` Paolo Bonzini
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=53BD6D2F.8070504@redhat.com \
--to=pbonzini@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=matthias.lange@kernkonzept.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.