From: "Jan Beulich" Subject: [PATCH] shadow code printing adjustments Date: Thu, 11 Oct 2007 10:02:48 +0100 Message-ID: <470E02D8.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 Messages prior to BUG() should always be displayed, not just when DEBUG_TRACE_DUMP is defined (which by default it isn't). Convert them from SHADOW_PRINTK() to SHADOW_ERROR(). Signed-off-by: Jan Beulich Index: 2007-10-10/xen/arch/x86/mm/shadow/common.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 --- 2007-10-10.orig/xen/arch/x86/mm/shadow/common.c 2007-10-10 = 16:25:15.000000000 +0200 +++ 2007-10-10/xen/arch/x86/mm/shadow/common.c 2007-10-10 16:30:01.0000000= 00 +0200 @@ -746,7 +746,7 @@ void shadow_unhook_mappings(struct vcpu=20 break; #endif default: - SHADOW_PRINTK("top-level shadow has bad type %08x\n", sp->type); + SHADOW_ERROR("top-level shadow has bad type %08x\n", sp->type); BUG(); } } @@ -814,12 +814,12 @@ void shadow_prealloc(struct domain *d, u =20 /* Nothing more we can do: all remaining shadows are of pages that * hold Xen mappings for some vcpu. This can never happen. */ - SHADOW_PRINTK("Can't pre-allocate %i shadow pages!\n" - " shadow pages total =3D %u, free =3D %u, p2m=3D%u\n",= - 1 << order,=20 - d->arch.paging.shadow.total_pages,=20 - d->arch.paging.shadow.free_pages,=20 - d->arch.paging.shadow.p2m_pages); + SHADOW_ERROR("Can't pre-allocate %i shadow pages!\n" + " shadow pages total =3D %u, free =3D %u, p2m=3D%u\n", + 1 << order, + d->arch.paging.shadow.total_pages, + d->arch.paging.shadow.free_pages, + d->arch.paging.shadow.p2m_pages); BUG(); } =20 @@ -912,7 +912,7 @@ mfn_t shadow_alloc(struct domain *d, =20 * It means that we didn't call shadow_prealloc() correctly before * we allocated. We can't recover by calling prealloc here, because * we might free up higher-level pages that the caller is working on. = */ - SHADOW_PRINTK("Can't allocate %i shadow pages!\n", 1 << order); + SHADOW_ERROR("Can't allocate %i shadow pages!\n", 1 << order); BUG(); =20 found: @@ -1605,8 +1605,8 @@ void sh_destroy_shadow(struct vcpu *v, m break; #endif default: - SHADOW_PRINTK("tried to destroy shadow of bad type %08lx\n",=20 - (unsigned long)t); + SHADOW_ERROR("tried to destroy shadow of bad type %08lx\n", + (unsigned long)t); BUG(); } =20 } Index: 2007-10-10/xen/arch/x86/mm/shadow/multi.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 --- 2007-10-10.orig/xen/arch/x86/mm/shadow/multi.c 2007-09-27 = 10:42:44.000000000 +0200 +++ 2007-10-10/xen/arch/x86/mm/shadow/multi.c 2007-10-10 16:25:28.0000000= 00 +0200 @@ -2472,7 +2472,7 @@ sh_map_and_validate_gl4e(struct vcpu *v, shadow_l4_index,=20 validate_gl4e); #else // ! GUEST_PAGING_LEVELS >=3D 4 - SHADOW_PRINTK("called in wrong paging mode!\n"); + SHADOW_ERROR("called in wrong paging mode!\n"); BUG(); return 0; #endif=20 @@ -2488,7 +2488,7 @@ sh_map_and_validate_gl3e(struct vcpu *v, shadow_l3_index,=20 validate_gl3e); #else // ! GUEST_PAGING_LEVELS >=3D 4 - SHADOW_PRINTK("called in wrong paging mode!\n"); + SHADOW_ERROR("called in wrong paging mode!\n"); BUG(); return 0; #endif @@ -2514,7 +2514,7 @@ sh_map_and_validate_gl2he(struct vcpu *v shadow_l2_index,=20 validate_gl2e); #else /* Non-PAE guests don't have different kinds of l2 table */ - SHADOW_PRINTK("called in wrong paging mode!\n"); + SHADOW_ERROR("called in wrong paging mode!\n"); BUG(); return 0; #endif