summaryrefslogtreecommitdiff
path: root/drivers/crypto/ccp
diff options
context:
space:
mode:
authorPeter Gonda <pgonda@google.com>2023-03-07 20:24:39 +0100
committerBorislav Petkov (AMD) <bp@alien8.de>2023-03-21 11:37:32 +0100
commitefb339a83368ab25de1a18c0fdff85e01c13a1ea (patch)
treed6a2d9ffeaefb71d5a1942020b71020a4ca1852f /drivers/crypto/ccp
parente8d018dd0257f744ca50a729e3d042cf2ec9da65 (diff)
crypto: ccp - Name -1 return value as SEV_RET_NO_FW_CALL
The PSP can return a "firmware error" code of -1 in circumstances where the PSP has not actually been called. To make this protocol unambiguous, name the value SEV_RET_NO_FW_CALL. [ bp: Massage a bit. ] Signed-off-by: Peter Gonda <pgonda@google.com> Signed-off-by: Dionna Glaze <dionnaglaze@google.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20221207010210.2563293-2-dionnaglaze@google.com
Diffstat (limited to 'drivers/crypto/ccp')
-rw-r--r--drivers/crypto/ccp/sev-dev.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/crypto/ccp/sev-dev.c b/drivers/crypto/ccp/sev-dev.c
index e2f25926eb51..823c67a43c38 100644
--- a/drivers/crypto/ccp/sev-dev.c
+++ b/drivers/crypto/ccp/sev-dev.c
@@ -444,10 +444,10 @@ static int __sev_init_ex_locked(int *error)
static int __sev_platform_init_locked(int *error)
{
+ int rc = 0, psp_ret = SEV_RET_NO_FW_CALL;
struct psp_device *psp = psp_master;
- struct sev_device *sev;
- int rc = 0, psp_ret = -1;
int (*init_function)(int *error);
+ struct sev_device *sev;
if (!psp || !psp->sev_data)
return -ENODEV;
@@ -475,9 +475,11 @@ static int __sev_platform_init_locked(int *error)
* initialization function should succeed by replacing the state
* with a reset state.
*/
- dev_err(sev->dev, "SEV: retrying INIT command because of SECURE_DATA_INVALID error. Retrying once to reset PSP SEV state.");
+ dev_err(sev->dev,
+"SEV: retrying INIT command because of SECURE_DATA_INVALID error. Retrying once to reset PSP SEV state.");
rc = init_function(&psp_ret);
}
+
if (error)
*error = psp_ret;