[PATCH] ARM: give more detailed information about data aborts

Enrico Scholz enrico.scholz at sigma-chemnitz.de
Wed Dec 5 05:50:56 EST 2012


Sascha Hauer <s.hauer at 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.

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.


>> --- 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.

Having this option in the "Debugging" section of 'menuconfig' is expected
probably by the most users.  Making it architecture dependent requires
more or less invasive changes in the Kconfig infrastructure.


> Also it should depend on ARM_EXCEPTIONS.

ok


Enrico



More information about the barebox mailing list