aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/exceptions-64s.S
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2011-05-01 15:48:20 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-05-04 01:22:09 -0400
commit48404f2e95ef0ffd8134d89c8abcd1a15e15f1b0 (patch)
treec1f55c2b59f4c32848152a4bdc23aac8537b8cbb /arch/powerpc/kernel/exceptions-64s.S
parent1977b502120d44b9b4897703adfb2e2fab346880 (diff)
powerpc: Save Come-From Address Register (CFAR) in exception frame
Recent 64-bit server processors (POWER6 and POWER7) have a "Come-From Address Register" (CFAR), that records the address of the most recent branch or rfid (return from interrupt) instruction for debugging purposes. This saves the value of the CFAR in the exception entry code and stores it in the exception frame. We also make xmon print the CFAR value in its register dump code. Rather than extend the pt_regs struct at this time, we steal the orig_gpr3 field, which is only used for system calls, and use it for the CFAR value for all exceptions/interrupts other than system calls. This means we don't save the CFAR on system calls, which is not a great problem since system calls tend not to happen unexpectedly, and also avoids adding the overhead of reading the CFAR to the system call entry path. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/exceptions-64s.S')
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 27ca8b7c6002..0ec3b42717d7 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -474,6 +474,10 @@ bad_stack:
474 std r9,GPR11(r1) 474 std r9,GPR11(r1)
475 std r10,GPR12(r1) 475 std r10,GPR12(r1)
476 std r11,GPR13(r1) 476 std r11,GPR13(r1)
477BEGIN_FTR_SECTION
478 ld r10,EX_CFAR(r3)
479 std r10,ORIG_GPR3(r1)
480END_FTR_SECTION_IFSET(CPU_FTR_CFAR)
477 SAVE_8GPRS(14,r1) 481 SAVE_8GPRS(14,r1)
478 SAVE_10GPRS(22,r1) 482 SAVE_10GPRS(22,r1)
479 lhz r12,PACA_TRAP_SAVE(r13) 483 lhz r12,PACA_TRAP_SAVE(r13)