[Skiboot] [RFC 1/1] OPAL : Support spr save-restore using new opal call

Benjamin Herrenschmidt benh at kernel.crashing.org
Mon Jul 23 17:14:07 AEST 2018


On Mon, 2018-07-23 at 15:30 +1000, Nicholas Piggin wrote:
> I'm hoping rather than a save API it should just be an enter-idle
> call, and it would expect another call in response to a powersave
> wakeup (or it could return in the case of EC=0 type idle).
> 
> The problem is we may need a new special OPAL call API for
> the wakeup case because that would be re-entrant. IMO we also
> need something similar for OPAL machine check handling, so we
> should think about it and see if something can fit both.
> 
> I'd like Linux not to have to know about any saving of core
> vs thread SPRs or even PSSCR or STOP meanings. Just use an
> idle state number it got from dt.

We don't want OPAL to be the normal path. Only the "oops, we don't know
about that processor/idle_state combination/version, use OPAL as a
fallback". The cost of an OPAL call is too high otherwise.

We could have a separate OPAL entry point for the wakeup case but
putting the entirety of the enter/exit into OPAL is complicated.

We have to arbitrate between multiple threads entering different
states. We don't know until we exit how deep the core actually went and
what actually needs to be restored. It's a function of the SRR1 bits on
return *and* the state that was requested.

There's also the need to synchronize/rendez-vous threads on wakeup in
some cases such as TB resync, and dealing with big vs. small core.

Doing it all in OPAL would require *all* stop states to go to OPAL, I
don't think that's a great idea for performance.

Cheers
Ben.




More information about the Skiboot mailing list