]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
Allow paged real mode during vmrun emulation.
authorcegger <none@none>
Mon, 28 Feb 2011 11:21:49 +0000 (12:21 +0100)
committercegger <none@none>
Mon, 28 Feb 2011 11:21:49 +0000 (12:21 +0100)
Emulate cr0 and cr4 when guest does not intercept them.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
xen/arch/x86/hvm/hvm.c

index 1d7db47dd15142c3475aed2857bdd05d283b0208..d52b4f8659786eae6d7aee8de68a02db9085766b 100644 (file)
@@ -55,6 +55,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>
@@ -1335,7 +1336,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_vmswitch_in_progress(v) &&
+         (value & (X86_CR0_PE | X86_CR0_PG)) == X86_CR0_PG )
         goto gpf;
 
     if ( (value & X86_CR0_PG) && !(old_value & X86_CR0_PG) )