diff options
-rw-r--r-- | arch/powerpc/kernel/idle_book3s.S | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/idle_book3s.S b/arch/powerpc/kernel/idle_book3s.S index 72dac0b58061..b350ac5e3111 100644 --- a/arch/powerpc/kernel/idle_book3s.S +++ b/arch/powerpc/kernel/idle_book3s.S | |||
@@ -439,9 +439,23 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300) | |||
439 | _GLOBAL(pnv_wakeup_tb_loss) | 439 | _GLOBAL(pnv_wakeup_tb_loss) |
440 | ld r1,PACAR1(r13) | 440 | ld r1,PACAR1(r13) |
441 | /* | 441 | /* |
442 | * Before entering any idle state, the NVGPRs are saved in the stack | 442 | * Before entering any idle state, the NVGPRs are saved in the stack. |
443 | * and they are restored before switching to the process context. Hence | 443 | * If there was a state loss, or PACA_NAPSTATELOST was set, then the |
444 | * until they are restored, they are free to be used. | 444 | * NVGPRs are restored. If we are here, it is likely that state is lost, |
445 | * but not guaranteed -- neither ISA207 nor ISA300 tests to reach | ||
446 | * here are the same as the test to restore NVGPRS: | ||
447 | * PACA_THREAD_IDLE_STATE test for ISA207, PSSCR test for ISA300, | ||
448 | * and SRR1 test for restoring NVGPRs. | ||
449 | * | ||
450 | * We are about to clobber NVGPRs now, so set NAPSTATELOST to | ||
451 | * guarantee they will always be restored. This might be tightened | ||
452 | * with careful reading of specs (particularly for ISA300) but this | ||
453 | * is already a slow wakeup path and it's simpler to be safe. | ||
454 | */ | ||
455 | li r0,1 | ||
456 | stb r0,PACA_NAPSTATELOST(r13) | ||
457 | |||
458 | /* | ||
445 | * | 459 | * |
446 | * Save SRR1 and LR in NVGPRs as they might be clobbered in | 460 | * Save SRR1 and LR in NVGPRs as they might be clobbered in |
447 | * opal_call() (called in CHECK_HMI_INTERRUPT). SRR1 is required | 461 | * opal_call() (called in CHECK_HMI_INTERRUPT). SRR1 is required |