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