diff options
Diffstat (limited to 'arch/powerpc/kernel/exceptions-64s.S')
-rw-r--r-- | arch/powerpc/kernel/exceptions-64s.S | 216 |
1 files changed, 162 insertions, 54 deletions
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index aeb739e18769..a85f4874cba7 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S | |||
@@ -37,23 +37,51 @@ | |||
37 | .globl __start_interrupts | 37 | .globl __start_interrupts |
38 | __start_interrupts: | 38 | __start_interrupts: |
39 | 39 | ||
40 | STD_EXCEPTION_PSERIES(0x100, system_reset) | 40 | .globl system_reset_pSeries; |
41 | system_reset_pSeries: | ||
42 | HMT_MEDIUM; | ||
43 | DO_KVM 0x100; | ||
44 | SET_SCRATCH0(r13) | ||
45 | #ifdef CONFIG_PPC_P7_NAP | ||
46 | BEGIN_FTR_SECTION | ||
47 | /* Running native on arch 2.06 or later, check if we are | ||
48 | * waking up from nap. We only handle no state loss and | ||
49 | * supervisor state loss. We do -not- handle hypervisor | ||
50 | * state loss at this time. | ||
51 | */ | ||
52 | mfspr r13,SPRN_SRR1 | ||
53 | rlwinm r13,r13,47-31,30,31 | ||
54 | cmpwi cr0,r13,1 | ||
55 | bne 1f | ||
56 | b .power7_wakeup_noloss | ||
57 | 1: cmpwi cr0,r13,2 | ||
58 | bne 1f | ||
59 | b .power7_wakeup_loss | ||
60 | /* Total loss of HV state is fatal, we could try to use the | ||
61 | * PIR to locate a PACA, then use an emergency stack etc... | ||
62 | * but for now, let's just stay stuck here | ||
63 | */ | ||
64 | 1: cmpwi cr0,r13,3 | ||
65 | beq . | ||
66 | END_FTR_SECTION_IFSET(CPU_FTR_HVMODE_206) | ||
67 | #endif /* CONFIG_PPC_P7_NAP */ | ||
68 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common, EXC_STD) | ||
41 | 69 | ||
42 | . = 0x200 | 70 | . = 0x200 |
43 | _machine_check_pSeries: | 71 | _machine_check_pSeries: |
44 | HMT_MEDIUM | 72 | HMT_MEDIUM |
45 | DO_KVM 0x200 | 73 | DO_KVM 0x200 |
46 | mtspr SPRN_SPRG_SCRATCH0,r13 /* save r13 */ | 74 | SET_SCRATCH0(r13) |
47 | EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) | 75 | EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common, EXC_STD) |
48 | 76 | ||
49 | . = 0x300 | 77 | . = 0x300 |
50 | .globl data_access_pSeries | 78 | .globl data_access_pSeries |
51 | data_access_pSeries: | 79 | data_access_pSeries: |
52 | HMT_MEDIUM | 80 | HMT_MEDIUM |
53 | DO_KVM 0x300 | 81 | DO_KVM 0x300 |
54 | mtspr SPRN_SPRG_SCRATCH0,r13 | 82 | SET_SCRATCH0(r13) |
55 | BEGIN_FTR_SECTION | 83 | BEGIN_FTR_SECTION |
56 | mfspr r13,SPRN_SPRG_PACA | 84 | GET_PACA(r13) |
57 | std r9,PACA_EXSLB+EX_R9(r13) | 85 | std r9,PACA_EXSLB+EX_R9(r13) |
58 | std r10,PACA_EXSLB+EX_R10(r13) | 86 | std r10,PACA_EXSLB+EX_R10(r13) |
59 | mfspr r10,SPRN_DAR | 87 | mfspr r10,SPRN_DAR |
@@ -67,22 +95,22 @@ BEGIN_FTR_SECTION | |||
67 | std r11,PACA_EXGEN+EX_R11(r13) | 95 | std r11,PACA_EXGEN+EX_R11(r13) |
68 | ld r11,PACA_EXSLB+EX_R9(r13) | 96 | ld r11,PACA_EXSLB+EX_R9(r13) |
69 | std r12,PACA_EXGEN+EX_R12(r13) | 97 | std r12,PACA_EXGEN+EX_R12(r13) |
70 | mfspr r12,SPRN_SPRG_SCRATCH0 | 98 | GET_SCRATCH0(r12) |
71 | std r10,PACA_EXGEN+EX_R10(r13) | 99 | std r10,PACA_EXGEN+EX_R10(r13) |
72 | std r11,PACA_EXGEN+EX_R9(r13) | 100 | std r11,PACA_EXGEN+EX_R9(r13) |
73 | std r12,PACA_EXGEN+EX_R13(r13) | 101 | std r12,PACA_EXGEN+EX_R13(r13) |
74 | EXCEPTION_PROLOG_PSERIES_1(data_access_common) | 102 | EXCEPTION_PROLOG_PSERIES_1(data_access_common, EXC_STD) |
75 | FTR_SECTION_ELSE | 103 | FTR_SECTION_ELSE |
76 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, data_access_common) | 104 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, data_access_common, EXC_STD) |
77 | ALT_FTR_SECTION_END_IFCLR(CPU_FTR_SLB) | 105 | ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_SLB) |
78 | 106 | ||
79 | . = 0x380 | 107 | . = 0x380 |
80 | .globl data_access_slb_pSeries | 108 | .globl data_access_slb_pSeries |
81 | data_access_slb_pSeries: | 109 | data_access_slb_pSeries: |
82 | HMT_MEDIUM | 110 | HMT_MEDIUM |
83 | DO_KVM 0x380 | 111 | DO_KVM 0x380 |
84 | mtspr SPRN_SPRG_SCRATCH0,r13 | 112 | SET_SCRATCH0(r13) |
85 | mfspr r13,SPRN_SPRG_PACA /* get paca address into r13 */ | 113 | GET_PACA(r13) |
86 | std r3,PACA_EXSLB+EX_R3(r13) | 114 | std r3,PACA_EXSLB+EX_R3(r13) |
87 | mfspr r3,SPRN_DAR | 115 | mfspr r3,SPRN_DAR |
88 | std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */ | 116 | std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */ |
@@ -95,7 +123,7 @@ data_access_slb_pSeries: | |||
95 | std r10,PACA_EXSLB+EX_R10(r13) | 123 | std r10,PACA_EXSLB+EX_R10(r13) |
96 | std r11,PACA_EXSLB+EX_R11(r13) | 124 | std r11,PACA_EXSLB+EX_R11(r13) |
97 | std r12,PACA_EXSLB+EX_R12(r13) | 125 | std r12,PACA_EXSLB+EX_R12(r13) |
98 | mfspr r10,SPRN_SPRG_SCRATCH0 | 126 | GET_SCRATCH0(r10) |
99 | std r10,PACA_EXSLB+EX_R13(r13) | 127 | std r10,PACA_EXSLB+EX_R13(r13) |
100 | mfspr r12,SPRN_SRR1 /* and SRR1 */ | 128 | mfspr r12,SPRN_SRR1 /* and SRR1 */ |
101 | #ifndef CONFIG_RELOCATABLE | 129 | #ifndef CONFIG_RELOCATABLE |
@@ -113,15 +141,15 @@ data_access_slb_pSeries: | |||
113 | bctr | 141 | bctr |
114 | #endif | 142 | #endif |
115 | 143 | ||
116 | STD_EXCEPTION_PSERIES(0x400, instruction_access) | 144 | STD_EXCEPTION_PSERIES(0x400, 0x400, instruction_access) |
117 | 145 | ||
118 | . = 0x480 | 146 | . = 0x480 |
119 | .globl instruction_access_slb_pSeries | 147 | .globl instruction_access_slb_pSeries |
120 | instruction_access_slb_pSeries: | 148 | instruction_access_slb_pSeries: |
121 | HMT_MEDIUM | 149 | HMT_MEDIUM |
122 | DO_KVM 0x480 | 150 | DO_KVM 0x480 |
123 | mtspr SPRN_SPRG_SCRATCH0,r13 | 151 | SET_SCRATCH0(r13) |
124 | mfspr r13,SPRN_SPRG_PACA /* get paca address into r13 */ | 152 | GET_PACA(r13) |
125 | std r3,PACA_EXSLB+EX_R3(r13) | 153 | std r3,PACA_EXSLB+EX_R3(r13) |
126 | mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */ | 154 | mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */ |
127 | std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */ | 155 | std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */ |
@@ -134,7 +162,7 @@ instruction_access_slb_pSeries: | |||
134 | std r10,PACA_EXSLB+EX_R10(r13) | 162 | std r10,PACA_EXSLB+EX_R10(r13) |
135 | std r11,PACA_EXSLB+EX_R11(r13) | 163 | std r11,PACA_EXSLB+EX_R11(r13) |
136 | std r12,PACA_EXSLB+EX_R12(r13) | 164 | std r12,PACA_EXSLB+EX_R12(r13) |
137 | mfspr r10,SPRN_SPRG_SCRATCH0 | 165 | GET_SCRATCH0(r10) |
138 | std r10,PACA_EXSLB+EX_R13(r13) | 166 | std r10,PACA_EXSLB+EX_R13(r13) |
139 | mfspr r12,SPRN_SRR1 /* and SRR1 */ | 167 | mfspr r12,SPRN_SRR1 /* and SRR1 */ |
140 | #ifndef CONFIG_RELOCATABLE | 168 | #ifndef CONFIG_RELOCATABLE |
@@ -147,13 +175,29 @@ instruction_access_slb_pSeries: | |||
147 | bctr | 175 | bctr |
148 | #endif | 176 | #endif |
149 | 177 | ||
150 | MASKABLE_EXCEPTION_PSERIES(0x500, hardware_interrupt) | 178 | /* We open code these as we can't have a ". = x" (even with |
151 | STD_EXCEPTION_PSERIES(0x600, alignment) | 179 | * x = "." within a feature section |
152 | STD_EXCEPTION_PSERIES(0x700, program_check) | 180 | */ |
153 | STD_EXCEPTION_PSERIES(0x800, fp_unavailable) | 181 | . = 0x500; |
154 | MASKABLE_EXCEPTION_PSERIES(0x900, decrementer) | 182 | .globl hardware_interrupt_pSeries; |
155 | STD_EXCEPTION_PSERIES(0xa00, trap_0a) | 183 | .globl hardware_interrupt_hv; |
156 | STD_EXCEPTION_PSERIES(0xb00, trap_0b) | 184 | hardware_interrupt_pSeries: |
185 | hardware_interrupt_hv: | ||
186 | BEGIN_FTR_SECTION | ||
187 | _MASKABLE_EXCEPTION_PSERIES(0x500, hardware_interrupt, EXC_STD) | ||
188 | FTR_SECTION_ELSE | ||
189 | _MASKABLE_EXCEPTION_PSERIES(0x502, hardware_interrupt, EXC_HV) | ||
190 | ALT_FTR_SECTION_END_IFCLR(CPU_FTR_HVMODE_206) | ||
191 | |||
192 | STD_EXCEPTION_PSERIES(0x600, 0x600, alignment) | ||
193 | STD_EXCEPTION_PSERIES(0x700, 0x700, program_check) | ||
194 | STD_EXCEPTION_PSERIES(0x800, 0x800, fp_unavailable) | ||
195 | |||
196 | MASKABLE_EXCEPTION_PSERIES(0x900, 0x900, decrementer) | ||
197 | MASKABLE_EXCEPTION_HV(0x980, 0x980, decrementer) | ||
198 | |||
199 | STD_EXCEPTION_PSERIES(0xa00, 0xa00, trap_0a) | ||
200 | STD_EXCEPTION_PSERIES(0xb00, 0xb00, trap_0b) | ||
157 | 201 | ||
158 | . = 0xc00 | 202 | . = 0xc00 |
159 | .globl system_call_pSeries | 203 | .globl system_call_pSeries |
@@ -165,13 +209,13 @@ BEGIN_FTR_SECTION | |||
165 | beq- 1f | 209 | beq- 1f |
166 | END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) | 210 | END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) |
167 | mr r9,r13 | 211 | mr r9,r13 |
168 | mfspr r13,SPRN_SPRG_PACA | 212 | GET_PACA(r13) |
169 | mfspr r11,SPRN_SRR0 | 213 | mfspr r11,SPRN_SRR0 |
170 | ld r12,PACAKBASE(r13) | ||
171 | ld r10,PACAKMSR(r13) | ||
172 | LOAD_HANDLER(r12, system_call_entry) | ||
173 | mtspr SPRN_SRR0,r12 | ||
174 | mfspr r12,SPRN_SRR1 | 214 | mfspr r12,SPRN_SRR1 |
215 | ld r10,PACAKBASE(r13) | ||
216 | LOAD_HANDLER(r10, system_call_entry) | ||
217 | mtspr SPRN_SRR0,r10 | ||
218 | ld r10,PACAKMSR(r13) | ||
175 | mtspr SPRN_SRR1,r10 | 219 | mtspr SPRN_SRR1,r10 |
176 | rfid | 220 | rfid |
177 | b . /* prevent speculative execution */ | 221 | b . /* prevent speculative execution */ |
@@ -183,8 +227,21 @@ END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) | |||
183 | rfid /* return to userspace */ | 227 | rfid /* return to userspace */ |
184 | b . | 228 | b . |
185 | 229 | ||
186 | STD_EXCEPTION_PSERIES(0xd00, single_step) | 230 | STD_EXCEPTION_PSERIES(0xd00, 0xd00, single_step) |
187 | STD_EXCEPTION_PSERIES(0xe00, trap_0e) | 231 | |
232 | /* At 0xe??? we have a bunch of hypervisor exceptions, we branch | ||
233 | * out of line to handle them | ||
234 | */ | ||
235 | . = 0xe00 | ||
236 | b h_data_storage_hv | ||
237 | . = 0xe20 | ||
238 | b h_instr_storage_hv | ||
239 | . = 0xe40 | ||
240 | b emulation_assist_hv | ||
241 | . = 0xe50 | ||
242 | b hmi_exception_hv | ||
243 | . = 0xe60 | ||
244 | b hmi_exception_hv | ||
188 | 245 | ||
189 | /* We need to deal with the Altivec unavailable exception | 246 | /* We need to deal with the Altivec unavailable exception |
190 | * here which is at 0xf20, thus in the middle of the | 247 | * here which is at 0xf20, thus in the middle of the |
@@ -193,39 +250,42 @@ END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) | |||
193 | */ | 250 | */ |
194 | performance_monitor_pSeries_1: | 251 | performance_monitor_pSeries_1: |
195 | . = 0xf00 | 252 | . = 0xf00 |
196 | DO_KVM 0xf00 | ||
197 | b performance_monitor_pSeries | 253 | b performance_monitor_pSeries |
198 | 254 | ||
199 | altivec_unavailable_pSeries_1: | 255 | altivec_unavailable_pSeries_1: |
200 | . = 0xf20 | 256 | . = 0xf20 |
201 | DO_KVM 0xf20 | ||
202 | b altivec_unavailable_pSeries | 257 | b altivec_unavailable_pSeries |
203 | 258 | ||
204 | vsx_unavailable_pSeries_1: | 259 | vsx_unavailable_pSeries_1: |
205 | . = 0xf40 | 260 | . = 0xf40 |
206 | DO_KVM 0xf40 | ||
207 | b vsx_unavailable_pSeries | 261 | b vsx_unavailable_pSeries |
208 | 262 | ||
209 | #ifdef CONFIG_CBE_RAS | 263 | #ifdef CONFIG_CBE_RAS |
210 | HSTD_EXCEPTION_PSERIES(0x1200, cbe_system_error) | 264 | STD_EXCEPTION_HV(0x1200, 0x1202, cbe_system_error) |
211 | #endif /* CONFIG_CBE_RAS */ | 265 | #endif /* CONFIG_CBE_RAS */ |
212 | STD_EXCEPTION_PSERIES(0x1300, instruction_breakpoint) | 266 | STD_EXCEPTION_PSERIES(0x1300, 0x1300, instruction_breakpoint) |
213 | #ifdef CONFIG_CBE_RAS | 267 | #ifdef CONFIG_CBE_RAS |
214 | HSTD_EXCEPTION_PSERIES(0x1600, cbe_maintenance) | 268 | STD_EXCEPTION_HV(0x1600, 0x1602, cbe_maintenance) |
215 | #endif /* CONFIG_CBE_RAS */ | 269 | #endif /* CONFIG_CBE_RAS */ |
216 | STD_EXCEPTION_PSERIES(0x1700, altivec_assist) | 270 | STD_EXCEPTION_PSERIES(0x1700, 0x1700, altivec_assist) |
217 | #ifdef CONFIG_CBE_RAS | 271 | #ifdef CONFIG_CBE_RAS |
218 | HSTD_EXCEPTION_PSERIES(0x1800, cbe_thermal) | 272 | STD_EXCEPTION_HV(0x1800, 0x1802, cbe_thermal) |
219 | #endif /* CONFIG_CBE_RAS */ | 273 | #endif /* CONFIG_CBE_RAS */ |
220 | 274 | ||
221 | . = 0x3000 | 275 | . = 0x3000 |
222 | 276 | ||
223 | /*** pSeries interrupt support ***/ | 277 | /*** Out of line interrupts support ***/ |
278 | |||
279 | /* moved from 0xe00 */ | ||
280 | STD_EXCEPTION_HV(., 0xe00, h_data_storage) | ||
281 | STD_EXCEPTION_HV(., 0xe20, h_instr_storage) | ||
282 | STD_EXCEPTION_HV(., 0xe40, emulation_assist) | ||
283 | STD_EXCEPTION_HV(., 0xe60, hmi_exception) /* need to flush cache ? */ | ||
224 | 284 | ||
225 | /* moved from 0xf00 */ | 285 | /* moved from 0xf00 */ |
226 | STD_EXCEPTION_PSERIES(., performance_monitor) | 286 | STD_EXCEPTION_PSERIES(., 0xf00, performance_monitor) |
227 | STD_EXCEPTION_PSERIES(., altivec_unavailable) | 287 | STD_EXCEPTION_PSERIES(., 0xf20, altivec_unavailable) |
228 | STD_EXCEPTION_PSERIES(., vsx_unavailable) | 288 | STD_EXCEPTION_PSERIES(., 0xf40, vsx_unavailable) |
229 | 289 | ||
230 | /* | 290 | /* |
231 | * An interrupt came in while soft-disabled; clear EE in SRR1, | 291 | * An interrupt came in while soft-disabled; clear EE in SRR1, |
@@ -240,17 +300,30 @@ masked_interrupt: | |||
240 | rotldi r10,r10,16 | 300 | rotldi r10,r10,16 |
241 | mtspr SPRN_SRR1,r10 | 301 | mtspr SPRN_SRR1,r10 |
242 | ld r10,PACA_EXGEN+EX_R10(r13) | 302 | ld r10,PACA_EXGEN+EX_R10(r13) |
243 | mfspr r13,SPRN_SPRG_SCRATCH0 | 303 | GET_SCRATCH0(r13) |
244 | rfid | 304 | rfid |
245 | b . | 305 | b . |
246 | 306 | ||
307 | masked_Hinterrupt: | ||
308 | stb r10,PACAHARDIRQEN(r13) | ||
309 | mtcrf 0x80,r9 | ||
310 | ld r9,PACA_EXGEN+EX_R9(r13) | ||
311 | mfspr r10,SPRN_HSRR1 | ||
312 | rldicl r10,r10,48,1 /* clear MSR_EE */ | ||
313 | rotldi r10,r10,16 | ||
314 | mtspr SPRN_HSRR1,r10 | ||
315 | ld r10,PACA_EXGEN+EX_R10(r13) | ||
316 | GET_SCRATCH0(r13) | ||
317 | hrfid | ||
318 | b . | ||
319 | |||
247 | .align 7 | 320 | .align 7 |
248 | do_stab_bolted_pSeries: | 321 | do_stab_bolted_pSeries: |
249 | std r11,PACA_EXSLB+EX_R11(r13) | 322 | std r11,PACA_EXSLB+EX_R11(r13) |
250 | std r12,PACA_EXSLB+EX_R12(r13) | 323 | std r12,PACA_EXSLB+EX_R12(r13) |
251 | mfspr r10,SPRN_SPRG_SCRATCH0 | 324 | GET_SCRATCH0(r10) |
252 | std r10,PACA_EXSLB+EX_R13(r13) | 325 | std r10,PACA_EXSLB+EX_R13(r13) |
253 | EXCEPTION_PROLOG_PSERIES_1(.do_stab_bolted) | 326 | EXCEPTION_PROLOG_PSERIES_1(.do_stab_bolted, EXC_STD) |
254 | 327 | ||
255 | #ifdef CONFIG_PPC_PSERIES | 328 | #ifdef CONFIG_PPC_PSERIES |
256 | /* | 329 | /* |
@@ -260,15 +333,15 @@ do_stab_bolted_pSeries: | |||
260 | .align 7 | 333 | .align 7 |
261 | system_reset_fwnmi: | 334 | system_reset_fwnmi: |
262 | HMT_MEDIUM | 335 | HMT_MEDIUM |
263 | mtspr SPRN_SPRG_SCRATCH0,r13 /* save r13 */ | 336 | SET_SCRATCH0(r13) /* save r13 */ |
264 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common) | 337 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common, EXC_STD) |
265 | 338 | ||
266 | .globl machine_check_fwnmi | 339 | .globl machine_check_fwnmi |
267 | .align 7 | 340 | .align 7 |
268 | machine_check_fwnmi: | 341 | machine_check_fwnmi: |
269 | HMT_MEDIUM | 342 | HMT_MEDIUM |
270 | mtspr SPRN_SPRG_SCRATCH0,r13 /* save r13 */ | 343 | SET_SCRATCH0(r13) /* save r13 */ |
271 | EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) | 344 | EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common, EXC_STD) |
272 | 345 | ||
273 | #endif /* CONFIG_PPC_PSERIES */ | 346 | #endif /* CONFIG_PPC_PSERIES */ |
274 | 347 | ||
@@ -282,7 +355,7 @@ slb_miss_user_pseries: | |||
282 | std r10,PACA_EXGEN+EX_R10(r13) | 355 | std r10,PACA_EXGEN+EX_R10(r13) |
283 | std r11,PACA_EXGEN+EX_R11(r13) | 356 | std r11,PACA_EXGEN+EX_R11(r13) |
284 | std r12,PACA_EXGEN+EX_R12(r13) | 357 | std r12,PACA_EXGEN+EX_R12(r13) |
285 | mfspr r10,SPRG_SCRATCH0 | 358 | GET_SCRATCH0(r10) |
286 | ld r11,PACA_EXSLB+EX_R9(r13) | 359 | ld r11,PACA_EXSLB+EX_R9(r13) |
287 | ld r12,PACA_EXSLB+EX_R3(r13) | 360 | ld r12,PACA_EXSLB+EX_R3(r13) |
288 | std r10,PACA_EXGEN+EX_R13(r13) | 361 | std r10,PACA_EXGEN+EX_R13(r13) |
@@ -342,6 +415,8 @@ machine_check_common: | |||
342 | STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception) | 415 | STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception) |
343 | STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception) | 416 | STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception) |
344 | STD_EXCEPTION_COMMON(0xe00, trap_0e, .unknown_exception) | 417 | STD_EXCEPTION_COMMON(0xe00, trap_0e, .unknown_exception) |
418 | STD_EXCEPTION_COMMON(0xe40, emulation_assist, .program_check_exception) | ||
419 | STD_EXCEPTION_COMMON(0xe60, hmi_exception, .unknown_exception) | ||
345 | STD_EXCEPTION_COMMON_IDLE(0xf00, performance_monitor, .performance_monitor_exception) | 420 | STD_EXCEPTION_COMMON_IDLE(0xf00, performance_monitor, .performance_monitor_exception) |
346 | STD_EXCEPTION_COMMON(0x1300, instruction_breakpoint, .instruction_breakpoint_exception) | 421 | STD_EXCEPTION_COMMON(0x1300, instruction_breakpoint, .instruction_breakpoint_exception) |
347 | #ifdef CONFIG_ALTIVEC | 422 | #ifdef CONFIG_ALTIVEC |
@@ -386,9 +461,24 @@ bad_stack: | |||
386 | std r12,_XER(r1) | 461 | std r12,_XER(r1) |
387 | SAVE_GPR(0,r1) | 462 | SAVE_GPR(0,r1) |
388 | SAVE_GPR(2,r1) | 463 | SAVE_GPR(2,r1) |
389 | SAVE_4GPRS(3,r1) | 464 | ld r10,EX_R3(r3) |
390 | SAVE_2GPRS(7,r1) | 465 | std r10,GPR3(r1) |
391 | SAVE_10GPRS(12,r1) | 466 | SAVE_GPR(4,r1) |
467 | SAVE_4GPRS(5,r1) | ||
468 | ld r9,EX_R9(r3) | ||
469 | ld r10,EX_R10(r3) | ||
470 | SAVE_2GPRS(9,r1) | ||
471 | ld r9,EX_R11(r3) | ||
472 | ld r10,EX_R12(r3) | ||
473 | ld r11,EX_R13(r3) | ||
474 | std r9,GPR11(r1) | ||
475 | std r10,GPR12(r1) | ||
476 | std r11,GPR13(r1) | ||
477 | BEGIN_FTR_SECTION | ||
478 | ld r10,EX_CFAR(r3) | ||
479 | std r10,ORIG_GPR3(r1) | ||
480 | END_FTR_SECTION_IFSET(CPU_FTR_CFAR) | ||
481 | SAVE_8GPRS(14,r1) | ||
392 | SAVE_10GPRS(22,r1) | 482 | SAVE_10GPRS(22,r1) |
393 | lhz r12,PACA_TRAP_SAVE(r13) | 483 | lhz r12,PACA_TRAP_SAVE(r13) |
394 | std r12,_TRAP(r1) | 484 | std r12,_TRAP(r1) |
@@ -397,6 +487,9 @@ bad_stack: | |||
397 | li r12,0 | 487 | li r12,0 |
398 | std r12,0(r11) | 488 | std r12,0(r11) |
399 | ld r2,PACATOC(r13) | 489 | ld r2,PACATOC(r13) |
490 | ld r11,exception_marker@toc(r2) | ||
491 | std r12,RESULT(r1) | ||
492 | std r11,STACK_FRAME_OVERHEAD-16(r1) | ||
400 | 1: addi r3,r1,STACK_FRAME_OVERHEAD | 493 | 1: addi r3,r1,STACK_FRAME_OVERHEAD |
401 | bl .kernel_bad_stack | 494 | bl .kernel_bad_stack |
402 | b 1b | 495 | b 1b |
@@ -419,6 +512,19 @@ data_access_common: | |||
419 | li r5,0x300 | 512 | li r5,0x300 |
420 | b .do_hash_page /* Try to handle as hpte fault */ | 513 | b .do_hash_page /* Try to handle as hpte fault */ |
421 | 514 | ||
515 | .align 7 | ||
516 | .globl h_data_storage_common | ||
517 | h_data_storage_common: | ||
518 | mfspr r10,SPRN_HDAR | ||
519 | std r10,PACA_EXGEN+EX_DAR(r13) | ||
520 | mfspr r10,SPRN_HDSISR | ||
521 | stw r10,PACA_EXGEN+EX_DSISR(r13) | ||
522 | EXCEPTION_PROLOG_COMMON(0xe00, PACA_EXGEN) | ||
523 | bl .save_nvgprs | ||
524 | addi r3,r1,STACK_FRAME_OVERHEAD | ||
525 | bl .unknown_exception | ||
526 | b .ret_from_except | ||
527 | |||
422 | .align 7 | 528 | .align 7 |
423 | .globl instruction_access_common | 529 | .globl instruction_access_common |
424 | instruction_access_common: | 530 | instruction_access_common: |
@@ -428,6 +534,8 @@ instruction_access_common: | |||
428 | li r5,0x400 | 534 | li r5,0x400 |
429 | b .do_hash_page /* Try to handle as hpte fault */ | 535 | b .do_hash_page /* Try to handle as hpte fault */ |
430 | 536 | ||
537 | STD_EXCEPTION_COMMON(0xe20, h_instr_storage, .unknown_exception) | ||
538 | |||
431 | /* | 539 | /* |
432 | * Here is the common SLB miss user that is used when going to virtual | 540 | * Here is the common SLB miss user that is used when going to virtual |
433 | * mode for SLB misses, that is currently not used | 541 | * mode for SLB misses, that is currently not used |
@@ -750,7 +858,7 @@ _STATIC(do_hash_page) | |||
750 | BEGIN_FTR_SECTION | 858 | BEGIN_FTR_SECTION |
751 | andis. r0,r4,0x0020 /* Is it a segment table fault? */ | 859 | andis. r0,r4,0x0020 /* Is it a segment table fault? */ |
752 | bne- do_ste_alloc /* If so handle it */ | 860 | bne- do_ste_alloc /* If so handle it */ |
753 | END_FTR_SECTION_IFCLR(CPU_FTR_SLB) | 861 | END_MMU_FTR_SECTION_IFCLR(MMU_FTR_SLB) |
754 | 862 | ||
755 | clrrdi r11,r1,THREAD_SHIFT | 863 | clrrdi r11,r1,THREAD_SHIFT |
756 | lwz r0,TI_PREEMPT(r11) /* If we're in an "NMI" */ | 864 | lwz r0,TI_PREEMPT(r11) /* If we're in an "NMI" */ |