[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [HVM] Fix the APM BIOS to ensure that interrupts are enabled when it



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID a658663ab2d0756f673a93f639d57569e7c66aa9
# Parent  28e9bba0342574ff971d1246f74d24009c897b36
[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@xxxxxxxxxxxxx>
---
 tools/firmware/rombios/apmbios.S |    3 +++
 xen/arch/x86/hvm/hvm.c           |    5 ++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff -r 28e9bba03425 -r a658663ab2d0 tools/firmware/rombios/apmbios.S
--- a/tools/firmware/rombios/apmbios.S  Fri Aug 18 15:24:10 2006 +0100
+++ b/tools/firmware/rombios/apmbios.S  Fri Aug 18 16:20:45 2006 +0100
@@ -225,7 +225,10 @@ APMSYM(05):
 APMSYM(05):
   cmp al, #0x05
   jne APMSYM(07)
+  pushf ; XEN
+  sti   ; XEN: OS calls us with ints disabled -- better re-enable here!
   hlt
+  popf  ; XEN
   jmp APMSYM(ok)
 
 ;-----------------
diff -r 28e9bba03425 -r a658663ab2d0 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Fri Aug 18 15:24:10 2006 +0100
+++ b/xen/arch/x86/hvm/hvm.c    Fri Aug 18 16:20:45 2006 +0100
@@ -345,13 +345,13 @@ int cpu_get_interrupt(struct vcpu *v, in
     return -1;
 }
 
+#include <asm/hvm/vmx/vmx.h>
 void hvm_hlt(unsigned long rflags)
 {
     struct vcpu *v = current;
     struct periodic_time *pt = &v->domain->arch.hvm_domain.pl_time.periodic_tm;
     s_time_t next_pit = -1, next_wakeup;
 
-#if 0 /* This seems to fire at unwelcome times in Linux */
     /*
      * Detect machine shutdown.  Only do this for vcpu 0, to avoid potentially 
      * shutting down the domain early. If we halt with interrupts disabled, 
@@ -360,12 +360,11 @@ void hvm_hlt(unsigned long rflags)
      */
     if ( (v->vcpu_id == 0) && !(rflags & X86_EFLAGS_IF) )
     {
-        printk("D%d: HLT with interrupts enabled -- shutting down.\n",
+        printk("D%d: HLT with interrupts disabled -- shutting down.\n",
                current->domain->domain_id);
         domain_shutdown(current->domain, SHUTDOWN_poweroff);
         return;
     }
-#endif /* 0 */
 
     if ( !v->vcpu_id )
         next_pit = get_scheduled(v, pt->irq, pt);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.