diff options
author | Tom Lendacky <thomas.lendacky@amd.com> | 2021-09-08 17:58:37 -0500 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2021-10-04 11:46:58 +0200 |
commit | 4d96f9109109be93618050a50cabb8df7c931ba7 (patch) | |
tree | dde3455d1a40572c7d51ef373b3e027031ddbf20 /arch/x86/kernel/kvm.c | |
parent | x86/sme: Replace occurrences of sme_active() with cc_platform_has() (diff) | |
download | linux-dev-4d96f9109109be93618050a50cabb8df7c931ba7.tar.xz linux-dev-4d96f9109109be93618050a50cabb8df7c931ba7.zip |
x86/sev: Replace occurrences of sev_active() with cc_platform_has()
Replace uses of sev_active() with the more generic cc_platform_has()
using CC_ATTR_GUEST_MEM_ENCRYPT. If future support is added for other
memory encryption technologies, the use of CC_ATTR_GUEST_MEM_ENCRYPT
can be updated, as required.
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210928191009.32551-7-bp@alien8.de
Diffstat (limited to 'arch/x86/kernel/kvm.c')
-rw-r--r-- | arch/x86/kernel/kvm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index b656456c3a94..8863d1941f1b 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -27,6 +27,7 @@ #include <linux/nmi.h> #include <linux/swait.h> #include <linux/syscore_ops.h> +#include <linux/cc_platform.h> #include <asm/timer.h> #include <asm/cpu.h> #include <asm/traps.h> @@ -418,7 +419,7 @@ static void __init sev_map_percpu_data(void) { int cpu; - if (!sev_active()) + if (!cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) return; for_each_possible_cpu(cpu) { |