WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 06/14] Nested Virtualization: CRn & paged real mo

To: Christoph Egger <Christoph.Egger@xxxxxxx>
Subject: Re: [Xen-devel] [PATCH 06/14] Nested Virtualization: CRn & paged real mode
From: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Date: Mon, 9 Aug 2010 13:40:12 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 09 Aug 2010 05:41:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <201008051702.16950.Christoph.Egger@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <201008051702.16950.Christoph.Egger@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
> Allow paged real mode during vmrun emulation.
> Emulate cr0 and cr4 when guest does not intercept them.

I understand the paged-real-mode case, but why do you also allow CR0.CD
and CR0.NW for nested VMs?

Cheers,

Tim.

> diff -r 917f9eb07fc3 -r b1a356e5658d 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>
> @@ -1105,7 +1106,8 @@ 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;
>  
>      if ( (value & X86_CR0_PG) && !(old_value & X86_CR0_PG) )
> @@ -1159,7 +1161,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) )
>          {

Content-Description: ATT00001..txt
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel


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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>