[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220211210255.9820-3-mario.limonciello@amd.com>
Date: Fri, 11 Feb 2022 15:02:53 -0600
From: Mario Limonciello <mario.limonciello@....com>
To: Borislav Petkov <bp@...en8.de>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>
CC: Kees Cook <keescook@...omium.org>,
Thomas Lendacky <Thomas.Lendacky@....com>,
<hughsient@...il.com>,
Martin Fernandez <martin.fernandez@...ypsium.com>,
<linux-kernel@...r.kernel.org>,
"Brijesh Singh" <brijesh.singh@....com>,
Mario Limonciello <mario.limonciello@....com>
Subject: [PATCH v2 2/4] KVM: SVM: Use cc_platform_has instead of CPU feature flags
The CPU feature flags may have been cleared earlier by the kernel
if the BIOS didn't activate features. Instead use `cc_platform_has`
to determine that SEV was enabled.
Signed-off-by: Mario Limonciello <mario.limonciello@....com>
---
arch/x86/kvm/svm/sev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
index 17b53457d866..d3d1ec78d927 100644
--- a/arch/x86/kvm/svm/sev.c
+++ b/arch/x86/kvm/svm/sev.c
@@ -2105,7 +2105,7 @@ void __init sev_hardware_setup(void)
* CPU supports decode assists, which is mandatory for SEV guests to
* support instruction emulation.
*/
- if (!boot_cpu_has(X86_FEATURE_SEV) ||
+ if (!cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT) ||
WARN_ON_ONCE(!boot_cpu_has(X86_FEATURE_DECODEASSISTS)))
goto out;
@@ -2153,7 +2153,7 @@ void __init sev_hardware_setup(void)
goto out;
/* Does the CPU support SEV-ES? */
- if (!boot_cpu_has(X86_FEATURE_SEV_ES))
+ if (!cc_platform_has(CC_ATTR_GUEST_STATE_ENCRYPT))
goto out;
/* Has the system been allocated ASIDs for SEV-ES? */
--
2.34.1
Powered by blists - more mailing lists