virt: Support detection for ARM64 Hyper-V guests
authorBoqun Feng <boqun.feng@gmail.com>
Wed, 13 Oct 2021 03:32:09 +0000 (11:32 +0800)
committerMichael Biebl <biebl@debian.org>
Sun, 7 Aug 2022 13:25:09 +0000 (14:25 +0100)
The detection of Microsoft Hyper-V VMs is done by cpuid currently,
however there is no cpuid on ARM64. And since ARM64 is now a supported
architecture for Microsoft Hyper-V guests[1], then use DMI tables to
detect a Hyper-V guest, which is more generic and works for ARM64.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7aff79e297ee1aa0126924921fd87a4ae59d2467

(cherry picked from commit 506bbc8569014253ea8614b680ccbc4fc2513a87)

Gbp-Pq: Name virt-Support-detection-for-ARM64-Hyper-V-guests.patch

src/basic/virt.c

index 7d78a402b33bdae7c8dce168b609b31397165c1e..0d45ee67cf7f9bab1685d43b5f983deab3223eca 100644 (file)
@@ -158,6 +158,7 @@ static int detect_vm_dmi(void) {
                 { "Parallels",           VIRTUALIZATION_PARALLELS },
                 /* https://wiki.freebsd.org/bhyve */
                 { "BHYVE",               VIRTUALIZATION_BHYVE     },
+                { "Microsoft",           VIRTUALIZATION_MICROSOFT },
         };
         unsigned i;
         int r;