powernv/powerpc: Add winkle support for offline cpus
Winkle is a deep idle state supported in power8 chips. A core enters winkle when all the threads of the core enter winkle. In this state power supply to the entire chiplet i.e core, private L2 and private L3 is turned off. As a result it gives higher powersavings compared to sleep. But entering winkle results in a total hypervisor state loss. Hence the hypervisor context has to be preserved before entering winkle and restored upon wake up. Power-on Reset Engine (PORE) is a dedicated engine which is responsible for powering on the chiplet during wake up. It can be programmed to restore the register contests of a few specific registers. This patch uses PORE to restore register state wherever possible and uses stack to save and restore rest of the necessary registers. With hypervisor state restore things fall under three categories- per-core state, per-subcore state and per-thread state. To manage this, extend the infrastructure introduced for sleep. Mainly we add a paca variable subcore_sibling_mask. Using this and the core_idle_state we can distingush first thread in core and subcore. Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:

committed by
Michael Ellerman

parent
7cba160ad7
commit
77b54e9f21
@@ -102,9 +102,7 @@ system_reset_pSeries:
|
||||
#ifdef CONFIG_PPC_P7_NAP
|
||||
BEGIN_FTR_SECTION
|
||||
/* Running native on arch 2.06 or later, check if we are
|
||||
* waking up from nap. We only handle no state loss and
|
||||
* supervisor state loss. We do -not- handle hypervisor
|
||||
* state loss at this time.
|
||||
* waking up from nap/sleep/winkle.
|
||||
*/
|
||||
mfspr r13,SPRN_SRR1
|
||||
rlwinm. r13,r13,47-31,30,31
|
||||
@@ -112,7 +110,16 @@ BEGIN_FTR_SECTION
|
||||
|
||||
cmpwi cr3,r13,2
|
||||
|
||||
/*
|
||||
* Check if last bit of HSPGR0 is set. This indicates whether we are
|
||||
* waking up from winkle.
|
||||
*/
|
||||
GET_PACA(r13)
|
||||
clrldi r5,r13,63
|
||||
clrrdi r13,r13,1
|
||||
cmpwi cr4,r5,1
|
||||
mtspr SPRN_HSPRG0,r13
|
||||
|
||||
lbz r0,PACA_THREAD_IDLE_STATE(r13)
|
||||
cmpwi cr2,r0,PNV_THREAD_NAP
|
||||
bgt cr2,8f /* Either sleep or Winkle */
|
||||
|
Reference in New Issue
Block a user