[PATCH v2 1/4] crypto: ccp: Use cc_platform_has to determine SEV presence

From: Mario Limonciello
Date: Fri Feb 11 2022 - 16:06:13 EST


The CPU feature flag shouldn't be used to determine if SEV is active,
that's what `cc_platform_has` is for.

Signed-off-by: Mario Limonciello <mario.limonciello@xxxxxxx>
---
drivers/crypto/ccp/sev-dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/ccp/sev-dev.c b/drivers/crypto/ccp/sev-dev.c
index 8fd774a10edc..e061eb6a039c 100644
--- a/drivers/crypto/ccp/sev-dev.c
+++ b/drivers/crypto/ccp/sev-dev.c
@@ -1148,7 +1148,7 @@ int sev_dev_init(struct psp_device *psp)
struct sev_device *sev;
int ret = -ENOMEM;

- if (!boot_cpu_has(X86_FEATURE_SEV)) {
+ if (!cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) {
dev_info_once(dev, "SEV: memory encryption not enabled by BIOS\n");
return 0;
}
--
2.34.1