[PATCH v5 21/25] powerpc/pseries: Add helper to get PLPKS password length

Andrew Donnellan posted 25 patches 2 years, 7 months ago
There is a newer version of this series
[PATCH v5 21/25] powerpc/pseries: Add helper to get PLPKS password length
Posted by Andrew Donnellan 2 years, 7 months ago
From: Russell Currey <ruscur@russell.cc>

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>

---

v3: New patch

v5: Drop plpks_get_password() since we no longer need to expose it.
---
 arch/powerpc/include/asm/plpks.h       | 5 +++++
 arch/powerpc/platforms/pseries/plpks.c | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/arch/powerpc/include/asm/plpks.h b/arch/powerpc/include/asm/plpks.h
index 0c49969b0864..757313e00521 100644
--- a/arch/powerpc/include/asm/plpks.h
+++ b/arch/powerpc/include/asm/plpks.h
@@ -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
diff --git a/arch/powerpc/platforms/pseries/plpks.c b/arch/powerpc/platforms/pseries/plpks.c
index 926b6a927326..6940280ae94a 100644
--- a/arch/powerpc/platforms/pseries/plpks.c
+++ b/arch/powerpc/platforms/pseries/plpks.c
@@ -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;
-- 
2.39.1
Re: [PATCH v5 21/25] powerpc/pseries: Add helper to get PLPKS password length
Posted by Stefan Berger 2 years, 7 months ago

On 1/31/23 01:39, Andrew Donnellan wrote:
> From: Russell Currey <ruscur@russell.cc>
> 
> 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>

> 
> ---
> 
> v3: New patch
> 
> v5: Drop plpks_get_password() since we no longer need to expose it.
> ---
>   arch/powerpc/include/asm/plpks.h       | 5 +++++
>   arch/powerpc/platforms/pseries/plpks.c | 5 +++++
>   2 files changed, 10 insertions(+)
> 
> diff --git a/arch/powerpc/include/asm/plpks.h b/arch/powerpc/include/asm/plpks.h
> index 0c49969b0864..757313e00521 100644
> --- a/arch/powerpc/include/asm/plpks.h
> +++ b/arch/powerpc/include/asm/plpks.h
> @@ -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
> diff --git a/arch/powerpc/platforms/pseries/plpks.c b/arch/powerpc/platforms/pseries/plpks.c
> index 926b6a927326..6940280ae94a 100644
> --- a/arch/powerpc/platforms/pseries/plpks.c
> +++ b/arch/powerpc/platforms/pseries/plpks.c
> @@ -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;