From 7aa4b1bbc79df5e1063d88b803312295fa88f361 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Mon, 7 Jun 2010 16:41:19 +0100 Subject: [PATCH] x86: Force !in_irq() in machine_restart(). Various function we may call assert this fact. We just want to restart the system. Signed-off-by: Keir Fraser --- xen/arch/x86/shutdown.c | 7 +++++++ xen/arch/x86/tboot.c | 5 ----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/shutdown.c b/xen/arch/x86/shutdown.c index 15f5988af7..6466df4ee8 100644 --- a/xen/arch/x86/shutdown.c +++ b/xen/arch/x86/shutdown.c @@ -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); diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c index 63aba56820..aac0f82947 100644 --- a/xen/arch/x86/tboot.c +++ b/xen/arch/x86/tboot.c @@ -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); -- 2.30.2