All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Nadav Har'El <nyh@math.technion.ac.il>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	Gleb Natapov <gleb@redhat.com>, kvm <kvm@vger.kernel.org>,
	"Nakajima, Jun" <jun.nakajima@intel.com>,
	avi.kivity@gmail.com
Subject: Re: [PATCH] KVM: nVMX: Replace kvm_set_cr0 with vmx_set_cr0 in load_vmcs12_host_state
Date: Sat, 23 Feb 2013 22:57:28 +0100	[thread overview]
Message-ID: <51293B48.6070108@web.de> (raw)
In-Reply-To: <20130223214503.GA13800@fermat.math.technion.ac.il>

[-- Attachment #1: Type: text/plain, Size: 1373 bytes --]

On 2013-02-23 22:45, Nadav Har'El wrote:
> On Sat, Feb 23, 2013, Jan Kiszka wrote about "[PATCH] KVM: nVMX: Replace kvm_set_cr0 with vmx_set_cr0 in load_vmcs12_host_state":
>> -	kvm_set_cr0(vcpu, vmcs12->host_cr0);
>> +	vmx_set_cr0(vcpu, vmcs12->host_cr0);
> 
> I don't remember now why I did this (and I'm not looking at the code),
> but this you'll need to really test carefully, including
> shadow-on-shadow mode (ept=0 in L0), to verify you're not missing any
> important side-effect of kvm_set_cr0.
> 
> Also, if I remember correctly, during nVMX's review, Avi Kivity asked
> in several places that when I called vmx_set_cr0, I should instead call
> kvm_set_cr0(), because it does some extra stuff and does some extra
> checks. Hmm, see, see this:
> 	http://markmail.org/message/hhidqyhbo2mrgxxc
> 
> where Avi asked for the reverse patch you're attempting now.

At least, kvm_set_cr0 can't be used as it assumes an otherwise
consistent guest state and an explicitly initiated transition - which is
naturally not the case while emulating a vmexit.

However, there are some side effects that need a closer look, likely
also in other places where vmx_set_cr0 is used directly. E.g.
load_pdptrs. The lack of calling them on host->guest switch may explain
the PAE issues you once saw with your nEPT implementation.

OK, more work...

Jan



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  reply	other threads:[~2013-02-23 21:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-23 21:35 [PATCH] KVM: nVMX: Replace kvm_set_cr0 with vmx_set_cr0 in load_vmcs12_host_state Jan Kiszka
2013-02-23 21:45 ` Nadav Har'El
2013-02-23 21:57   ` Jan Kiszka [this message]
2013-02-23 22:21     ` Jan Kiszka
2013-02-24  8:34       ` Jan Kiszka
2013-02-24  8:56     ` Avi Kivity
2013-02-24  9:01       ` Jan Kiszka
2013-02-24  9:21         ` Avi Kivity
2013-02-24  9:40           ` Jan Kiszka
2013-02-24 10:11             ` Avi Kivity
2013-02-24 10:49               ` Jan Kiszka
2013-02-24 18:56                 ` Avi Kivity
2013-02-24 19:15                   ` Jan Kiszka
2013-02-24 19:26                     ` Avi Kivity
2013-04-28 10:20 ` Jan Kiszka
2013-04-30 11:46   ` Gleb Natapov
2013-04-30 12:42     ` Jan Kiszka
2013-05-05  9:02       ` Jan Kiszka

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=51293B48.6070108@web.de \
    --to=jan.kiszka@web.de \
    --cc=avi.kivity@gmail.com \
    --cc=gleb@redhat.com \
    --cc=jun.nakajima@intel.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 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.