aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/include/asm/exception-64s.h8
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S5
2 files changed, 13 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index 66830618cc19..aeaa56cd9b54 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -147,6 +147,14 @@ BEGIN_FTR_SECTION_NESTED(943) \
147END_FTR_SECTION_NESTED(ftr,ftr,943) 147END_FTR_SECTION_NESTED(ftr,ftr,943)
148 148
149/* 149/*
150 * Set an SPR from a register if the CPU has the given feature
151 */
152#define OPT_SET_SPR(ra, spr, ftr) \
153BEGIN_FTR_SECTION_NESTED(943) \
154 mtspr spr,ra; \
155END_FTR_SECTION_NESTED(ftr,ftr,943)
156
157/*
150 * Save a register to the PACA if the CPU has the given feature 158 * Save a register to the PACA if the CPU has the given feature
151 */ 159 */
152#define OPT_SAVE_REG_TO_PACA(offset, ra, ftr) \ 160#define OPT_SAVE_REG_TO_PACA(offset, ra, ftr) \
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 38d507306a11..4c34c3c827ad 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -164,13 +164,18 @@ BEGIN_FTR_SECTION
164 */ 164 */
165 mfspr r13,SPRN_SRR1 165 mfspr r13,SPRN_SRR1
166 rlwinm. r13,r13,47-31,30,31 166 rlwinm. r13,r13,47-31,30,31
167 OPT_GET_SPR(r13, SPRN_CFAR, CPU_FTR_CFAR)
167 beq 9f 168 beq 9f
168 169
170 mfspr r13,SPRN_SRR1
171 rlwinm. r13,r13,47-31,30,31
169 /* waking up from powersave (nap) state */ 172 /* waking up from powersave (nap) state */
170 cmpwi cr1,r13,2 173 cmpwi cr1,r13,2
171 /* Total loss of HV state is fatal. let's just stay stuck here */ 174 /* Total loss of HV state is fatal. let's just stay stuck here */
175 OPT_GET_SPR(r13, SPRN_CFAR, CPU_FTR_CFAR)
172 bgt cr1,. 176 bgt cr1,.
1739: 1779:
178 OPT_SET_SPR(r13, SPRN_CFAR, CPU_FTR_CFAR)
174END_FTR_SECTION_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206) 179END_FTR_SECTION_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206)
175#endif /* CONFIG_PPC_P7_NAP */ 180#endif /* CONFIG_PPC_P7_NAP */
176 EXCEPTION_PROLOG_0(PACA_EXMC) 181 EXCEPTION_PROLOG_0(PACA_EXMC)