All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>, kvm <kvm@vger.kernel.org>,
	"Nadav Har'El" <nyh@math.technion.ac.il>,
	"Nakajima, Jun" <jun.nakajima@intel.com>
Subject: Re: [PATCH v3] KVM: nVMX: Fix setting of CR0 and CR4 in guest mode
Date: Thu, 7 Mar 2013 15:49:09 -0300	[thread overview]
Message-ID: <20130307184909.GA15649@amt.cnet> (raw)
In-Reply-To: <20130307133214.GL11223@redhat.com>

On Thu, Mar 07, 2013 at 03:32:14PM +0200, Gleb Natapov wrote:
> On Thu, Mar 07, 2013 at 02:08:07PM +0100, Jan Kiszka wrote:
> > The logic for calculating the value with which we call kvm_set_cr0/4 was
> > broken (will definitely be visible with nested unrestricted guest mode
> > support). Also, we performed the check regarding CR0_ALWAYSON too early
> > when in guest mode.
> > 
> > What really needs to be done on both CR0 and CR4 is to mask out L1-owned
> > bits and merge them in from L1's guest_cr0/4. In contrast, arch.cr0/4
> > and arch.cr0/4_guest_owned_bits contain the mangled L0+L1 state and,
> > thus, are not suited as input.
> > 
> > For both CRs, we can then apply the check against VMXON_CRx_ALWAYSON and
> > refuse the update if it fails. To be fully consistent, we implement this
> > check now also for CR4. For CR4, we move the check into vmx_set_cr4
> > while we keep it in handle_set_cr0. This is because the CR0 checks for
> > vmxon vs. guest mode will diverge soon when adding unrestricted guest
> > mode support.
> > 
> > Finally, we have to set the shadow to the value L2 wanted to write
> > originally.
> > 
> > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> Reviewed-by: Gleb Natapov <gleb@redhat.com>

Applied, thanks.


      reply	other threads:[~2013-03-07 19:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07 13:08 [PATCH v3] KVM: nVMX: Fix setting of CR0 and CR4 in guest mode Jan Kiszka
2013-03-07 13:32 ` Gleb Natapov
2013-03-07 18:49   ` Marcelo Tosatti [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=20130307184909.GA15649@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=gleb@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jun.nakajima@intel.com \
    --cc=kvm@vger.kernel.org \
    --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.