Hi all, We would like to informally announce an effort we started at Microsoft to expose the Microsoft Hypervisor (MSHV) as an alternative accelerator in Qemu on Linux hosts. L1 VMs that have been launched on Azure or HyperV will be able to use a /dev/mshv device to accelerate the operation of L2 (nested) VMs. The support for this device is currently being contributed to the kernel:
https://lore.kernel.org/linux-hyperv/1740611284-27506-1-git-send-email-nunodasne...@linux.microsoft.com/T/#t +-------------+ +----------------+ +--------------+ | | | | | | | Azure Host | | L1 Linux Dom0 | | L2 Guest VM | | | | | | | | OS | | | | | | | | +------------+ | | | | | | | Qemu VMM | | | | | | | +------------+ | | | | | | +------------+ | | | | | | | Kernel | | | | | | | +-----+------+ | | | | | +-------|--------+ +--------------+ | | +-------v-------------------------+ | | | Microsoft Hypervisor (L1) | +-------------+ +-------+-------------------------+ | +-----------------------v-------------------------+ | Microsoft Hypervisor (L0) | +-------------------------------------------------+ +-------------------------------------------------+ | | | Hardware | | | +-------------------------------------------------+ Please find an early snapshot of our work at this location: http://github.com/MSRSSP/qemu-mshv/tree/mshv (some build instructions can be found in ./accel/mshv/rust/README.md) Please note, this is a PoC which is outsourcing the majority of logic to to a library version of the Cloud-Hypervisor VMM and several MSHV-specific rust-vmm crates. This was done as a feasibility study since Cloud-Hypervisor already supports MSHV as an accelerator technology (in addition to KVM). As such it doesn't tie in with the Rust infrastructure that exists in Qemu today. We are currently in the process of porting MSHV-related logic from Cloud-Hypervisor to the Qemu code base, which would be what we aim to upstream. In the mean time, for reference you might still want to look at the provided PoC sources. We expect the self-contained Qemu port to be functionally equivalent (in the early revision). However, please note that you would need the aforementioned kernel patches on the Host if you would want to test the accelerator. We hope to be able to reuse the existing x86 instruction decoder/emulator that already exists in the in Qemu's HVF accelerator (porting the emu from Cloud-Hypervisor would be redundant). A colleagues has sent a patch that attempts to generalize the emulator: https://mail.gnu.org/archive/html/qemu-devel/2025-03/msg01967.html We hope to be able to send an early version of our port as a formal RFC patch set soon and look forward to feedback! thx, Magnus