x86: defer a panic call during dom0 construction
PATCH 1/1 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 <[email protected]>
xen/arch/x86/domain_build.c +5 -1
@@ -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);