direct-io.hg

changeset 15423:5eec9a8825d4

Fix VMX guest can't boot after MCE enabled.
Signed-off-by: Xin Li <xin.b.li@intel.com>
author Keir Fraser <keir@xensource.com>
date Wed Jun 27 20:08:21 2007 +0100 (2007-06-27)
parents 16f35bea00f8
children 87d34c8c2fe1
files xen/arch/x86/hvm/vmx/vmx.c xen/include/asm-x86/processor.h
line diff
     1.1 --- a/xen/arch/x86/hvm/vmx/vmx.c	Wed Jun 27 20:00:50 2007 +0100
     1.2 +++ b/xen/arch/x86/hvm/vmx/vmx.c	Wed Jun 27 20:08:21 2007 +0100
     1.3 @@ -2387,14 +2387,15 @@ static int mov_to_cr(int gp, int cr, str
     1.4      case 4: /* CR4 */
     1.5          old_cr = v->arch.hvm_vmx.cpu_shadow_cr4;
     1.6  
     1.7 -        if ( value & ~mmu_cr4_features )
     1.8 +        if ( value & X86_CR4_RESERVED_BITS )
     1.9          {
    1.10 -            HVM_DBG_LOG(DBG_LEVEL_1, "Guest attempts to enable unsupported "
    1.11 -                        "CR4 features %lx (host %lx)",
    1.12 -                        value, mmu_cr4_features);
    1.13 +            HVM_DBG_LOG(DBG_LEVEL_1,
    1.14 +                        "Guest attempts to set reserved bit in CR4: %lx",
    1.15 +                        value);
    1.16              vmx_inject_hw_exception(v, TRAP_gp_fault, 0);
    1.17              break;
    1.18          }
    1.19 +
    1.20          if ( (value & X86_CR4_PAE) && !(old_cr & X86_CR4_PAE) )
    1.21          {
    1.22              if ( vmx_pgbit_test(v) )
     2.1 --- a/xen/include/asm-x86/processor.h	Wed Jun 27 20:00:50 2007 +0100
     2.2 +++ b/xen/include/asm-x86/processor.h	Wed Jun 27 20:08:21 2007 +0100
     2.3 @@ -81,6 +81,12 @@
     2.4  #define X86_CR4_OSXMMEXCPT	0x0400	/* enable unmasked SSE exceptions */
     2.5  #define X86_CR4_VMXE		0x2000  /* enable VMX */
     2.6  
     2.7 +#define X86_CR4_RESERVED_BITS   \
     2.8 +    ~(X86_CR4_VME | X86_CR4_PVI | X86_CR4_TSD | \
     2.9 +      X86_CR4_DE  | X86_CR4_PSE | X86_CR4_PAE | \
    2.10 +      X86_CR4_MCE | X86_CR4_PGE | X86_CR4_PCE | \
    2.11 +      X86_CR4_OSFXSR | X86_CR4_OSXMMEXCPT | X86_CR4_VMXE)
    2.12 +
    2.13  /*
    2.14   * Trap/fault mnemonics.
    2.15   */