Commit df9cad09 authored by Andrew Donnellan's avatar Andrew Donnellan Committed by Michael Ellerman

powerpc/pseries: Add FW_FEATURE_PLPKS feature flag

Add a firmware feature flag, FW_FEATURE_PLPKS, to indicate availability of
Platform KeyStore related hcalls.

Check this flag in plpks_is_available() and pseries_plpks_init() before
trying to make an hcall.
Suggested-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarAndrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230224041012.772648-1-ajd@linux.ibm.com
parent ae7312c0
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
#define FW_FEATURE_FORM2_AFFINITY ASM_CONST(0x0000020000000000) #define FW_FEATURE_FORM2_AFFINITY ASM_CONST(0x0000020000000000)
#define FW_FEATURE_ENERGY_SCALE_INFO ASM_CONST(0x0000040000000000) #define FW_FEATURE_ENERGY_SCALE_INFO ASM_CONST(0x0000040000000000)
#define FW_FEATURE_WATCHDOG ASM_CONST(0x0000080000000000) #define FW_FEATURE_WATCHDOG ASM_CONST(0x0000080000000000)
#define FW_FEATURE_PLPKS ASM_CONST(0x0000100000000000)
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
...@@ -77,7 +78,8 @@ enum { ...@@ -77,7 +78,8 @@ enum {
FW_FEATURE_DRC_INFO | FW_FEATURE_BLOCK_REMOVE | FW_FEATURE_DRC_INFO | FW_FEATURE_BLOCK_REMOVE |
FW_FEATURE_PAPR_SCM | FW_FEATURE_ULTRAVISOR | FW_FEATURE_PAPR_SCM | FW_FEATURE_ULTRAVISOR |
FW_FEATURE_RPT_INVALIDATE | FW_FEATURE_FORM2_AFFINITY | FW_FEATURE_RPT_INVALIDATE | FW_FEATURE_FORM2_AFFINITY |
FW_FEATURE_ENERGY_SCALE_INFO | FW_FEATURE_WATCHDOG, FW_FEATURE_ENERGY_SCALE_INFO | FW_FEATURE_WATCHDOG |
FW_FEATURE_PLPKS,
FW_FEATURE_PSERIES_ALWAYS = 0, FW_FEATURE_PSERIES_ALWAYS = 0,
FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL | FW_FEATURE_ULTRAVISOR, FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL | FW_FEATURE_ULTRAVISOR,
FW_FEATURE_POWERNV_ALWAYS = 0, FW_FEATURE_POWERNV_ALWAYS = 0,
......
...@@ -68,6 +68,7 @@ hypertas_fw_features_table[] = { ...@@ -68,6 +68,7 @@ hypertas_fw_features_table[] = {
{FW_FEATURE_RPT_INVALIDATE, "hcall-rpt-invalidate"}, {FW_FEATURE_RPT_INVALIDATE, "hcall-rpt-invalidate"},
{FW_FEATURE_ENERGY_SCALE_INFO, "hcall-energy-scale-info"}, {FW_FEATURE_ENERGY_SCALE_INFO, "hcall-energy-scale-info"},
{FW_FEATURE_WATCHDOG, "hcall-watchdog"}, {FW_FEATURE_WATCHDOG, "hcall-watchdog"},
{FW_FEATURE_PLPKS, "hcall-pks"},
}; };
/* Build up the firmware features bitmask using the contents of /* Build up the firmware features bitmask using the contents of
......
...@@ -378,7 +378,7 @@ bool plpks_is_available(void) ...@@ -378,7 +378,7 @@ bool plpks_is_available(void)
{ {
int rc; int rc;
if (!firmware_has_feature(FW_FEATURE_LPAR)) if (!firmware_has_feature(FW_FEATURE_PLPKS))
return false; return false;
rc = _plpks_get_config(); rc = _plpks_get_config();
...@@ -690,6 +690,9 @@ static __init int pseries_plpks_init(void) ...@@ -690,6 +690,9 @@ static __init int pseries_plpks_init(void)
{ {
int rc; int rc;
if (!firmware_has_feature(FW_FEATURE_PLPKS))
return -ENODEV;
rc = _plpks_get_config(); rc = _plpks_get_config();
if (rc) { if (rc) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment