Jan Beulich
2008-Jun-12 14:34 UTC
[Xen-devel] [PATCH] x86: defer a panic call during dom0 construction
We should try to avoid to panic with interrupts disabled, as panic() may imply use of the call-function-IPI (in the case of opt_noreboot being set), which asserts that interrupts are enabled. Signed-off-by: Jan Beulich <jbeulich@novell.com> Index: 2008-06-12/xen/arch/x86/domain_build.c ==================================================================--- 2008-06-12.orig/xen/arch/x86/domain_build.c 2008-06-12 09:08:19.000000000 +0200 +++ 2008-06-12/xen/arch/x86/domain_build.c 2008-06-12 09:08:31.000000000 +0200 @@ -784,7 +784,7 @@ int __init construct_dom0( while ( pfn < nr_pages ) { if ( (page = alloc_chunk(d, nr_pages - d->tot_pages)) == NULL ) - panic("Not enough RAM for DOM0 reservation.\n"); + break; while ( pfn < d->tot_pages ) { mfn = page_to_mfn(page); @@ -828,6 +828,10 @@ int __init construct_dom0( write_ptbase(current); local_irq_enable(); + /* Must call panic() with interrupts enabled. */ + if ( page == NULL ) + panic("Not enough RAM for DOM0 reservation.\n"); + #if defined(__i386__) /* Destroy low mappings - they were only for our convenience. */ zap_low_mappings(l2start); _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel