All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Simon Glass <sjg@chromium.org>
Cc: linux-arm-kernel@lists.infradead.org,
	Russell King <linux@arm.linux.org.uk>,
	Tony Lindgren <tony@atomide.com>,
	Nicolas Pitre <nicolas.pitre@linaro.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Joe Perches <joe@perches.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Alexander Shishkin <virtuoso@slind.org>,
	Phil Carmody <ext-phil.2.carmody@nokia.com>,
	Rabin Vincent <rabin@rab.in>,
	linux-kernel@vger.kernel.org,
	Omar Ramirez Luna <omar.ramirez@ti.com>,
	Dave Martin <dave.martin@linaro.org>,
	Simon Glass <sjg@google.com>
Subject: Re: [PATCH v4] ARM: Use generic BUG() handler
Date: Thu, 14 Apr 2011 19:10:28 -0700	[thread overview]
Message-ID: <4DA7A914.5020804@codeaurora.org> (raw)
In-Reply-To: <1302822031-6752-1-git-send-email-sjg@chromium.org>

On 04/14/2011 04:00 PM, Simon Glass wrote:
> From: Simon Glass <sjg@google.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@linaro.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@codeaurora.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@codeaurora.org> for suggesting that.)
> Remove __bug() as this is no longer needed.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.


WARNING: multiple messages have this Message-ID (diff)
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4] ARM: Use generic BUG() handler
Date: Thu, 14 Apr 2011 19:10:28 -0700	[thread overview]
Message-ID: <4DA7A914.5020804@codeaurora.org> (raw)
In-Reply-To: <1302822031-6752-1-git-send-email-sjg@chromium.org>

On 04/14/2011 04:00 PM, Simon Glass wrote:
> From: Simon Glass <sjg@google.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@linaro.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@codeaurora.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@codeaurora.org> for suggesting that.)
> Remove __bug() as this is no longer needed.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

  reply	other threads:[~2011-04-15  2:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-14 23:00 [PATCH v4] ARM: Use generic BUG() handler Simon Glass
2011-04-14 23:00 ` Simon Glass
2011-04-15  2:10 ` Stephen Boyd [this message]
2011-04-15  2:10   ` Stephen Boyd
2011-04-20  2:40   ` Simon Glass
2011-04-20  2:40     ` Simon Glass
2011-04-20  4:43     ` anish singh
2011-04-20 18:01       ` Stephen Boyd
2011-04-20 18:01         ` Stephen Boyd
2011-04-20 18:37         ` Ramirez Luna, Omar
2011-04-20 18:37           ` Ramirez Luna, Omar
2011-04-26  1:47         ` Olof Johansson
2011-04-26  1:47           ` Olof Johansson
2011-05-20  5:24           ` Simon Glass
2011-05-20  5:24             ` Simon Glass
2011-07-06 20:06             ` Russell King - ARM Linux
2011-07-06 20:06               ` Russell King - ARM Linux
2011-07-07  9:28               ` Dave Martin
2011-07-07  9:28                 ` Dave Martin
2011-07-12  0:01                 ` Simon Glass
2011-07-12  0:01                   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DA7A914.5020804@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=catalin.marinas@arm.com \
    --cc=dave.martin@linaro.org \
    --cc=ext-phil.2.carmody@nokia.com \
    --cc=joe@perches.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=nicolas.pitre@linaro.org \
    --cc=omar.ramirez@ti.com \
    --cc=rabin@rab.in \
    --cc=sjg@chromium.org \
    --cc=sjg@google.com \
    --cc=tony@atomide.com \
    --cc=virtuoso@slind.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.