Merge tag 'hyperv-next-signed-20220322' of git://git.kernel.org/pub/scm/linux/kernel...
[platform/kernel/linux-starfive.git] / arch / x86 / kernel / cpu / mshyperv.c
index 6c4b6c6..4b67094 100644 (file)
@@ -33,6 +33,7 @@
 #include <asm/nmi.h>
 #include <clocksource/hyperv_timer.h>
 #include <asm/numa.h>
+#include <asm/coco.h>
 
 /* Is Linux running as the root partition? */
 bool hv_root_partition;
@@ -344,6 +345,11 @@ static void __init ms_hyperv_init_platform(void)
                 */
                swiotlb_force = SWIOTLB_FORCE;
 #endif
+               /* Isolation VMs are unenlightened SEV-based VMs, thus this check: */
+               if (IS_ENABLED(CONFIG_AMD_MEM_ENCRYPT)) {
+                       if (hv_get_isolation_type() != HV_ISOLATION_TYPE_NONE)
+                               cc_set_vendor(CC_VENDOR_HYPERV);
+               }
        }
 
        if (hv_max_functions_eax >= HYPERV_CPUID_NESTED_FEATURES) {