]> xenbits.xensource.com Git - xen.git/commitdiff
x86: Force !in_irq() in machine_restart().
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 7 Jun 2010 15:41:19 +0000 (16:41 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 7 Jun 2010 15:41:19 +0000 (16:41 +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/arch/x86/shutdown.c
xen/arch/x86/tboot.c

index 15f5988af7874273ed7daa54c67ff42110ca628a..6466df4ee893fb9dee8d33de744eedc9fcff7ed0 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 63aba56820838c90fd341ab6d3fb88405b3922db..aac0f82947e346ed418e255fda2dfb46f4f895fb 100644 (file)
@@ -334,11 +334,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);