ia64/xen-unstable

changeset 11211:a658663ab2d0

[HVM] Fix the APM BIOS to ensure that interrupts are enabled when it
executes an idling HLT. This allow us to re-enable the 'shutdown on
HLT-with-interrupts-disabled' heuristic.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Fri Aug 18 16:20:45 2006 +0100 (2006-08-18)
parents 28e9bba03425
children ca9f3a7b1b03
files tools/firmware/rombios/apmbios.S xen/arch/x86/hvm/hvm.c
line diff
     1.1 --- a/tools/firmware/rombios/apmbios.S	Fri Aug 18 15:24:10 2006 +0100
     1.2 +++ b/tools/firmware/rombios/apmbios.S	Fri Aug 18 16:20:45 2006 +0100
     1.3 @@ -225,7 +225,10 @@ APMSYM(04):
     1.4  APMSYM(05):
     1.5    cmp al, #0x05
     1.6    jne APMSYM(07)
     1.7 +  pushf ; XEN
     1.8 +  sti   ; XEN: OS calls us with ints disabled -- better re-enable here!
     1.9    hlt
    1.10 +  popf  ; XEN
    1.11    jmp APMSYM(ok)
    1.12  
    1.13  ;-----------------
     2.1 --- a/xen/arch/x86/hvm/hvm.c	Fri Aug 18 15:24:10 2006 +0100
     2.2 +++ b/xen/arch/x86/hvm/hvm.c	Fri Aug 18 16:20:45 2006 +0100
     2.3 @@ -345,13 +345,13 @@ int cpu_get_interrupt(struct vcpu *v, in
     2.4      return -1;
     2.5  }
     2.6  
     2.7 +#include <asm/hvm/vmx/vmx.h>
     2.8  void hvm_hlt(unsigned long rflags)
     2.9  {
    2.10      struct vcpu *v = current;
    2.11      struct periodic_time *pt = &v->domain->arch.hvm_domain.pl_time.periodic_tm;
    2.12      s_time_t next_pit = -1, next_wakeup;
    2.13  
    2.14 -#if 0 /* This seems to fire at unwelcome times in Linux */
    2.15      /*
    2.16       * Detect machine shutdown.  Only do this for vcpu 0, to avoid potentially 
    2.17       * shutting down the domain early. If we halt with interrupts disabled, 
    2.18 @@ -360,12 +360,11 @@ void hvm_hlt(unsigned long rflags)
    2.19       */
    2.20      if ( (v->vcpu_id == 0) && !(rflags & X86_EFLAGS_IF) )
    2.21      {
    2.22 -        printk("D%d: HLT with interrupts enabled -- shutting down.\n",
    2.23 +        printk("D%d: HLT with interrupts disabled -- shutting down.\n",
    2.24                 current->domain->domain_id);
    2.25          domain_shutdown(current->domain, SHUTDOWN_poweroff);
    2.26          return;
    2.27      }
    2.28 -#endif /* 0 */
    2.29  
    2.30      if ( !v->vcpu_id )
    2.31          next_pit = get_scheduled(v, pt->irq, pt);