[Skiboot] [PATCH v2 0/4] Support for Self Save API in OPAL

Pratik Rajesh Sampat psampat at linux.ibm.com
Fri Jan 10 03:29:44 AEDT 2020

v1: https://lists.ozlabs.org/pipermail/skiboot/2019-October/015541.html
v1 --> v2
1. Addressed comments from Oliver O'Halloran
2. Added interface for stop API versioning and use it to identify
support for self save earlier during boot and cut support from the
device tree instead of handling the error later when the OPAL call

Currently the stop API supports a mechanism called as self-restore
which allows us to restore the values of certain SPRs on wakeup from a
deep-stop state to a desired value. To use this, the Kernel makes an
OPAL call passing the PIR of the CPU, the SPR number and the value to
which the SPR should be restored when that CPU wakes up from a deep
stop state.

Recently, a new feature, named self-save has been enabled in the
stop API, which is an alternative mechanism to do the same, except
that self-save will save the current content of the SPR before
entering a deep stop state and also restore the content back on
waking up from a deep stop state.

This patch series aims to add support for the Self saving of registers
and advertises the support for self save and restore along with the list
of SPRs it supports to the device tree.

The node for self-save or self-restore have the following attributes:
1. sprn-bitmask = bitmask where each bit signifies the presence of a SPR
2. status = indicates if the feature is enabled or disabled

Consider the following scenario for the "status" attribute to be
necessary to indicate support for the feature instead of just not
putting the node to indicate non-support:
In the case we are running an older firmware on a newer kernel, we would
want legacy self restore to work as-is. However, if we remove the status
attribute, the node will be absent which will make Operating System
strip this feature away even when legacy firmwares are known to support

Commit adds support calling into the self save firmware API.
Also adds abstraction for making platform agnostic calls.

Commit adds wrappers for the Self Save API for which an OPAL call can be

Commit adds device tree attributes to advertise self save and self
restore functionality along with the register set as a bitmask currently
supported in the firmware

Commit helps determine the version of the STOP API. This helps to
identify support for self save in the firmware and in case the version
is lesser, then we can cut support for the feature from the device tree.

Pratik Rajesh Sampat (2):
  Self save API integration
  Advertise the self-save and self-restore attributes in the device tree

Prem Shanker Jha (2):
  Self Save: Introducing Support for SPR Self Save
  API to verify the STOP API and image compatibility

 doc/opal-api/opal-slw-self-save-reg-176.rst |  33 +
 hw/slw.c                                    | 189 ++++
 include/opal-api.h                          |   3 +-
 include/p9_stop_api.H                       | 122 ++-
 include/skiboot.h                           |   4 +
 libpore/p8_pore_table_gen_api.H             |   1 +
 libpore/p9_cpu_reg_restore_instruction.H    |   6 +-
 libpore/p9_hcd_memmap_base.H                |   7 +
 libpore/p9_stop_api.C                       | 966 +++++++++++---------
 libpore/p9_stop_api.H                       | 141 ++-
 libpore/p9_stop_data_struct.H               |   4 +-
 libpore/p9_stop_util.H                      |   7 +-
 12 files changed, 1060 insertions(+), 423 deletions(-)
 create mode 100644 doc/opal-api/opal-slw-self-save-reg-176.rst


More information about the Skiboot mailing list