All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Deegan <Tim.Deegan@citrix.com>
To: Christoph Egger <Christoph.Egger@amd.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"Dong, Eddie" <eddie.dong@intel.com>
Subject: Re: [PATCH 05/13] Nested Virtualization: CRn & paged real mode
Date: Wed, 8 Sep 2010 16:11:33 +0100	[thread overview]
Message-ID: <20100908151133.GC23487@whitby.uk.xensource.com> (raw)
In-Reply-To: <201009011700.45203.Christoph.Egger@amd.com>

Hi, 

> diff -r 0199b689a2d0 -r e0eae5b67977 xen/arch/x86/hvm/hvm.c
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -54,6 +54,7 @@
>  #include <asm/hvm/support.h>
>  #include <asm/hvm/cacheattr.h>
>  #include <asm/hvm/trace.h>
> +#include <asm/hvm/nestedhvm.h>
>  #include <asm/mtrr.h>
>  #include <asm/apic.h>
>  #include <public/sched.h>
> @@ -1109,9 +1110,13 @@ int hvm_set_cr0(unsigned long value)
>      /* ET is reserved and should be always be 1. */
>      value |= X86_CR0_ET;
>  
> -    if ( (value & (X86_CR0_PE | X86_CR0_PG)) == X86_CR0_PG )
> +    if ( !nestedhvm_vmentry_emulate(v) &&
> +         (value & (X86_CR0_PE | X86_CR0_PG)) == X86_CR0_PG )
>          goto gpf;

The change above makes perfect sense: nested SVM guests should be
allowed to enter paged real mode. 

But I don't understand either of the changes below.  Can you explain why
the cache control bits get special treatment?

Tim.

> +    if ( nestedhvm_vcpu_in_guestmode(v) )
> +        value &= ~(X86_CR0_CD | X86_CR0_NW);
> +
>      if ( (value & X86_CR0_PG) && !(old_value & X86_CR0_PG) )
>      {
>          if ( v->arch.hvm_vcpu.guest_efer & EFER_LME )
> @@ -1163,7 +1168,7 @@ int hvm_set_cr0(unsigned long value)
>          }
>      }
>  
> -    if ( has_arch_mmios(v->domain) )
> +    if ( !nestedhvm_vmentry_emulate(v) && has_arch_mmios(v->domain) )
>      {
>          if ( (value & X86_CR0_CD) && !(value & X86_CR0_NW) )
>          {


-- 
Tim Deegan <Tim.Deegan@citrix.com>
Principal Software Engineer, XenServer Engineering
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)

  reply	other threads:[~2010-09-08 15:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-01 15:00 [PATCH 05/13] Nested Virtualization: CRn & paged real mode Christoph Egger
2010-09-08 15:11 ` Tim Deegan [this message]
2010-09-08 15:42   ` Christoph Egger
2010-09-08 16:15     ` Tim Deegan
2010-10-15 13:03 Christoph Egger
2010-11-12 18:42 Christoph Egger
2010-11-16 13:19 ` Tim Deegan
2010-12-02 17:42   ` Christoph Egger

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=20100908151133.GC23487@whitby.uk.xensource.com \
    --to=tim.deegan@citrix.com \
    --cc=Christoph.Egger@amd.com \
    --cc=eddie.dong@intel.com \
    --cc=xen-devel@lists.xensource.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 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.