From: "Jan Beulich" Subject: [PATCH] x86: defer a panic call during dom0 construction Date: Thu, 12 Jun 2008 15:34:57 +0100 Message-ID: <48515031.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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 Index: 2008-06-12/xen/arch/x86/domain_build.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2008-06-12.orig/xen/arch/x86/domain_build.c 2008-06-12 09:08:19.0000000= 00 +0200 +++ 2008-06-12/xen/arch/x86/domain_build.c 2008-06-12 09:08:31.0000000= 00 +0200 @@ -784,7 +784,7 @@ int __init construct_dom0( while ( pfn < nr_pages ) { if ( (page =3D alloc_chunk(d, nr_pages - d->tot_pages)) =3D=3D = NULL ) - panic("Not enough RAM for DOM0 reservation.\n"); + break; while ( pfn < d->tot_pages ) { mfn =3D page_to_mfn(page); @@ -828,6 +828,10 @@ int __init construct_dom0( write_ptbase(current); local_irq_enable(); =20 + /* Must call panic() with interrupts enabled. */ + if ( page =3D=3D 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);