aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm/secvar.h
AgeCommit message (Collapse)AuthorFilesLines
2023-02-12powerpc/secvar: Allow backend to populate static list of variable namesAndrew Donnellan1-0/+4
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 <[email protected]> Signed-off-by: Russell Currey <[email protected]> Reviewed-by: Stefan Berger <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2023-02-12powerpc/secvar: Extend sysfs to include config varsRussell Currey1-0/+2
The forthcoming pseries consumer of the secvar API wants to expose a number of config variables. Allowing secvar implementations to provide their own sysfs attributes makes it easy for consumers to expose what they need to. This is not being used by the OPAL secvar implementation at present, and the config directory will not be created if no attributes are set. Signed-off-by: Russell Currey <[email protected]> Co-developed-by: Andrew Donnellan <[email protected]> Signed-off-by: Andrew Donnellan <[email protected]> Reviewed-by: Stefan Berger <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2023-02-12powerpc/secvar: Handle max object size in the consumerRussell Currey1-0/+1
Currently the max object size is handled in the core secvar code with an entirely OPAL-specific implementation, so create a new max_size() op and move the existing implementation into the powernv platform. Should be no functional change. Signed-off-by: Russell Currey <[email protected]> Signed-off-by: Andrew Donnellan <[email protected]> Reviewed-by: Stefan Berger <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2023-02-12powerpc/secvar: Handle format string in the consumerRussell Currey1-0/+1
The code that handles the format string in secvar-sysfs.c is entirely OPAL specific, so create a new "format" op in secvar_operations to make the secvar code more generic. No functional change. Signed-off-by: Russell Currey <[email protected]> Signed-off-by: Andrew Donnellan <[email protected]> Reviewed-by: Stefan Berger <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2023-02-12powerpc/secvar: Warn and error if multiple secvar ops are setRussell Currey1-2/+2
The secvar code only supports one consumer at a time. Multiple consumers aren't possible at this point in time, but we'd want it to be obvious if it ever could happen. Signed-off-by: Russell Currey <[email protected]> Co-developed-by: Andrew Donnellan <[email protected]> Signed-off-by: Andrew Donnellan <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2023-02-12powerpc/secvar: Use u64 in secvar_operationsMichael Ellerman1-6/+3
There's no reason for secvar_operations to use uint64_t vs the more common kernel type u64. The types are compatible, but they require different printk format strings which can lead to confusion. Change all the secvar related routines to use u64. Reviewed-by: Russell Currey <[email protected]> Reviewed-by: Andrew Donnellan <[email protected]> Signed-off-by: Andrew Donnellan <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2019-11-13powerpc/powernv: Add OPAL API interface to access secure variableNayna Jain1-0/+35
The X.509 certificates trusted by the platform and required to secure boot the OS kernel are wrapped in secure variables, which are controlled by OPAL. This patch adds firmware/kernel interface to read and write OPAL secure variables based on the unique key. This support can be enabled using CONFIG_OPAL_SECVAR. Signed-off-by: Claudio Carvalho <[email protected]> Signed-off-by: Nayna Jain <[email protected]> Signed-off-by: Eric Richter <[email protected]> [mpe: Make secvar_ops __ro_after_init, only build opal-secvar.c if PPC_SECURE_BOOT=y] Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]