diff options
Diffstat (limited to 'arch/powerpc/kvm/book3s_segment.S')
-rw-r--r-- | arch/powerpc/kvm/book3s_segment.S | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/arch/powerpc/kvm/book3s_segment.S b/arch/powerpc/kvm/book3s_segment.S index 0676ae249b9f..6e6e9cef34a8 100644 --- a/arch/powerpc/kvm/book3s_segment.S +++ b/arch/powerpc/kvm/book3s_segment.S | |||
@@ -197,7 +197,8 @@ kvmppc_interrupt: | |||
197 | /* Save guest PC and MSR */ | 197 | /* Save guest PC and MSR */ |
198 | #ifdef CONFIG_PPC64 | 198 | #ifdef CONFIG_PPC64 |
199 | BEGIN_FTR_SECTION | 199 | BEGIN_FTR_SECTION |
200 | andi. r0,r12,0x2 | 200 | andi. r0, r12, 0x2 |
201 | cmpwi cr1, r0, 0 | ||
201 | beq 1f | 202 | beq 1f |
202 | mfspr r3,SPRN_HSRR0 | 203 | mfspr r3,SPRN_HSRR0 |
203 | mfspr r4,SPRN_HSRR1 | 204 | mfspr r4,SPRN_HSRR1 |
@@ -250,6 +251,12 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) | |||
250 | beq ld_last_prev_inst | 251 | beq ld_last_prev_inst |
251 | cmpwi r12, BOOK3S_INTERRUPT_ALIGNMENT | 252 | cmpwi r12, BOOK3S_INTERRUPT_ALIGNMENT |
252 | beq- ld_last_inst | 253 | beq- ld_last_inst |
254 | #ifdef CONFIG_PPC64 | ||
255 | BEGIN_FTR_SECTION | ||
256 | cmpwi r12, BOOK3S_INTERRUPT_H_EMUL_ASSIST | ||
257 | beq- ld_last_inst | ||
258 | END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) | ||
259 | #endif | ||
253 | 260 | ||
254 | b no_ld_last_inst | 261 | b no_ld_last_inst |
255 | 262 | ||
@@ -316,23 +323,17 @@ no_dcbz32_off: | |||
316 | * Having set up SRR0/1 with the address where we want | 323 | * Having set up SRR0/1 with the address where we want |
317 | * to continue with relocation on (potentially in module | 324 | * to continue with relocation on (potentially in module |
318 | * space), we either just go straight there with rfi[d], | 325 | * space), we either just go straight there with rfi[d], |
319 | * or we jump to an interrupt handler with bctr if there | 326 | * or we jump to an interrupt handler if there is an |
320 | * is an interrupt to be handled first. In the latter | 327 | * interrupt to be handled first. In the latter case, |
321 | * case, the rfi[d] at the end of the interrupt handler | 328 | * the rfi[d] at the end of the interrupt handler will |
322 | * will get us back to where we want to continue. | 329 | * get us back to where we want to continue. |
323 | */ | 330 | */ |
324 | 331 | ||
325 | cmpwi r12, BOOK3S_INTERRUPT_EXTERNAL | ||
326 | beq 1f | ||
327 | cmpwi r12, BOOK3S_INTERRUPT_DECREMENTER | ||
328 | beq 1f | ||
329 | cmpwi r12, BOOK3S_INTERRUPT_PERFMON | ||
330 | 1: mtctr r12 | ||
331 | |||
332 | /* Register usage at this point: | 332 | /* Register usage at this point: |
333 | * | 333 | * |
334 | * R1 = host R1 | 334 | * R1 = host R1 |
335 | * R2 = host R2 | 335 | * R2 = host R2 |
336 | * R10 = raw exit handler id | ||
336 | * R12 = exit handler id | 337 | * R12 = exit handler id |
337 | * R13 = shadow vcpu (32-bit) or PACA (64-bit) | 338 | * R13 = shadow vcpu (32-bit) or PACA (64-bit) |
338 | * SVCPU.* = guest * | 339 | * SVCPU.* = guest * |
@@ -342,12 +343,25 @@ no_dcbz32_off: | |||
342 | PPC_LL r6, HSTATE_HOST_MSR(r13) | 343 | PPC_LL r6, HSTATE_HOST_MSR(r13) |
343 | PPC_LL r8, HSTATE_VMHANDLER(r13) | 344 | PPC_LL r8, HSTATE_VMHANDLER(r13) |
344 | 345 | ||
345 | /* Restore host msr -> SRR1 */ | 346 | #ifdef CONFIG_PPC64 |
347 | BEGIN_FTR_SECTION | ||
348 | beq cr1, 1f | ||
349 | mtspr SPRN_HSRR1, r6 | ||
350 | mtspr SPRN_HSRR0, r8 | ||
351 | END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) | ||
352 | #endif | ||
353 | 1: /* Restore host msr -> SRR1 */ | ||
346 | mtsrr1 r6 | 354 | mtsrr1 r6 |
347 | /* Load highmem handler address */ | 355 | /* Load highmem handler address */ |
348 | mtsrr0 r8 | 356 | mtsrr0 r8 |
349 | 357 | ||
350 | /* RFI into the highmem handler, or jump to interrupt handler */ | 358 | /* RFI into the highmem handler, or jump to interrupt handler */ |
351 | beqctr | 359 | cmpwi r12, BOOK3S_INTERRUPT_EXTERNAL |
360 | beqa BOOK3S_INTERRUPT_EXTERNAL | ||
361 | cmpwi r12, BOOK3S_INTERRUPT_DECREMENTER | ||
362 | beqa BOOK3S_INTERRUPT_DECREMENTER | ||
363 | cmpwi r12, BOOK3S_INTERRUPT_PERFMON | ||
364 | beqa BOOK3S_INTERRUPT_PERFMON | ||
365 | |||
352 | RFI | 366 | RFI |
353 | kvmppc_handler_trampoline_exit_end: | 367 | kvmppc_handler_trampoline_exit_end: |