mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] ARM: give more detailed information about data aborts
Date: Wed, 5 Dec 2012 12:35:33 +0100	[thread overview]
Message-ID: <20121205113533.GE10369@pengutronix.de> (raw)
In-Reply-To: <lyd2yo3h7z.fsf@ensc-virt.intern.sigma-chemnitz.de>

On Wed, Dec 05, 2012 at 11:50:56AM +0100, Enrico Scholz wrote:
> Sascha Hauer <s.hauer@pengutronix.de> writes:
> 
> >> -	asm volatile ("mrc     p15, 0, %0, c6, c0, 0" : "=r" (far) : : "cc");
> >> -
> >> -	printf("unable to handle %s at address 0x%08x\n",
> >> -			far < PAGE_SIZE ? "NULL pointer dereference" :
> >> -			"paging request", far);
> >> +	if (!IS_ENABLED(CONFIG_VERBOSE_EXCEPTIONS)) {
> >> +		printf("data abort\n");
> >
> > Why don't you keep the original message here? The fault address is a very
> > useful information.
> 
> I think it is cleaner to implement a minimal + verbose variant, than a
> little-bit-minimal + verbose variant.

The faulting address shouldn't be dropped from the message. Also I like
to keep the "NULL pointer dereference" string. Please do not change the
message above at all, only print additional information if configured
in.

> 
> I am not sure since when (ARM architecture wise) FAR and DFSR (introduced
> by my patch) are available.  Value of FAR depends on the fault reason
> (e.g. it is invalid for imprecise external aborts or debug events) so
> printing FAR without DFSR might be misleading.

That of course must be checked. This option shouldn't be enabled when
not available on that CPU

> 
> 
> >> --- a/common/Kconfig
> >> +++ b/common/Kconfig
> >> @@ -668,6 +668,12 @@ config DEBUG_LL
> >>  	help
> >>  	  Enable this to get low level debug messages during barebox initialization.
> >>  
> >> +config VERBOSE_EXCEPTIONS
> >> +	bool "decode processor specific exceptions"
> >> +	default y
> >> +	help
> >> +	  Enable this to give out more detailed information about data aborts.
> >
> > This option should be in arch/arm/Kconfig since it's ARM specific.
> 
> I do not think that verbose exception messages are an ARM-only thing.
> atm, it is implemented for ARM only but similar code can be written for
> other architectures probably.

It could, but until this happens it should be ARM specific. We can
consolidate this should other architectures implement something like
this, but until then we shouldn't bother users with no-op options.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2012-12-05 11:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-04 12:04 Enrico Scholz
2012-12-05  9:43 ` Sascha Hauer
2012-12-05 10:50   ` Enrico Scholz
2012-12-05 11:35     ` Sascha Hauer [this message]

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=20121205113533.GE10369@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=enrico.scholz@sigma-chemnitz.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox