mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-23 20:53:53 +08:00
77b54e9f21
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>
26 lines
857 B
C
26 lines
857 B
C
/*
|
|
* Copyright 2013, Michael Ellerman, IBM Corporation.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version
|
|
* 2 of the License, or (at your option) any later version.
|
|
*/
|
|
|
|
/* These are ordered and tested with <= */
|
|
#define SYNC_STEP_INITIAL 0
|
|
#define SYNC_STEP_UNSPLIT 1 /* Set by secondary when it sees unsplit */
|
|
#define SYNC_STEP_REAL_MODE 2 /* Set by secondary when in real mode */
|
|
#define SYNC_STEP_FINISHED 3 /* Set by secondary when split/unsplit is done */
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
#ifdef CONFIG_SMP
|
|
void split_core_secondary_loop(u8 *state);
|
|
extern void update_subcore_sibling_mask(void);
|
|
#else
|
|
static inline void update_subcore_sibling_mask(void) { };
|
|
#endif /* CONFIG_SMP */
|
|
|
|
#endif /* __ASSEMBLY__ */
|