]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
crypto: ccp - Move message about TSME being enabled later in init
authorMario Limonciello <mario.limonciello@amd.com>
Tue, 28 May 2024 21:07:12 +0000 (16:07 -0500)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 7 Jun 2024 11:46:39 +0000 (19:46 +0800)
Some of the security attributes data is now populated from an HSTI
command on some processors, so show the message after it has been
populated.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccp/hsti.c
drivers/crypto/ccp/psp-dev.c

index 8b99bbd4efe230c9e6be828308611a32e6ffb070..1b39a4fb55c061bf6fa7030bb47b8da4f324ad3a 100644 (file)
@@ -119,5 +119,20 @@ int psp_init_hsti(struct psp_device *psp)
                        return ret;
        }
 
+       /*
+        * At this stage, if security information hasn't been populated by
+        * either the PSP or by the driver through the platform command,
+        * then there is nothing more to do.
+        */
+       if (!psp->capability.security_reporting)
+               return 0;
+
+       if (psp->capability.tsme_status) {
+               if (cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT))
+                       dev_notice(psp->dev, "psp: Both TSME and SME are active, SME is unnecessary when TSME is active.\n");
+               else
+                       dev_notice(psp->dev, "psp: TSME enabled\n");
+       }
+
        return 0;
 }
index 0a01ad134609799f20caa44bc2083ce5a8c4b470..1c5a7189631eca35c40b555a7c6834ca7f7510a5 100644 (file)
@@ -157,14 +157,6 @@ static unsigned int psp_get_capability(struct psp_device *psp)
        }
        psp->capability.raw = val;
 
-       /* Detect TSME and/or SME status */
-       if (psp->capability.security_reporting && psp->capability.tsme_status) {
-               if (cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT))
-                       dev_notice(psp->dev, "psp: Both TSME and SME are active, SME is unnecessary when TSME is active.\n");
-               else
-                       dev_notice(psp->dev, "psp: TSME enabled\n");
-       }
-
        return 0;
 }