From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Jim Mattson <jmattson@google.com>
Cc: "Jintack Lim" <jintack@cs.columbia.edu>,
"kvm list" <kvm@vger.kernel.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [PATCH] KVM: nVMX: Set msr bitmap correctly for MSR_FS_BASE in vmcs02
Date: Thu, 2 May 2019 14:06:45 -0700 [thread overview]
Message-ID: <20190502210645.GC26138@linux.intel.com> (raw)
In-Reply-To: <CALMp9eQot5jqiN4ncLDCPt_ZiVvtmEb_zeMp=1gkOChTrgL+dg@mail.gmail.com>
On Thu, May 02, 2019 at 10:59:16AM -0700, Jim Mattson wrote:
> On Thu, May 2, 2019 at 8:03 AM Sean Christopherson
> <sean.j.christopherson@intel.com> wrote:
>
> > That being said, I think there are other reasons why KVM doesn't pass
> > through MSRs to L2. Unfortunately, I'm struggling to recall what those
> > reasons are.
> >
> > Jim, I'm pretty sure you've looked at this code a lot, do you happen to
> > know off hand? Is it purely a performance thing to avoid merging bitmaps
> > on every nested entry, is there a subtle bug/security hole, or is it
> > simply that no one has ever gotten around to writing the code?
>
> I'm not aware of any subtle bugs or security holes. If L1 changes the
> VMCS12 MSR permission bitmaps while L2 is running, behavior is
> unlikely to match hardware, but this is clearly in "undefined
> behavior" territory anyway. IIRC, the posted interrupt structures are
> the only thing hanging off of the VMCS that can legally be modified
> while a logical processor with that VMCS active is in VMX non-root
> operation.
Cool, thanks!
> I agree that FS_BASE, GS_BASE, and KERNEL_GS_BASE, at the very least,
> are worthy of special treatment. Fortunately, their permission bits
> are all in the same quadword. Some of the others, like the SYSENTER
> and SYSCALL MSRs are rarely modified by a typical (non-hypervisor) OS.
> For nested performance at levels deeper than L2, they might still
> prove interesting.
Agreed on the *_BASE MSRs. Rarely written MSRs should be intercepted
so that the nested VM-Exit path doesn't need to read them from vmcs02
on every exit (WIP). I'm playing with the nested code right now and
one of the things I'm realizing is that KVM spends an absurd amount of
time copying data to/from VMCSes for fields that are almost never
accessed by L0 or L1.
> Basically, I think no one has gotten around to writing the code.
next prev parent reply other threads:[~2019-05-02 21:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-02 2:09 [PATCH] KVM: nVMX: Set msr bitmap correctly for MSR_FS_BASE in vmcs02 Jintack Lim
2019-05-02 15:03 ` Sean Christopherson
2019-05-02 15:39 ` Jintack Lim
2019-05-02 17:59 ` Jim Mattson
2019-05-02 21:06 ` Sean Christopherson [this message]
2019-05-03 0:02 ` Jintack Lim
2019-05-03 0:21 ` Jintack Lim
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=20190502210645.GC26138@linux.intel.com \
--to=sean.j.christopherson@intel.com \
--cc=jintack@cs.columbia.edu \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@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