From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: Re: [PATCH 06/14] Nested Virtualization: CRn & paged real mode Date: Wed, 11 Aug 2010 11:12:07 +0200 Message-ID: <201008111112.08126.Christoph.Egger@amd.com> References: <201008051702.16950.Christoph.Egger@amd.com> <20100809124012.GZ13291@whitby.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20100809124012.GZ13291@whitby.uk.xensource.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Tim Deegan Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Monday 09 August 2010 14:40:12 Tim Deegan wrote: > > 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? Oh, I haven't considered about those bits. You are right, they should not be allowed for l2 guests. Thanks for bringing this up. Fixed in my local tree. Christoph > > 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 > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -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@lists.xensource.com > > http://lists.xensource.com/xen-devel -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632