summaryrefslogtreecommitdiff
path: root/drivers/crypto
diff options
context:
space:
mode:
authorPeter Gonda <pgonda@google.com>2023-03-07 22:24:39 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-11-20 13:52:13 +0300
commita5b03f56d38d8e353d75803fa9bf04cdd15e5204 (patch)
tree59ad26e69cf38d2ddd80e0576e32e305c819b667 /drivers/crypto
parent7c7371b41a14e86f53e7dbe5baa7b1d3e0ab324b (diff)
downloadlinux-a5b03f56d38d8e353d75803fa9bf04cdd15e5204.tar.xz
crypto: ccp - Name -1 return value as SEV_RET_NO_FW_CALL
[ Upstream commit efb339a83368ab25de1a18c0fdff85e01c13a1ea ] 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 Stable-dep-of: db10cb9b5746 ("virt: sevguest: Fix passing a stack buffer as a scatterlist target") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/crypto')
-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 3e583f032487..b8e02c3a1961 100644
--- a/drivers/crypto/ccp/sev-dev.c
+++ b/drivers/crypto/ccp/sev-dev.c
@@ -443,10 +443,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;
@@ -474,9 +474,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;