debuggers.hg

changeset 21102:ec8f2e7dea44 4.0.0-rc7

x86: s3: ensure CR4.MCE is enabled after mcheck_init()

Changeset 21045: 7751288b1386 introduces a potential issue: CR4.MCE is
enabled before mcheck_init() -- thought looks I don't meet with an
actual issue with this, we'd better fix it.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 23 09:35:31 2010 +0000 (2010-03-23)
parents d6d3a704e7c1
children 0475c567c708
files xen/arch/x86/acpi/power.c
line diff
     1.1 --- a/xen/arch/x86/acpi/power.c	Tue Mar 23 07:32:04 2010 +0000
     1.2 +++ b/xen/arch/x86/acpi/power.c	Tue Mar 23 09:35:31 2010 +0000
     1.3 @@ -147,6 +147,7 @@ static int enter_state(u32 state)
     1.4  {
     1.5      unsigned long flags;
     1.6      int error;
     1.7 +    unsigned long cr4;
     1.8  
     1.9      if ( (state <= ACPI_STATE_S0) || (state > ACPI_S_STATES_MAX) )
    1.10          return -EINVAL;
    1.11 @@ -201,13 +202,15 @@ static int enter_state(u32 state)
    1.12      }
    1.13  
    1.14      /* Restore CR4 and EFER from cached values. */
    1.15 -    write_cr4(read_cr4());
    1.16 +    cr4 = read_cr4();
    1.17 +    write_cr4(cr4 & ~X86_CR4_MCE);
    1.18      if ( cpu_has_efer )
    1.19          write_efer(read_efer());
    1.20  
    1.21      device_power_up();
    1.22  
    1.23      mcheck_init(&boot_cpu_data);
    1.24 +    write_cr4(cr4);
    1.25  
    1.26      printk(XENLOG_INFO "Finishing wakeup from ACPI S%d state.\n", state);
    1.27