x86/hvm: Allow wake up of offline vcpu via nmi-ipi
authorJuergen Gross <juergen.gross@ts.fujitsu.com>
Fri, 20 Jan 2012 10:17:12 +0000 (10:17 +0000)
committerJuergen Gross <juergen.gross@ts.fujitsu.com>
Fri, 20 Jan 2012 10:17:12 +0000 (10:17 +0000)
On a real machine a cpu disabled via hlt with interrupts disabled can
be reactivated via a nmi ipi. Enable the hypervisor to do this for
hvm, too.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
xen/arch/x86/hvm/vlapic.c

index b4142875ef480c6dd737e69dc3924fb159eb7ee1..6e3dc86f8cb6062bbf8b17994c376590889b7bb3 100644 (file)
@@ -323,7 +323,16 @@ static int vlapic_accept_irq(struct vcpu *v, uint32_t icr_low)
 
     case APIC_DM_NMI:
         if ( !test_and_set_bool(v->nmi_pending) )
+        {
+            bool_t wake = 0;
+            domain_lock(v->domain);
+            if ( v->is_initialised )
+                wake = test_and_clear_bit(_VPF_down, &v->pause_flags);
+            domain_unlock(v->domain);
+            if ( wake )
+                vcpu_wake(v);
             vcpu_kick(v);
+        }
         break;
 
     case APIC_DM_INIT: