powerpc/secvar: Allow backend to populate static list of variable names
authorAndrew Donnellan <ajd@linux.ibm.com>
Fri, 10 Feb 2023 08:03:46 +0000 (19:03 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 12 Feb 2023 11:12:37 +0000 (22:12 +1100)
commit50a466bf3e6f6f177dc0aeefa46a2f8927075a1d
treec495161a8da82cc0f6d95f10ee31d437cf2f9d36
parent86b6c0ae2caee9cadee1256d31b204ea54cb55c0
powerpc/secvar: Allow backend to populate static list of variable names

Currently, the list of variables is populated by calling
secvar_ops->get_next() repeatedly, which is explicitly modelled on the
OPAL API (including the keylen parameter).

For the upcoming PLPKS backend, we have a static list of variable names.
It is messy to fit that into get_next(), so instead, let the backend put
a NULL-terminated array of variable names into secvar_ops->var_names,
which will be used if get_next() is undefined.

Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: Russell Currey <ruscur@russell.cc>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20230210080401.345462-12-ajd@linux.ibm.com
arch/powerpc/include/asm/secvar.h
arch/powerpc/kernel/secvar-sysfs.c