Merge branch 'kvm-guest-sev-migration' into kvm-master
[platform/kernel/linux-starfive.git] / arch / x86 / kernel / kvm.c
index 3910419..41e2965 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/nmi.h>
 #include <linux/swait.h>
 #include <linux/syscore_ops.h>
+#include <linux/cc_platform.h>
 #include <linux/efi.h>
 #include <asm/timer.h>
 #include <asm/cpu.h>
@@ -420,7 +421,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) {
@@ -559,7 +560,7 @@ static int __init setup_efi_kvm_sev_migration(void)
        unsigned long size;
        bool enabled;
 
-       if (!sev_active() ||
+       if (!cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT) ||
            !kvm_para_has_feature(KVM_FEATURE_MIGRATION_CONTROL))
                return 0;
 
@@ -866,7 +867,7 @@ static void kvm_sev_hc_page_enc_status(unsigned long pfn, int npages, bool enc)
 
 static void __init kvm_init_platform(void)
 {
-       if (sev_active() &&
+       if (cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT) &&
            kvm_para_has_feature(KVM_FEATURE_MIGRATION_CONTROL)) {
                unsigned long nr_pages;
                int i;