# HG changeset patch # User cegger # Date 1289574161 -3600 Allow paged real mode during vmrun emulation. Emulate cr0 and cr4 when guest does not intercept them. Signed-off-by: Christoph Egger diff -r 5ea6bde78dc6 -r 7edc8a5266f9 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 @@ -1096,7 +1097,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) ) @@ -1150,7 +1152,7 @@ int hvm_set_cr0(unsigned long value) } } - if ( has_arch_mmios(v->domain) ) + if ( !nestedhvm_vmswitch_in_progress(v) && has_arch_mmios(v->domain) ) { if ( (value & X86_CR0_CD) && !(value & X86_CR0_NW) ) {