From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell King Subject: Re: [PATCH 1/23] Make register values available to panic notifiers Date: Mon, 12 Apr 2010 13:24:33 +0100 Message-ID: <20100412122433.GB28208@flint.arm.linux.org.uk> References: <20100412060609.GA25273@dvomlehn-lnx2.corp.sa.net> <20100412120330.GA2566@osiris.boeblingen.de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20100412120330.GA2566@osiris.boeblingen.de.ibm.com> Sender: linux-kernel-owner@vger.kernel.org To: Heiko Carstens Cc: David VomLehn , to@dvomlehn-lnx2.corp.sa.net, "linux-arch@vger.kernel.org"@cisco.comlinux-arch@vger.kernel.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, maint_arch@dvomlehn-lnx2.corp.sa.net List-Id: linux-arch.vger.kernel.org On Mon, Apr 12, 2010 at 02:03:30PM +0200, Heiko Carstens wrote: > Wouldn't it be much easier to implement panic with an illegal op and let > the exception handler set up the pt regs structure instead? Just like some > architectures do that already for warnings. > Have a look at lib/bug.c and at various arch/<...>/include/asm/bug.h. > BUG_FLAG_PANIC would do the trick. You also have the problem that there are panic() statements before exception vectors are setup. Eg, using lmb, you might want to allocate a page for a L2 page table so you can setup the exception vectors, but the lmb allocator has a panic statement which will be used on failure to allocate a page. The result is that you don't know why you didn't boot since there's no diagnostics from the kernel. At least with the current setup, merely (re)directing the kernel printk output results in something you can read. -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from caramon.arm.linux.org.uk ([78.32.30.218]:55282 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751031Ab0DLMZg (ORCPT ); Mon, 12 Apr 2010 08:25:36 -0400 Date: Mon, 12 Apr 2010 13:24:33 +0100 From: Russell King Subject: Re: [PATCH 1/23] Make register values available to panic notifiers Message-ID: <20100412122433.GB28208@flint.arm.linux.org.uk> References: <20100412060609.GA25273@dvomlehn-lnx2.corp.sa.net> <20100412120330.GA2566@osiris.boeblingen.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100412120330.GA2566@osiris.boeblingen.de.ibm.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Heiko Carstens Cc: David VomLehn , to@dvomlehn-lnx2.corp.sa.net, "linux-arch@vger.kernel.org"@cisco.comlinux-arch@vger.kernel.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, maint_arch@dvomlehn-lnx2.corp.sa.net Message-ID: <20100412122433.tyDUbJUTw_3S5n6jexggFKLmFWPH4oQuns4NzDOT8KY@z> On Mon, Apr 12, 2010 at 02:03:30PM +0200, Heiko Carstens wrote: > Wouldn't it be much easier to implement panic with an illegal op and let > the exception handler set up the pt regs structure instead? Just like some > architectures do that already for warnings. > Have a look at lib/bug.c and at various arch/<...>/include/asm/bug.h. > BUG_FLAG_PANIC would do the trick. You also have the problem that there are panic() statements before exception vectors are setup. Eg, using lmb, you might want to allocate a page for a L2 page table so you can setup the exception vectors, but the lmb allocator has a panic statement which will be used on failure to allocate a page. The result is that you don't know why you didn't boot since there's no diagnostics from the kernel. At least with the current setup, merely (re)directing the kernel printk output results in something you can read. -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: