Re: [RFC PATCH 3/3] cpuidle/powernv: Conditionally save-restore sprs using opal
From: Nicholas Piggin <npiggin@gmail.com>
Date: 2018-08-02 14:06:03
Also in:
lkml
On Thu, 2 Aug 2018 10:21:32 +0530 Akshay Adiga [off-list ref] wrote:
From: Abhishek Goel <redacted> If a state has "opal-supported" compat flag in device-tree, an opal call needs to be made during the entry and exit of the stop state. This patch passes a hint to the power9_idle_stop and power9_offline_stop. This patch moves the saving and restoring of sprs for P9 cpuidle from kernel to opal. This patch still uses existing code to detect first thread in core. In an attempt to make the powernv idle code backward compatible, and to some extent forward compatible, add support for pre-stop entry and post-stop exit actions in OPAL. If a kernel knows about this opal call, then just a firmware supporting newer hardware is required, instead of waiting for kernel updates.
Still think we should make these do-everything calls. Including executing nap/stop instructions, restoring timebase, possibly even saving and restoring SLB (although a return code could be used to tell the kernel to do that maybe if performance advantage is enough). I haven't had a lot of time to go through it, I'm working on moving ~all of idle_book3s.S to C code, I'd like to do that before this OPAL idle driver if possible. A minor thing I just noticed, you don't have to allocate the opal spr save space in Linux, just do it all in OPAL. Thanks, Nick