Skip to content

powerpc/powernv: Enable stop4 via cpuidle

Gautham R. Shenoy linuxppc-dev lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 1 replyIn review
  2. v32 patches 7 repliesSuperseded
  3. v22 patches 4 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches4 repliesSuperseded

v1 --> v2 from the cover letter

- Move the LPCR manipulations for CPU-Hotplug into arch/powerpc/platforms/powernv/idle.c as per Nicholas Piggin's suggestion.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2powerpc/powernv: Save/Restore additional SPRs for stop4 cpuidlearch/powerpc/include/asm/cpuidle.h arch/powerpc/include/asm/paca.h arch/powerpc/kernel/asm-offsets.c +1 more+89 -20 replies
2/2powerpc/powernv: Clear PECE1 in LPCR via stop-api only on Hotplugarch/powerpc/platforms/powernv/idle.c arch/powerpc/platforms/powernv/smp.c+33 -90 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchNicholas Piggin
SeriesR-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [v4 PATCH 0/2] powerpc/powernv: Enable stop4 via cpuidle

From: "Gautham R. Shenoy" <[email protected]>

Hi,

This is the fourth iteration of the patchset to enable exploitation of stop4 idle state on POWER9 via cpuidle.

The earlier version can be found here :
[v3]: https://lkml.org/lkml/2017/7/21/209
[v2]: https://lkml.org/lkml/2017/7/19/152
[v1]: https://lkml.org/lkml/2017/7/18/691

The changes across the versions are as follows:
v3-->v4:
- Modified the subject line to be consistent with the convention. No changes to code.

v2-->v3:
- Use a structure instead of an array for the stop sprs save area.
- Name the offsets into the paca->stop_sprs as STOP_XXX instead of PACA_XXX.
- Add comments in the assembly code explaining why saving/restoring is not needed on POWER8.
- Program the LPCR during platform idle entry/exit on both POWER8 and POWER9 as suggested by Nicholas Piggin.

v1 --> v2:
- Move the LPCR manipulations for CPU-Hotplug into arch/powerpc/platforms/powernv/idle.c as per Nicholas Piggin's suggestion.

====================== Description =========================== The stop4 idle state on POWER9 is a deep idle state which loses hypervisor resources, but whose latency is low enough that it can be exposed via cpuidle.

Until now, the deep idle states which lose hypervisor resources (eg:
winkle) were only exposed via CPU-Hotplug. Hence currently on wakeup from such states, barring a few SPRs which need to be restored to their older value, rest of the SPRS are reinitialized to their values corresponding to that at boot time. When stop4 is used in the context of cpuidle, we want these additional SPRs to be restored to their older value, to ensure that the context on the CPU coming back from idle is same as it was before going idle.

Additionally, the CPU which is in stop4 while idling can be woken up by the decrementer interrupts. So we need to ensure that the LPCR is programmed with PECE1 bit cleared via the stop-api only for the CPU-Hotplug case and not for cpuidle.

The two patches in the series address this problem.

Gautham R. Shenoy (2):
powernv/powerpc:Save/Restore additional SPRs for stop4 cpuidle powernv/powerpc: Clear PECE1 in LPCR via stop-api only on Hotplug

Gautham R. Shenoy (2):
powerpc/powernv: Save/Restore additional SPRs for stop4 cpuidle powerpc/powernv: Clear PECE1 in LPCR via stop-api only on Hotplug

 arch/powerpc/include/asm/cpuidle.h    | 11 ++++++
 arch/powerpc/include/asm/paca.h       |  7 ++++
 arch/powerpc/kernel/asm-offsets.c     |  8 +++++
 arch/powerpc/kernel/idle_book3s.S     | 65 +++++++++++++++++++++++++++++++++--
 arch/powerpc/platforms/powernv/idle.c | 34 +++++++++++++++++-
 arch/powerpc/platforms/powernv/smp.c  |  8 -----
 6 files changed, 122 insertions(+), 11 deletions(-)
Signature · 1 line
1.9.4