Commit 6e031ef2 authored by Borislav Petkov (AMD)'s avatar Borislav Petkov (AMD) Committed by Herbert Xu
Browse files

crypto: ccp - State in dmesg that TSME is enabled



In the case when only TSME is enabled, it is useful to state that fact
too, so that users are aware that memory encryption is still enabled
even when the corresponding software variant of memory encryption is not
enabled.

Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
Acked-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent e8829ef1
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -156,11 +156,14 @@ static unsigned int psp_get_capability(struct psp_device *psp)
	}
	psp->capability = val;

	/* Detect if TSME and SME are both enabled */
	/* Detect TSME and/or SME status */
	if (PSP_CAPABILITY(psp, PSP_SECURITY_REPORTING) &&
	    psp->capability & (PSP_SECURITY_TSME_STATUS << PSP_CAPABILITY_PSP_SECURITY_OFFSET) &&
	    cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT))
	    psp->capability & (PSP_SECURITY_TSME_STATUS << PSP_CAPABILITY_PSP_SECURITY_OFFSET)) {
		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;
}