[Skiboot] [PATCH] asm: Fix backtrace for unexpected exception

Michael Neuling mikey at neuling.org
Tue Aug 2 16:46:50 AEST 2016

If we take an unknown exception at boot time we attempt to put the
exception vector in the back trace, The result looks like this (when
we take an 0x700):

 S: 0000000031e838a0 R: 000000003001365c   .backtrace+0x38
 S: 0000000031e83930 R: 00000000300186cc   ._abort+0x4c
 S: 0000000031e839b0 R: 0000000030023a78   .exception_entry+0x114
 S: 0000000031e83a40 R: 0000000000001f04 * +0x1f04
 S: 0000000031e83c10 R: 0000000000000700 * +0x700
 S: 0000000031e83e30 R: 0000000030014444   .main_cpu_entry+0x444
 S: 0000000031e83f00 R: 000000003000259c   boot_entry+0x19c

We overwrite link address in the current stack frame with the
exception vector (ie. 0x700 in the above example). Unfortunately this
overrides the location that caused the exception, which is much more
useful information in debugging the problem.

This patch removes the writing link register in the current stack
frame, so the back trace now looks like this:

 S: 0000000031da38a0 R: 000000003001365c   .backtrace+0x38
 S: 0000000031da3930 R: 00000000300186cc   ._abort+0x4c
 S: 0000000031da39b0 R: 0000000030023a78   .exception_entry+0x114
 S: 0000000031da3a40 R: 0000000000001f00 * +0x1f00
 S: 0000000031da3c10 R: 00000000300323f8   .psi_init+0x1f4
 S: 0000000031da3e30 R: 0000000030014444   .main_cpu_entry+0x444
 S: 0000000031da3f00 R: 000000003000259c   boot_entry+0x19c

This loses the exception vector from the back trace, but this
information is already available in the exception dump just above it

Suggestion by benh.

Signed-off-by: Michael Neuling <mikey at neuling.org>
 asm/head.S | 1 -
 1 file changed, 1 deletion(-)

diff --git a/asm/head.S b/asm/head.S
index e92f9b8..227b1c3 100644
--- a/asm/head.S
+++ b/asm/head.S
@@ -150,7 +150,6 @@ hir_trigger:
 	.= 0x1e00
-	std	%r4,16(%r1)
 	stdu	%r1,-STACK_FRAMESIZE(%r1)
 	std	%r3,STACK_CFAR(%r1)
 	std	%r4,STACK_TYPE(%r1)

More information about the Skiboot mailing list