powerpc/pseries: Add helper to get PLPKS password length
authorRussell Currey <ruscur@russell.cc>
Fri, 10 Feb 2023 08:03:57 +0000 (19:03 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 12 Feb 2023 11:12:39 +0000 (22:12 +1100)
Add helper function to get the PLPKS password length. This will be used
in a later patch to support passing the password between kernels over
kexec.

Signed-off-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
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-23-ajd@linux.ibm.com
arch/powerpc/include/asm/plpks.h
arch/powerpc/platforms/pseries/plpks.c

index 0c49969b0864d9416f0d73b18a2115ddf377d752..757313e00521fcf5c7463cfb8d6cbc5eefdd788e 100644 (file)
@@ -171,6 +171,11 @@ u32 plpks_get_maxlargeobjectsize(void);
  */
 u64 plpks_get_signedupdatealgorithms(void);
 
+/**
+ * Returns the length of the PLPKS password in bytes.
+ */
+u16 plpks_get_passwordlen(void);
+
 #endif // CONFIG_PSERIES_PLPKS
 
 #endif // _ASM_POWERPC_PLPKS_H
index 01ae919b449745af7042a6f2773106db944dc852..671a10acaebf7390abbc86a690666223c5c7f0d7 100644 (file)
@@ -359,6 +359,11 @@ u64 plpks_get_signedupdatealgorithms(void)
        return signedupdatealgorithms;
 }
 
+u16 plpks_get_passwordlen(void)
+{
+       return ospasswordlength;
+}
+
 bool plpks_is_available(void)
 {
        int rc;