]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
x86: Force !in_irq() in machine_restart().
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 10 Jun 2010 09:09:58 +0000 (10:09 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 10 Jun 2010 09:09:58 +0000 (10:09 +0100)
Various function we may call assert this fact. We just want to restart
the system.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset:   21550:cb75117829a6
xen-unstable date:        Mon Jun 07 16:41:19 2010 +0100

xen/arch/x86/shutdown.c
xen/arch/x86/tboot.c

index 18340e5b25a321e38af323d302db770f836a865d..9d846db8f406a0779fff67f0f6c80993baadb09b 100644 (file)
@@ -316,6 +316,13 @@ void machine_restart(unsigned int delay_millisecs)
             halt();
     }
 
+    /*
+     * We may be called from an interrupt context, and various functions we
+     * may need to call (alloc_domheap_pages, map_domain_page, ...) assert that
+     * they are not called from interrupt context. This hack keeps them happy.
+     */
+    local_irq_count(0) = 0;
+
     smp_send_stop();
 
     mdelay(delay_millisecs);
index d6a56cf435b3e864c795bf281d14fe66596605f0..496ab8208ba013aec7859f8105b22fca955ec58d 100644 (file)
@@ -284,11 +284,6 @@ void tboot_shutdown(uint32_t shutdown_type)
 
     local_irq_disable();
 
-    /* we may be called from an interrupt context, so to prevent */
-    /* 'ASSERT(!in_irq());' in alloc_domheap_pages(), decrease count */
-    while ( in_irq() )
-        irq_exit();
-
     /* Create identity map for tboot shutdown code. */
     /* do before S3 integrity because mapping tboot may change xenheap */
     map_base = PFN_DOWN(g_tboot_shared->tboot_base);