[Skiboot] [RFC PATCH RESEND 06/10] keystore: add opal_get_variable runtime service

Stewart Smith stewart at linux.ibm.com
Mon Mar 4 18:12:05 AEDT 2019

Eric Richter <erichte at linux.ibm.com> writes:
> The opal_get_variable runtime service retrieves a variable's data from
> the keystore list if the requested name (as a NULL-terminated string)
> exists in the requested section (enum for ACTIVE_BANK vs UPDATE_QUEUE).
> The kernel may query the size of a variable by calling this service by
> passing a NULL buffer parameter, and the by-reference varsize parameter
> will be set to the variable's data size if found. This will also occur
> if the varsize parameter is smaller than the requested data's size, to
> prevent overflows.
> NOTE: Included in this patch is a hacky macro to switch on the section
> enum, which is a behavior common to each of these runtime services. It
> should probably be changed to a static or inline function in the future.
> Signed-off-by: Eric Richter <erichte at linux.ibm.com>
> ---
>  libstb/keystore.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 51 insertions(+)

I'll not spend much time looking at the details of this and the other
OPAL call implementations as I understand some design has changed.

I think my big points have been made elsewhere:
- documentation in doc/ for all formats and semantics
- ability to unit test and fuzz *everything*
- and the safety of each of the routines parsing anything.

Stewart Smith
OPAL Architect, IBM.

More information about the Skiboot mailing list