ia64/xen-unstable

changeset 17181:017927162815

x86: On CPU shutdown, clear pending FPU exceptions.
I've seen at least one BIOS which fails warm reboot if FPU exceptions
are pending.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 04 10:33:50 2008 +0000 (2008-03-04)
parents 771c7124bf38
children d6e6ba8a72bf
files xen/arch/x86/smp.c
line diff
     1.1 --- a/xen/arch/x86/smp.c	Tue Mar 04 10:32:13 2008 +0000
     1.2 +++ b/xen/arch/x86/smp.c	Tue Mar 04 10:33:50 2008 +0000
     1.3 @@ -306,15 +306,26 @@ int on_selected_cpus(
     1.4      return 0;
     1.5  }
     1.6  
     1.7 -static void stop_this_cpu (void *dummy)
     1.8 +static void __stop_this_cpu(void)
     1.9  {
    1.10      ASSERT(!local_irq_is_enabled());
    1.11  
    1.12      disable_local_APIC();
    1.13 +
    1.14      hvm_cpu_down();
    1.15  
    1.16 +    /*
    1.17 +     * Clear FPU, zapping any pending exceptions. Needed for warm reset with
    1.18 +     * some BIOSes.
    1.19 +     */
    1.20 +    clts();
    1.21 +    asm volatile ( "fninit" );
    1.22 +}
    1.23 +
    1.24 +static void stop_this_cpu(void *dummy)
    1.25 +{
    1.26 +    __stop_this_cpu();
    1.27      cpu_clear(smp_processor_id(), cpu_online_map);
    1.28 -
    1.29      for ( ; ; )
    1.30          halt();
    1.31  }
    1.32 @@ -334,9 +345,8 @@ void smp_send_stop(void)
    1.33          mdelay(1);
    1.34  
    1.35      local_irq_disable();
    1.36 -    disable_local_APIC();
    1.37 +    __stop_this_cpu();
    1.38      disable_IO_APIC();
    1.39 -    hvm_cpu_down();
    1.40      local_irq_enable();
    1.41  }
    1.42