Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: ccp - Move message about TSME being enabled later in init

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>

authored by

Mario Limonciello and committed by
Herbert Xu
059b1352 82f9327f

+15 -8
+15
drivers/crypto/ccp/hsti.c
··· 119 119 return ret; 120 120 } 121 121 122 + /* 123 + * At this stage, if security information hasn't been populated by 124 + * either the PSP or by the driver through the platform command, 125 + * then there is nothing more to do. 126 + */ 127 + if (!psp->capability.security_reporting) 128 + return 0; 129 + 130 + if (psp->capability.tsme_status) { 131 + if (cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT)) 132 + dev_notice(psp->dev, "psp: Both TSME and SME are active, SME is unnecessary when TSME is active.\n"); 133 + else 134 + dev_notice(psp->dev, "psp: TSME enabled\n"); 135 + } 136 + 122 137 return 0; 123 138 }
-8
drivers/crypto/ccp/psp-dev.c
··· 157 157 } 158 158 psp->capability.raw = val; 159 159 160 - /* Detect TSME and/or SME status */ 161 - if (psp->capability.security_reporting && psp->capability.tsme_status) { 162 - if (cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT)) 163 - dev_notice(psp->dev, "psp: Both TSME and SME are active, SME is unnecessary when TSME is active.\n"); 164 - else 165 - dev_notice(psp->dev, "psp: TSME enabled\n"); 166 - } 167 - 168 160 return 0; 169 161 } 170 162