aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-04-05 00:20:31 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-04-19 21:03:22 -0400
commita5d4f3ad3a28cf046836b9bfae61d532b8f77036 (patch)
tree6940ace9422e91459d819b385dacf9b2ab44bd50 /arch
parent2dd60d79e0202628a47af9812a84d502cc63628c (diff)
powerpc: Base support for exceptions using HSRR0/1
Pass the register type to the prolog, also provides alternate "HV" version of hardware interrupt (0x500) and adjust LPES accordingly We tag those interrupts by setting bit 0x2 in the trap number Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/include/asm/exception-64s.h65
-rw-r--r--arch/powerpc/include/asm/kvm_asm.h1
-rw-r--r--arch/powerpc/include/asm/kvm_book3s_asm.h1
-rw-r--r--arch/powerpc/kernel/cpu_setup_power7.S3
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S48
-rw-r--r--arch/powerpc/kvm/book3s_rmhandlers.S1
-rw-r--r--arch/powerpc/kvm/book3s_segment.S10
-rw-r--r--arch/powerpc/platforms/iseries/exception.S2
-rw-r--r--arch/powerpc/platforms/iseries/exception.h4
9 files changed, 86 insertions, 49 deletions
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index 337b6fa2f8cd..1d98e05be511 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -56,30 +56,37 @@
56#define LOAD_HANDLER(reg, label) \ 56#define LOAD_HANDLER(reg, label) \
57 addi reg,reg,(label)-_stext; /* virt addr of handler ... */ 57 addi reg,reg,(label)-_stext; /* virt addr of handler ... */
58 58
59#define EXCEPTION_PROLOG_1(area) \ 59/* Exception register prefixes */
60#define EXC_HV H
61#define EXC_STD
62
63#define __EXCEPTION_PROLOG_1(area, h) \
60 GET_PACA(r13); \ 64 GET_PACA(r13); \
61 std r9,area+EX_R9(r13); /* save r9 - r12 */ \ 65 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
62 std r10,area+EX_R10(r13); \ 66 std r10,area+EX_R10(r13); \
63 std r11,area+EX_R11(r13); \ 67 std r11,area+EX_R11(r13); \
64 std r12,area+EX_R12(r13); \ 68 std r12,area+EX_R12(r13); \
65 mfspr r9,SPRN_SPRG_SCRATCH0; \ 69 mfspr r9,SPRN_SPRG_##h##SCRATCH0; \
66 std r9,area+EX_R13(r13); \ 70 std r9,area+EX_R13(r13); \
67 mfcr r9 71 mfcr r9
72#define EXCEPTION_PROLOG_1(area, h) __EXCEPTION_PROLOG_1(area, h)
68 73
69#define EXCEPTION_PROLOG_PSERIES_1(label) \ 74#define __EXCEPTION_PROLOG_PSERIES_1(label, h) \
70 ld r12,PACAKBASE(r13); /* get high part of &label */ \ 75 ld r12,PACAKBASE(r13); /* get high part of &label */ \
71 ld r10,PACAKMSR(r13); /* get MSR value for kernel */ \ 76 ld r10,PACAKMSR(r13); /* get MSR value for kernel */ \
72 mfspr r11,SPRN_SRR0; /* save SRR0 */ \ 77 mfspr r11,SPRN_##h##SRR0; /* save SRR0 */ \
73 LOAD_HANDLER(r12,label) \ 78 LOAD_HANDLER(r12,label) \
74 mtspr SPRN_SRR0,r12; \ 79 mtspr SPRN_##h##SRR0,r12; \
75 mfspr r12,SPRN_SRR1; /* and SRR1 */ \ 80 mfspr r12,SPRN_##h##SRR1; /* and SRR1 */ \
76 mtspr SPRN_SRR1,r10; \ 81 mtspr SPRN_##h##SRR1,r10; \
77 rfid; \ 82 h##rfid; \
78 b . /* prevent speculative execution */ 83 b . /* prevent speculative execution */
84#define EXCEPTION_PROLOG_PSERIES_1(label, h) \
85 __EXCEPTION_PROLOG_PSERIES_1(label, h)
79 86
80#define EXCEPTION_PROLOG_PSERIES(area, label) \ 87#define EXCEPTION_PROLOG_PSERIES(area, label, h) \
81 EXCEPTION_PROLOG_1(area); \ 88 EXCEPTION_PROLOG_1(area, h); \
82 EXCEPTION_PROLOG_PSERIES_1(label); 89 EXCEPTION_PROLOG_PSERIES_1(label, h);
83 90
84/* 91/*
85 * The common exception prolog is used for all except a few exceptions 92 * The common exception prolog is used for all except a few exceptions
@@ -150,50 +157,44 @@ label##_pSeries: \
150 HMT_MEDIUM; \ 157 HMT_MEDIUM; \
151 DO_KVM n; \ 158 DO_KVM n; \
152 mtspr SPRN_SPRG_SCRATCH0,r13; /* save r13 */ \ 159 mtspr SPRN_SPRG_SCRATCH0,r13; /* save r13 */ \
153 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common) 160 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common, EXC_STD)
154 161
155#define HSTD_EXCEPTION_PSERIES(n, label) \ 162#define HSTD_EXCEPTION_PSERIES(n, label) \
156 . = n; \ 163 . = n; \
157 .globl label##_pSeries; \ 164 .globl label##_pSeries; \
158label##_pSeries: \ 165label##_pSeries: \
159 HMT_MEDIUM; \ 166 HMT_MEDIUM; \
160 mtspr SPRN_SPRG_SCRATCH0,r20; /* save r20 */ \ 167 DO_KVM n; \
161 mfspr r20,SPRN_HSRR0; /* copy HSRR0 to SRR0 */ \ 168 mtspr SPRN_SPRG_HSCRATCH0,r13;/* save r13 */ \
162 mtspr SPRN_SRR0,r20; \ 169 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common, EXC_HV)
163 mfspr r20,SPRN_HSRR1; /* copy HSRR0 to SRR0 */ \
164 mtspr SPRN_SRR1,r20; \
165 mfspr r20,SPRN_SPRG_SCRATCH0; /* restore r20 */ \
166 mtspr SPRN_SPRG_SCRATCH0,r13; /* save r13 */ \
167 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common)
168 170
169 171
170#define MASKABLE_EXCEPTION_PSERIES(n, label) \ 172#define __MASKABLE_EXCEPTION_PSERIES(n, label, h) \
171 . = n; \
172 .globl label##_pSeries; \
173label##_pSeries: \
174 HMT_MEDIUM; \ 173 HMT_MEDIUM; \
175 DO_KVM n; \ 174 DO_KVM n; \
176 mtspr SPRN_SPRG_SCRATCH0,r13; /* save r13 */ \ 175 mtspr SPRN_SPRG_##h##SCRATCH0,r13; /* save r13 */ \
177 GET_PACA(r13); \ 176 GET_PACA(r13); \
178 std r9,PACA_EXGEN+EX_R9(r13); /* save r9, r10 */ \ 177 std r9,PACA_EXGEN+EX_R9(r13); /* save r9, r10 */ \
179 std r10,PACA_EXGEN+EX_R10(r13); \ 178 std r10,PACA_EXGEN+EX_R10(r13); \
180 lbz r10,PACASOFTIRQEN(r13); \ 179 lbz r10,PACASOFTIRQEN(r13); \
181 mfcr r9; \ 180 mfcr r9; \
182 cmpwi r10,0; \ 181 cmpwi r10,0; \
183 beq masked_interrupt; \ 182 beq masked_##h##interrupt; \
184 mfspr r10,SPRN_SPRG_SCRATCH0; \ 183 mfspr r10,SPRN_SPRG_##h##SCRATCH0; \
185 std r10,PACA_EXGEN+EX_R13(r13); \ 184 std r10,PACA_EXGEN+EX_R13(r13); \
186 std r11,PACA_EXGEN+EX_R11(r13); \ 185 std r11,PACA_EXGEN+EX_R11(r13); \
187 std r12,PACA_EXGEN+EX_R12(r13); \ 186 std r12,PACA_EXGEN+EX_R12(r13); \
188 ld r12,PACAKBASE(r13); /* get high part of &label */ \ 187 ld r12,PACAKBASE(r13); /* get high part of &label */ \
189 ld r10,PACAKMSR(r13); /* get MSR value for kernel */ \ 188 ld r10,PACAKMSR(r13); /* get MSR value for kernel */ \
190 mfspr r11,SPRN_SRR0; /* save SRR0 */ \ 189 mfspr r11,SPRN_##h##SRR0; /* save SRR0 */ \
191 LOAD_HANDLER(r12,label##_common) \ 190 LOAD_HANDLER(r12,label##_common) \
192 mtspr SPRN_SRR0,r12; \ 191 mtspr SPRN_##h##SRR0,r12; \
193 mfspr r12,SPRN_SRR1; /* and SRR1 */ \ 192 mfspr r12,SPRN_##h##SRR1; /* and SRR1 */ \
194 mtspr SPRN_SRR1,r10; \ 193 mtspr SPRN_##h##SRR1,r10; \
195 rfid; \ 194 h##rfid; \
196 b . /* prevent speculative execution */ 195 b . /* prevent speculative execution */
196#define MASKABLE_EXCEPTION_PSERIES(n, label, h) \
197 __MASKABLE_EXCEPTION_PSERIES(n, label, h)
197 198
198#ifdef CONFIG_PPC_ISERIES 199#ifdef CONFIG_PPC_ISERIES
199#define DISABLE_INTS \ 200#define DISABLE_INTS \
diff --git a/arch/powerpc/include/asm/kvm_asm.h b/arch/powerpc/include/asm/kvm_asm.h
index 5b7504674397..0951b17f4eb5 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -59,6 +59,7 @@
59#define BOOK3S_INTERRUPT_INST_SEGMENT 0x480 59#define BOOK3S_INTERRUPT_INST_SEGMENT 0x480
60#define BOOK3S_INTERRUPT_EXTERNAL 0x500 60#define BOOK3S_INTERRUPT_EXTERNAL 0x500
61#define BOOK3S_INTERRUPT_EXTERNAL_LEVEL 0x501 61#define BOOK3S_INTERRUPT_EXTERNAL_LEVEL 0x501
62#define BOOK3S_INTERRUPT_EXTERNAL_HV 0x502
62#define BOOK3S_INTERRUPT_ALIGNMENT 0x600 63#define BOOK3S_INTERRUPT_ALIGNMENT 0x600
63#define BOOK3S_INTERRUPT_PROGRAM 0x700 64#define BOOK3S_INTERRUPT_PROGRAM 0x700
64#define BOOK3S_INTERRUPT_FP_UNAVAIL 0x800 65#define BOOK3S_INTERRUPT_FP_UNAVAIL 0x800
diff --git a/arch/powerpc/include/asm/kvm_book3s_asm.h b/arch/powerpc/include/asm/kvm_book3s_asm.h
index 36fdb3aff30b..d5a8a3861635 100644
--- a/arch/powerpc/include/asm/kvm_book3s_asm.h
+++ b/arch/powerpc/include/asm/kvm_book3s_asm.h
@@ -34,6 +34,7 @@
34 (\intno == BOOK3S_INTERRUPT_DATA_SEGMENT) || \ 34 (\intno == BOOK3S_INTERRUPT_DATA_SEGMENT) || \
35 (\intno == BOOK3S_INTERRUPT_INST_SEGMENT) || \ 35 (\intno == BOOK3S_INTERRUPT_INST_SEGMENT) || \
36 (\intno == BOOK3S_INTERRUPT_EXTERNAL) || \ 36 (\intno == BOOK3S_INTERRUPT_EXTERNAL) || \
37 (\intno == BOOK3S_INTERRUPT_EXTERNAL_HV) || \
37 (\intno == BOOK3S_INTERRUPT_ALIGNMENT) || \ 38 (\intno == BOOK3S_INTERRUPT_ALIGNMENT) || \
38 (\intno == BOOK3S_INTERRUPT_PROGRAM) || \ 39 (\intno == BOOK3S_INTERRUPT_PROGRAM) || \
39 (\intno == BOOK3S_INTERRUPT_FP_UNAVAIL) || \ 40 (\intno == BOOK3S_INTERRUPT_FP_UNAVAIL) || \
diff --git a/arch/powerpc/kernel/cpu_setup_power7.S b/arch/powerpc/kernel/cpu_setup_power7.S
index f2b317817c4e..e801ef15d6d0 100644
--- a/arch/powerpc/kernel/cpu_setup_power7.S
+++ b/arch/powerpc/kernel/cpu_setup_power7.S
@@ -52,13 +52,14 @@ __init_hvmode_206:
52__init_LPCR: 52__init_LPCR:
53 /* Setup a sane LPCR: 53 /* Setup a sane LPCR:
54 * 54 *
55 * LPES = 0b11 (SRR0/1 used for 0x500) 55 * LPES = 0b01 (HSRR0/1 used for 0x500)
56 * PECE = 0b111 56 * PECE = 0b111
57 * 57 *
58 * Other bits untouched for now 58 * Other bits untouched for now
59 */ 59 */
60 mfspr r3,SPRN_LPCR 60 mfspr r3,SPRN_LPCR
61 ori r3,r3,(LPCR_LPES0|LPCR_LPES1) 61 ori r3,r3,(LPCR_LPES0|LPCR_LPES1)
62 xori r3,r3, LPCR_LPES0
62 ori r3,r3,(LPCR_PECE0|LPCR_PECE1|LPCR_PECE2) 63 ori r3,r3,(LPCR_PECE0|LPCR_PECE1|LPCR_PECE2)
63 mtspr SPRN_LPCR,r3 64 mtspr SPRN_LPCR,r3
64 isync 65 isync
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 6784bf7090f6..17f1d6670635 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -44,7 +44,7 @@ _machine_check_pSeries:
44 HMT_MEDIUM 44 HMT_MEDIUM
45 DO_KVM 0x200 45 DO_KVM 0x200
46 mtspr SPRN_SPRG_SCRATCH0,r13 /* save r13 */ 46 mtspr SPRN_SPRG_SCRATCH0,r13 /* save r13 */
47 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) 47 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common, EXC_STD)
48 48
49 . = 0x300 49 . = 0x300
50 .globl data_access_pSeries 50 .globl data_access_pSeries
@@ -71,9 +71,9 @@ BEGIN_FTR_SECTION
71 std r10,PACA_EXGEN+EX_R10(r13) 71 std r10,PACA_EXGEN+EX_R10(r13)
72 std r11,PACA_EXGEN+EX_R9(r13) 72 std r11,PACA_EXGEN+EX_R9(r13)
73 std r12,PACA_EXGEN+EX_R13(r13) 73 std r12,PACA_EXGEN+EX_R13(r13)
74 EXCEPTION_PROLOG_PSERIES_1(data_access_common) 74 EXCEPTION_PROLOG_PSERIES_1(data_access_common, EXC_STD)
75FTR_SECTION_ELSE 75FTR_SECTION_ELSE
76 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, data_access_common) 76 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, data_access_common, EXC_STD)
77ALT_FTR_SECTION_END_IFCLR(CPU_FTR_SLB) 77ALT_FTR_SECTION_END_IFCLR(CPU_FTR_SLB)
78 78
79 . = 0x380 79 . = 0x380
@@ -147,11 +147,24 @@ instruction_access_slb_pSeries:
147 bctr 147 bctr
148#endif 148#endif
149 149
150 MASKABLE_EXCEPTION_PSERIES(0x500, hardware_interrupt) 150 . = 0x500;
151 .globl hardware_interrupt_pSeries
152hardware_interrupt_pSeries:
153 BEGIN_FTR_SECTION
154 MASKABLE_EXCEPTION_PSERIES(0x500, hardware_interrupt, EXC_STD)
155 FTR_SECTION_ELSE
156 MASKABLE_EXCEPTION_PSERIES(0x502, hardware_interrupt, EXC_HV)
157 ALT_FTR_SECTION_END_IFCLR(CPU_FTR_HVMODE_206)
158
151 STD_EXCEPTION_PSERIES(0x600, alignment) 159 STD_EXCEPTION_PSERIES(0x600, alignment)
152 STD_EXCEPTION_PSERIES(0x700, program_check) 160 STD_EXCEPTION_PSERIES(0x700, program_check)
153 STD_EXCEPTION_PSERIES(0x800, fp_unavailable) 161 STD_EXCEPTION_PSERIES(0x800, fp_unavailable)
154 MASKABLE_EXCEPTION_PSERIES(0x900, decrementer) 162
163 . = 0x900;
164 .globl decrementer_pSeries
165decrementer_pSeries:
166 MASKABLE_EXCEPTION_PSERIES(0x900, decrementer, EXC_STD)
167
155 STD_EXCEPTION_PSERIES(0xa00, trap_0a) 168 STD_EXCEPTION_PSERIES(0xa00, trap_0a)
156 STD_EXCEPTION_PSERIES(0xb00, trap_0b) 169 STD_EXCEPTION_PSERIES(0xb00, trap_0b)
157 170
@@ -207,15 +220,15 @@ vsx_unavailable_pSeries_1:
207 b vsx_unavailable_pSeries 220 b vsx_unavailable_pSeries
208 221
209#ifdef CONFIG_CBE_RAS 222#ifdef CONFIG_CBE_RAS
210 HSTD_EXCEPTION_PSERIES(0x1200, cbe_system_error) 223 HSTD_EXCEPTION_PSERIES(0x1202, cbe_system_error)
211#endif /* CONFIG_CBE_RAS */ 224#endif /* CONFIG_CBE_RAS */
212 STD_EXCEPTION_PSERIES(0x1300, instruction_breakpoint) 225 STD_EXCEPTION_PSERIES(0x1300, instruction_breakpoint)
213#ifdef CONFIG_CBE_RAS 226#ifdef CONFIG_CBE_RAS
214 HSTD_EXCEPTION_PSERIES(0x1600, cbe_maintenance) 227 HSTD_EXCEPTION_PSERIES(0x1602, cbe_maintenance)
215#endif /* CONFIG_CBE_RAS */ 228#endif /* CONFIG_CBE_RAS */
216 STD_EXCEPTION_PSERIES(0x1700, altivec_assist) 229 STD_EXCEPTION_PSERIES(0x1700, altivec_assist)
217#ifdef CONFIG_CBE_RAS 230#ifdef CONFIG_CBE_RAS
218 HSTD_EXCEPTION_PSERIES(0x1800, cbe_thermal) 231 HSTD_EXCEPTION_PSERIES(0x1802, cbe_thermal)
219#endif /* CONFIG_CBE_RAS */ 232#endif /* CONFIG_CBE_RAS */
220 233
221 . = 0x3000 234 . = 0x3000
@@ -244,13 +257,26 @@ masked_interrupt:
244 rfid 257 rfid
245 b . 258 b .
246 259
260masked_Hinterrupt:
261 stb r10,PACAHARDIRQEN(r13)
262 mtcrf 0x80,r9
263 ld r9,PACA_EXGEN+EX_R9(r13)
264 mfspr r10,SPRN_HSRR1
265 rldicl r10,r10,48,1 /* clear MSR_EE */
266 rotldi r10,r10,16
267 mtspr SPRN_HSRR1,r10
268 ld r10,PACA_EXGEN+EX_R10(r13)
269 mfspr r13,SPRN_SPRG_HSCRATCH0
270 hrfid
271 b .
272
247 .align 7 273 .align 7
248do_stab_bolted_pSeries: 274do_stab_bolted_pSeries:
249 std r11,PACA_EXSLB+EX_R11(r13) 275 std r11,PACA_EXSLB+EX_R11(r13)
250 std r12,PACA_EXSLB+EX_R12(r13) 276 std r12,PACA_EXSLB+EX_R12(r13)
251 mfspr r10,SPRN_SPRG_SCRATCH0 277 mfspr r10,SPRN_SPRG_SCRATCH0
252 std r10,PACA_EXSLB+EX_R13(r13) 278 std r10,PACA_EXSLB+EX_R13(r13)
253 EXCEPTION_PROLOG_PSERIES_1(.do_stab_bolted) 279 EXCEPTION_PROLOG_PSERIES_1(.do_stab_bolted, EXC_STD)
254 280
255#ifdef CONFIG_PPC_PSERIES 281#ifdef CONFIG_PPC_PSERIES
256/* 282/*
@@ -261,14 +287,14 @@ do_stab_bolted_pSeries:
261system_reset_fwnmi: 287system_reset_fwnmi:
262 HMT_MEDIUM 288 HMT_MEDIUM
263 mtspr SPRN_SPRG_SCRATCH0,r13 /* save r13 */ 289 mtspr SPRN_SPRG_SCRATCH0,r13 /* save r13 */
264 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common) 290 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common, EXC_STD)
265 291
266 .globl machine_check_fwnmi 292 .globl machine_check_fwnmi
267 .align 7 293 .align 7
268machine_check_fwnmi: 294machine_check_fwnmi:
269 HMT_MEDIUM 295 HMT_MEDIUM
270 mtspr SPRN_SPRG_SCRATCH0,r13 /* save r13 */ 296 mtspr SPRN_SPRG_SCRATCH0,r13 /* save r13 */
271 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) 297 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common, EXC_STD)
272 298
273#endif /* CONFIG_PPC_PSERIES */ 299#endif /* CONFIG_PPC_PSERIES */
274 300
diff --git a/arch/powerpc/kvm/book3s_rmhandlers.S b/arch/powerpc/kvm/book3s_rmhandlers.S
index b0ff5ff76e25..046e1f3d4432 100644
--- a/arch/powerpc/kvm/book3s_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_rmhandlers.S
@@ -112,6 +112,7 @@ INTERRUPT_TRAMPOLINE BOOK3S_INTERRUPT_MACHINE_CHECK
112INTERRUPT_TRAMPOLINE BOOK3S_INTERRUPT_DATA_STORAGE 112INTERRUPT_TRAMPOLINE BOOK3S_INTERRUPT_DATA_STORAGE
113INTERRUPT_TRAMPOLINE BOOK3S_INTERRUPT_INST_STORAGE 113INTERRUPT_TRAMPOLINE BOOK3S_INTERRUPT_INST_STORAGE
114INTERRUPT_TRAMPOLINE BOOK3S_INTERRUPT_EXTERNAL 114INTERRUPT_TRAMPOLINE BOOK3S_INTERRUPT_EXTERNAL
115INTERRUPT_TRAMPOLINE BOOK3S_INTERRUPT_EXTERNAL_HV
115INTERRUPT_TRAMPOLINE BOOK3S_INTERRUPT_ALIGNMENT 116INTERRUPT_TRAMPOLINE BOOK3S_INTERRUPT_ALIGNMENT
116INTERRUPT_TRAMPOLINE BOOK3S_INTERRUPT_PROGRAM 117INTERRUPT_TRAMPOLINE BOOK3S_INTERRUPT_PROGRAM
117INTERRUPT_TRAMPOLINE BOOK3S_INTERRUPT_FP_UNAVAIL 118INTERRUPT_TRAMPOLINE BOOK3S_INTERRUPT_FP_UNAVAIL
diff --git a/arch/powerpc/kvm/book3s_segment.S b/arch/powerpc/kvm/book3s_segment.S
index 7c52ed0b7051..d842795d0f23 100644
--- a/arch/powerpc/kvm/book3s_segment.S
+++ b/arch/powerpc/kvm/book3s_segment.S
@@ -155,9 +155,15 @@ kvmppc_handler_trampoline_exit:
155 PPC_LL r2, (SHADOW_VCPU_OFF + SVCPU_HOST_R2)(r13) 155 PPC_LL r2, (SHADOW_VCPU_OFF + SVCPU_HOST_R2)(r13)
156 156
157 /* Save guest PC and MSR */ 157 /* Save guest PC and MSR */
158 mfsrr0 r3 158 andi. r0,r12,0x2
159 beq 1f
160 mfspr r3,SPRN_HSRR0
161 mfspr r4,SPRN_HSRR1
162 andi. r12,r12,0x3ffd
163 b 2f
1641: mfsrr0 r3
159 mfsrr1 r4 165 mfsrr1 r4
160 1662:
161 PPC_STL r3, (SHADOW_VCPU_OFF + SVCPU_PC)(r13) 167 PPC_STL r3, (SHADOW_VCPU_OFF + SVCPU_PC)(r13)
162 PPC_STL r4, (SHADOW_VCPU_OFF + SVCPU_SHADOW_SRR1)(r13) 168 PPC_STL r4, (SHADOW_VCPU_OFF + SVCPU_SHADOW_SRR1)(r13)
163 169
diff --git a/arch/powerpc/platforms/iseries/exception.S b/arch/powerpc/platforms/iseries/exception.S
index 32a56c6dfa72..f7a487231a11 100644
--- a/arch/powerpc/platforms/iseries/exception.S
+++ b/arch/powerpc/platforms/iseries/exception.S
@@ -155,7 +155,7 @@ BEGIN_FTR_SECTION
155 std r12,PACA_EXGEN+EX_R13(r13) 155 std r12,PACA_EXGEN+EX_R13(r13)
156 EXCEPTION_PROLOG_ISERIES_1 156 EXCEPTION_PROLOG_ISERIES_1
157FTR_SECTION_ELSE 157FTR_SECTION_ELSE
158 EXCEPTION_PROLOG_1(PACA_EXGEN) 158 EXCEPTION_PROLOG_1(PACA_EXGEN, EXC_STD)
159 EXCEPTION_PROLOG_ISERIES_1 159 EXCEPTION_PROLOG_ISERIES_1
160ALT_FTR_SECTION_END_IFCLR(CPU_FTR_SLB) 160ALT_FTR_SECTION_END_IFCLR(CPU_FTR_SLB)
161 b data_access_common 161 b data_access_common
diff --git a/arch/powerpc/platforms/iseries/exception.h b/arch/powerpc/platforms/iseries/exception.h
index bae3fba5ad8e..57127d805fe3 100644
--- a/arch/powerpc/platforms/iseries/exception.h
+++ b/arch/powerpc/platforms/iseries/exception.h
@@ -39,7 +39,7 @@
39label##_iSeries: \ 39label##_iSeries: \
40 HMT_MEDIUM; \ 40 HMT_MEDIUM; \
41 mtspr SPRN_SPRG_SCRATCH0,r13; /* save r13 */ \ 41 mtspr SPRN_SPRG_SCRATCH0,r13; /* save r13 */ \
42 EXCEPTION_PROLOG_1(area); \ 42 EXCEPTION_PROLOG_1(area, EXC_STD); \
43 EXCEPTION_PROLOG_ISERIES_1; \ 43 EXCEPTION_PROLOG_ISERIES_1; \
44 b label##_common 44 b label##_common
45 45
@@ -48,7 +48,7 @@ label##_iSeries: \
48label##_iSeries: \ 48label##_iSeries: \
49 HMT_MEDIUM; \ 49 HMT_MEDIUM; \
50 mtspr SPRN_SPRG_SCRATCH0,r13; /* save r13 */ \ 50 mtspr SPRN_SPRG_SCRATCH0,r13; /* save r13 */ \
51 EXCEPTION_PROLOG_1(PACA_EXGEN); \ 51 EXCEPTION_PROLOG_1(PACA_EXGEN, EXC_STD); \
52 lbz r10,PACASOFTIRQEN(r13); \ 52 lbz r10,PACASOFTIRQEN(r13); \
53 cmpwi 0,r10,0; \ 53 cmpwi 0,r10,0; \
54 beq- label##_iSeries_masked; \ 54 beq- label##_iSeries_masked; \