From: kfraser@localhost.localdomain Date: Fri, 18 Aug 2006 15:20:45 +0000 (+0100) Subject: [HVM] Fix the APM BIOS to ensure that interrupts are enabled when it X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15710^2~40 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c724d70275cfd1256889283aeed99275dfc083e7;p=xen.git [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 --- diff --git a/tools/firmware/rombios/apmbios.S b/tools/firmware/rombios/apmbios.S index df8e106129..a010949f7d 100644 --- a/tools/firmware/rombios/apmbios.S +++ b/tools/firmware/rombios/apmbios.S @@ -225,7 +225,10 @@ APMSYM(04): 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 --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 2e78d2fe6b..48806c000e 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -345,13 +345,13 @@ int cpu_get_interrupt(struct vcpu *v, int *type) return -1; } +#include 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);