b11b5f
From 4b573adbcc040fa50f1130cb8cf1bdb9559565cf Mon Sep 17 00:00:00 2001
b11b5f
From: Boqun Feng <boqun.feng@gmail.com>
b11b5f
Date: Wed, 13 Oct 2021 11:32:09 +0800
b11b5f
Subject: [PATCH] virt: Support detection for ARM64 Hyper-V guests
b11b5f
b11b5f
The detection of Microsoft Hyper-V VMs is done by cpuid currently,
b11b5f
however there is no cpuid on ARM64. And since ARM64 is now a supported
b11b5f
architecture for Microsoft Hyper-V guests[1], then use DMI tables to
b11b5f
detect a Hyper-V guest, which is more generic and works for ARM64.
b11b5f
b11b5f
[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7aff79e297ee1aa0126924921fd87a4ae59d2467
b11b5f
b11b5f
(cherry picked from commit 506bbc8569014253ea8614b680ccbc4fc2513a87)
b11b5f
b11b5f
Resolves: #2158307
b11b5f
---
b11b5f
 src/basic/virt.c | 1 +
b11b5f
 1 file changed, 1 insertion(+)
b11b5f
b11b5f
diff --git a/src/basic/virt.c b/src/basic/virt.c
b11b5f
index 00d1c894e6..cc95097101 100644
b11b5f
--- a/src/basic/virt.c
b11b5f
+++ b/src/basic/virt.c
b11b5f
@@ -162,6 +162,7 @@ static int detect_vm_dmi_vendor(void) {
b11b5f
                 { "Parallels",     VIRTUALIZATION_PARALLELS },
b11b5f
                 /* https://wiki.freebsd.org/bhyve */
b11b5f
                 { "BHYVE",         VIRTUALIZATION_BHYVE     },
b11b5f
+                { "Microsoft",           VIRTUALIZATION_MICROSOFT },
b11b5f
         };
b11b5f
         unsigned i;
b11b5f
         int r;