aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/exception-64s.h
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/include/asm/exception-64s.h
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/include/asm/exception-64s.h')
-rw-r--r--arch/powerpc/include/asm/exception-64s.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index 96ccef136ca9..f5dfe3411f64 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -46,6 +46,7 @@
46#define EX_CCR 60 46#define EX_CCR 60
47#define EX_R3 64 47#define EX_R3 64
48#define EX_LR 72 48#define EX_LR 72
49#define EX_CFAR 80
49 50
50/* 51/*
51 * We're short on space and time in the exception prolog, so we can't 52 * We're short on space and time in the exception prolog, so we can't
@@ -66,6 +67,10 @@
66 std r10,area+EX_R10(r13); \ 67 std r10,area+EX_R10(r13); \
67 std r11,area+EX_R11(r13); \ 68 std r11,area+EX_R11(r13); \
68 std r12,area+EX_R12(r13); \ 69 std r12,area+EX_R12(r13); \
70 BEGIN_FTR_SECTION_NESTED(66); \
71 mfspr r10,SPRN_CFAR; \
72 std r10,area+EX_CFAR(r13); \
73 END_FTR_SECTION_NESTED(CPU_FTR_CFAR, CPU_FTR_CFAR, 66); \
69 GET_SCRATCH0(r9); \ 74 GET_SCRATCH0(r9); \
70 std r9,area+EX_R13(r13); \ 75 std r9,area+EX_R13(r13); \
71 mfcr r9 76 mfcr r9
@@ -130,6 +135,10 @@
130 std r9,GPR11(r1); \ 135 std r9,GPR11(r1); \
131 std r10,GPR12(r1); \ 136 std r10,GPR12(r1); \
132 std r11,GPR13(r1); \ 137 std r11,GPR13(r1); \
138 BEGIN_FTR_SECTION_NESTED(66); \
139 ld r10,area+EX_CFAR(r13); \
140 std r10,ORIG_GPR3(r1); \
141 END_FTR_SECTION_NESTED(CPU_FTR_CFAR, CPU_FTR_CFAR, 66); \
133 ld r2,PACATOC(r13); /* get kernel TOC into r2 */ \ 142 ld r2,PACATOC(r13); /* get kernel TOC into r2 */ \
134 mflr r9; /* save LR in stackframe */ \ 143 mflr r9; /* save LR in stackframe */ \
135 std r9,_LINK(r1); \ 144 std r9,_LINK(r1); \