public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm <kvm@vger.kernel.org>,
	"Nadav Har'El" <nyh@math.technion.ac.il>
Subject: Re: [PATCH v2] KVM: nVMX: Fix setting of CR0 and CR4 in guest mode
Date: Thu, 7 Mar 2013 15:04:23 +0200	[thread overview]
Message-ID: <20130307130423.GK11223@redhat.com> (raw)
In-Reply-To: <51388CB7.8040505@siemens.com>

On Thu, Mar 07, 2013 at 01:48:55PM +0100, Jan Kiszka wrote:
> On 2013-03-07 13:21, Gleb Natapov wrote:
> > On Thu, Mar 07, 2013 at 01:18:24PM +0100, Jan Kiszka wrote:
> >> On 2013-03-07 13:05, Gleb Natapov wrote:
> >>> On Thu, Mar 07, 2013 at 12:57:27PM +0100, Jan Kiszka wrote:
> >>>>>> Ah, sorry, you are not seeing what I'm looking at: The test will change
> >>>>>> for L2 context once unrestricted guest mode is added. At that point, it
> >>>>>> makes more sense to split it into one version that checks against
> >>>>>> VMXON_CR0_ALWAYSON while in vmxon, targeting L1, and another that does
> >>>>>> more complex evaluation for L2, depending on nested_cpu_has2(vmcs12,
> >>>>>> SECONDARY_EXEC_UNRESTRICTED_GUEST).
> >>>>>>
> >>>>> Ah, OK. Hard to argue that those checks can be consolidated without
> >>>>> seeing them :) So you want to implement unrestricted L1 on restricted L0 and
> >>>>> let L0 emulate real mode of L2 directly?
> >>>>
> >>>> Err, no. :) Well, that emulation might even work but doesn't help unless
> >>>> you also emulate EPT (not unrestricted guest mode without EPT support -
> >>>> according to the spec).
> >>> Yes, of course EPT is needed, but patches are available :) I think it
> >>> should speedup L2 real mode substantially. No need to go to L1 for each
> >>> instruction emulation and L1 will have to exit to L0 many times during
> >>> emulation of some instructions.
> >>
> >> The point is: If you already have EPT on the host, you likely also have
> >> native unrestricted guest mode. You just need to expose it and adjust
> >> some minor things (like this bug here) along the way. Not sure how many
> >> CPUs had EPT but no unrestricted guest mode. Do you have numbers?
> >>
> > AFAIK every single one before Westmere. Nehalem does no have it for
> > sure.
> 
> OK. Hmm, will it be more than just faking unrestricted mode toward L1
> and emulating in L0 then (which should happen automagically)? Maybe I
> will play with this under unrestricted_guest=0 when I have some time.
> 
We will probably need to teach emulator about more instruction that may
cause vmexit.

--
			Gleb.

      reply	other threads:[~2013-03-07 13:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04 19:40 [PATCH v2] KVM: nVMX: Fix setting of CR0 and CR4 in guest mode Jan Kiszka
2013-03-05 12:57 ` Gleb Natapov
2013-03-05 13:02   ` Gleb Natapov
2013-03-05 13:18     ` Jan Kiszka
2013-03-07  0:33 ` Marcelo Tosatti
2013-03-07  7:51 ` Gleb Natapov
2013-03-07  8:12   ` Jan Kiszka
2013-03-07  8:27     ` Jan Kiszka
2013-03-07  8:48       ` Gleb Natapov
2013-03-07  8:43     ` Gleb Natapov
2013-03-07  8:53       ` Jan Kiszka
2013-03-07  8:57         ` Gleb Natapov
2013-03-07 10:37           ` Jan Kiszka
2013-03-07 11:06             ` Gleb Natapov
2013-03-07 11:25               ` Jan Kiszka
2013-03-07 11:50                 ` Gleb Natapov
2013-03-07 11:57                   ` Jan Kiszka
2013-03-07 12:05                     ` Gleb Natapov
2013-03-07 12:18                       ` Jan Kiszka
2013-03-07 12:21                         ` Gleb Natapov
2013-03-07 12:48                           ` Jan Kiszka
2013-03-07 13:04                             ` Gleb Natapov [this message]

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=20130307130423.GK11223@redhat.com \
    --to=gleb@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=nyh@math.technion.ac.il \
    /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