All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Morty Andersen <mtfrb123@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Question of emulation on MSR's in KVM-mode
Date: Mon, 04 Aug 2014 14:22:00 +0200	[thread overview]
Message-ID: <53DF7AE8.2010302@redhat.com> (raw)
In-Reply-To: <CA+LVm-xKnmzj2-+NLPNm9npuxmUFhoArk2N9VFubujaV-42qLQ@mail.gmail.com>

Il 04/08/2014 10:37, Morty Andersen ha scritto:
> Hi
> 
> I'm working on an extension to QEMU (target i386). This involves adding
> new MSR's. I've got it working in non-KVM mode by adding these MSR's to
> the state and adding extra cases to helper_wrmsr(), helper_rdmsr(). The
> guest can now read/write these MSR's as expected. However, it fails when
> running in KVM-mode. Specifically, writing the MSR's causes GPF. Note
> that these MSR's are not natively supported by the host CPU. I don't
> know enough about Intel's VMX to tell if it is even reasonable to expect
> that this could work for a non-natively supported MSR. As far as I can
> read in the VMX documentation, the hypervisor can setup a bitmap of
> which MSR's should cause trap's to the hypervisor and which shouldn't. I
> guess it would be the KVM kernel module that does this based on input it
> receives from QEMU. But I haven't been able to find the part of QEMU
> that negotiates this. I guess the solution for me is to set the
> necessary bits to that access to the new MSR's causes traps. Next, I
> need to add/modify the trap handler so that it can handle the MSR's.

Hi,

handling of the MSRs in KVM is done entirely in the hypervisor.  QEMU
only gets/sets them in order to support migration.  You need to modify
the KVM kernel module for the VM to recognize your special MSRs.

Paolo

  reply	other threads:[~2014-08-04 12:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-04  8:37 [Qemu-devel] Question of emulation on MSR's in KVM-mode Morty Andersen
2014-08-04 12:22 ` Paolo Bonzini [this message]
2014-08-04 15:52   ` Morty Andersen

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=53DF7AE8.2010302@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=mtfrb123@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /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.