debuggers.hg

changeset 21076:bce90bb3ce2c

x86: Fix possible S3 suspend hangs

It is possible for cpu to become offlined before irq disabled in idle
loop, which will cause this cpu stay in C state and can't wakeup to
play dead.

Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Yu Ke <ke.yu@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Mar 15 13:17:38 2010 +0000 (2010-03-15)
parents 9300248eaad2
children c56b885e7deb
files xen/arch/x86/acpi/cpu_idle.c xen/arch/x86/domain.c
line diff
     1.1 --- a/xen/arch/x86/acpi/cpu_idle.c	Mon Mar 15 13:16:35 2010 +0000
     1.2 +++ b/xen/arch/x86/acpi/cpu_idle.c	Mon Mar 15 13:17:38 2010 +0000
     1.3 @@ -268,7 +268,8 @@ static void acpi_processor_idle(void)
     1.4       */
     1.5      local_irq_disable();
     1.6  
     1.7 -    if ( softirq_pending(smp_processor_id()) )
     1.8 +    if ( softirq_pending(smp_processor_id()) ||
     1.9 +         cpu_is_offline(smp_processor_id()) )
    1.10      {
    1.11          local_irq_enable();
    1.12          sched_tick_resume();
     2.1 --- a/xen/arch/x86/domain.c	Mon Mar 15 13:16:35 2010 +0000
     2.2 +++ b/xen/arch/x86/domain.c	Mon Mar 15 13:17:38 2010 +0000
     2.3 @@ -82,7 +82,8 @@ static void continue_nonidle_domain(stru
     2.4  static void default_idle(void)
     2.5  {
     2.6      local_irq_disable();
     2.7 -    if ( !softirq_pending(smp_processor_id()) )
     2.8 +    if ( !softirq_pending(smp_processor_id()) &&
     2.9 +         cpu_online(smp_processor_id()) )
    2.10          safe_halt();
    2.11      else
    2.12          local_irq_enable();