mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
Recent changes related to arm64 support in MSHV exposed inconsistencies in the VM initialization and CVM boot paths. The VM creation flow currently diverges across multiple scenarios, including regular MSHV, CVM, and arm64, with each path performing guest initialization steps in a different order. Certain platform-specific requirements further constrain the ordering of operations, such as the timing of address space creation, IGVM loading, interrupt controller setup, and payload loading. For CVM case address-space creation must be done after IGVM loading, and PSP measurement. For Regular and arm64 this memory initialization must be done early. For MSHV, vm.init() and sev_snp.init() are called in different order which is run time and build time conditionally checked. Additionally, while the KVM initialization path differs slightly from MSHV, it shares common logic that is currently split across separate conditional and build-time code paths, contributing to fragmentation of the overall flow. This change restructures the VM creation and initialization sequence to better align shared logic, enforce scenario-specific ordering constraints, and ensure consistent and correct behavior across all supported configurations. In doing so, it restores proper CVM boot behavior and improves the maintainability of the initialization code. Signed-off-by: Muminul Islam <muislam@microsoft.com>