public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: David Matlack <dmatlack@google.com>
Cc: "kvm list" <kvm@vger.kernel.org>,
	linux-kernel@vger.kernel.org, "Jim Mattson" <jmattson@google.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [PATCH 1/4] KVM: nVMX: support restore of VMX capability MSRs
Date: Tue, 29 Nov 2016 03:01:15 -0500 (EST)	[thread overview]
Message-ID: <1141665457.516897.1480406475749.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CALzav=fPNw1QYHBjxzgwE9r_DnjdRGBRTyiyRWbcT5qEmGsEMg@mail.gmail.com>

> On Mon, Nov 28, 2016 at 2:48 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> > On 28/11/2016 22:11, David Matlack wrote:
> >> > PINBASED_CTLS, PROCBASED_CTLS, EXIT_CTLS and ENTRY_CTLS can be derived
> >> > from their "true" counterparts, so I think it's better to remove the
> >> > "non-true" ones from struct nested_vmx (and/or add the "true" ones when
> >> > missing) and make them entirely computed.  But it can be done on top.
> >>
> >> Good point. And that would mean userspace does not need to restore the
> >> non-true MSRs, right?
> >
> > Yes, sorry for being a bit too concise. :)
> 
> I'll include this cleanup in the next version of the patchset since it
> affects which MSRs userspace will restore. It looks like a pretty
> simple patch.

Don't bother removing the "non-true" registers from nested_vmx; you only
need to adjust the userspace API.

> >
> >> KVM does not emulate MSR_IA32_VMX_BASIC[55]=0,
> >> and will probably never want to.
> >
> > That's a separate question, MSR_IA32_VMX_BASIC[55]=0 basically means
> > that the "true" capabilities are the same as the "default" capabilities.
> >  If userspace wanted to set it that way, KVM right now would not hide
> > the "true" capability MSR, but on the other hand the nested hypervisor
> > should not even notice the difference.
> 
> KVM would also need to use the non-true MSR in place of the true MSRs
> when checking VMCS12 during VM-entry.

It's not necessary, userspace would set the relevant bits to 1 in the true
MSRs, for both the low and high parts.  If it doesn't, it's garbage in
garbage out.

Paolo

  reply	other threads:[~2016-11-29  8:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23  1:14 [PATCH 0/4] VMX Capability MSRs David Matlack
2016-11-23  1:14 ` [PATCH 1/4] KVM: nVMX: support restore of VMX capability MSRs David Matlack
2016-11-23 11:44   ` Paolo Bonzini
2016-11-28 21:11     ` David Matlack
2016-11-28 22:48       ` Paolo Bonzini
2016-11-28 22:57         ` David Matlack
2016-11-29  8:01           ` Paolo Bonzini [this message]
2016-11-29 17:42             ` David Matlack
2016-11-23  1:14 ` [PATCH 2/4] KVM: nVMX: fix checks on CR{0,4} during virtual VMX operation David Matlack
2016-11-23 11:31   ` Paolo Bonzini
2016-11-28 19:51     ` David Matlack
2016-11-23  1:14 ` [PATCH 3/4] KVM: nVMX: accurate emulation of MSR_IA32_CR{0,4}_FIXED1 David Matlack
2016-11-23  9:06   ` Paolo Bonzini
2016-11-23 19:16     ` David Matlack
2016-11-23 19:24       ` Paolo Bonzini
2016-11-23 22:07         ` David Matlack
2016-11-23 22:11           ` Paolo Bonzini
2016-11-23 23:28             ` David Matlack
2016-11-28 21:51               ` David Matlack
2016-11-23  1:14 ` [PATCH 4/4] KVM: nVMX: load GUEST_EFER after GUEST_CR0 during emulated VM-entry David Matlack
2016-11-23 11:45 ` [PATCH 0/4] VMX Capability MSRs Paolo Bonzini
2016-11-28 17:44   ` David Matlack

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=1141665457.516897.1480406475749.JavaMail.zimbra@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=dmatlack@google.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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