[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4DA7A914.5020804@codeaurora.org>
Date: Thu, 14 Apr 2011 19:10:28 -0700
From: Stephen Boyd <sboyd@...eaurora.org>
To: Simon Glass <sjg@...omium.org>
CC: linux-arm-kernel@...ts.infradead.org,
Russell King <linux@....linux.org.uk>,
Tony Lindgren <tony@...mide.com>,
Nicolas Pitre <nicolas.pitre@...aro.org>,
Catalin Marinas <catalin.marinas@....com>,
Joe Perches <joe@...ches.com>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Alexander Shishkin <virtuoso@...nd.org>,
Phil Carmody <ext-phil.2.carmody@...ia.com>,
Rabin Vincent <rabin@....in>, linux-kernel@...r.kernel.org,
Omar Ramirez Luna <omar.ramirez@...com>,
Dave Martin <dave.martin@...aro.org>,
Simon Glass <sjg@...gle.com>
Subject: Re: [PATCH v4] ARM: Use generic BUG() handler
On 04/14/2011 04:00 PM, Simon Glass wrote:
> From: Simon Glass <sjg@...gle.com>
>
> ARM uses its own BUG() handler which makes its output slightly different
> from other archtectures.
>
> One of the problems is that the ARM implementation doesn't report the function
> with the BUG() in it, but always reports the PC being in __bug(). The generic
> implementation doesn't have this problem.
>
> Currently we get something like:
>
> kernel BUG at fs/proc/breakme.c:35!
> Unable to handle kernel NULL pointer dereference at virtual address 00000000
> ...
> PC is at __bug+0x20/0x2c
>
> With this patch it displays:
>
> kernel BUG at fs/proc/breakme.c:35!
> Internal error: Oops - undefined instruction: 0 [#1] PREEMPT SMP
> ...
> PC is at write_breakme+0xd0/0x1b4
>
> This implementation uses an undefined instruction to implement BUG, and sets up
> a bug table containing the relevant information. Many versions of gcc do not
> support %c properly for ARM (inserting a # when they shouldn't) so we work
> around this using distasteful macro magic.
>
> v1: Initial version to replace existing ARM BUG() implementation with something
> more similar to other architectures.
>
> v2: Add Thumb support, remove backtrace whitespace output changes. Change to
> use macros instead of requiring the asm %d flag to work (thanks to
> Dave Martin <dave.martin@...aro.org>)
>
> v3: Remove old BUG() implementation in favor of this one.
> Remove the Backtrace: message (will submit this separately).
> Use ARM_EXIT_KEEP() so that some architectures can dump exit text at link time
> thanks to Stephen Boyd <sboyd@...eaurora.org> (although since we always
> define GENERIC_BUG this might be academic.)
> Rebase to linux-2.6.git master.
>
> v4: Allow BUGS in modules (these were not reported correctly in v3)
> (thanks to Stephen Boyd <sboyd@...eaurora.org> for suggesting that.)
> Remove __bug() as this is no longer needed.
>
> Signed-off-by: Simon Glass <sjg@...omium.org>
Reviewed-by: Stephen Boyd <sboyd@...eaurora.org>
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists