]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/powernv/idle: Decouple Timebase restore & Per-core SPRs restore
authorGautham R. Shenoy <ego@linux.vnet.ibm.com>
Tue, 16 May 2017 08:49:44 +0000 (14:19 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 30 May 2017 04:59:51 +0000 (14:59 +1000)
commit8f8be5040580ee86a152174c6364b425b0ec422e
tree05760153f34e0b923729bdeb527f80d7e91f1b63
parent0b68632a21f39e169853e979bc92c549e3c98427
powerpc/powernv/idle: Decouple Timebase restore & Per-core SPRs restore

On POWER8, in case of
   -  nap: both timebase and hypervisor state is retained.
   -  fast-sleep: timebase is lost. But the hypervisor state is retained.
   -  winkle: timebase and hypervisor state is lost.

Hence, the current code for handling exit from a idle state assumes
that if the timebase value is retained, then so is the hypervisor
state. Thus, the current code doesn't restore per-core hypervisor
state in such cases.

But that is no longer the case on POWER9 where we do have stop states
in which timebase value is retained, but the hypervisor state is
lost. So we have to ensure that the per-core hypervisor state gets
restored in such cases.

Fix this by ensuring that even in the case when timebase is retained,
we explicitly check if we are waking up from a deep stop that loses
per-core hypervisor state (indicated by cr4 being eq or gt), and if
this is the case, we restore the per-core hypervisor state.

Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/idle_book3s.S