]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/powernv: Save/Restore additional SPRs for stop4 cpuidle
authorGautham R. Shenoy <ego@linux.vnet.ibm.com>
Fri, 21 Jul 2017 10:41:37 +0000 (16:11 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 1 Aug 2017 11:01:20 +0000 (21:01 +1000)
commit7fdeae2a453d517a37f5ce5bf81a399a17b23ab6
treea3064dfe9698b243c5aed9305d59d84ae401b3c8
parentdd829b68a02518c23cb401c56171a0d4845fc9c2
powerpc/powernv: Save/Restore additional SPRs for stop4 cpuidle

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.

In this patch, we define a SPR save area in PACA (since we have used
up the volatile register space in the stack) and on POWER9, we restore
SPRN_PID, SPRN_LDBAR, SPRN_FSCR, SPRN_HFSCR, SPRN_MMCRA, SPRN_MMCR1,
SPRN_MMCR2 to the values they had before entering stop.

Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/cpuidle.h
arch/powerpc/include/asm/paca.h
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kernel/idle_book3s.S