mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-11-16 13:55:04 +00:00
For service and pre-launched VMs, the image loaders in ACRN are functioning the same way as an in-guest bootloader such as GRUB, which allows ACRN to load a guest image and start directly from there and therefore skipping the firmware initialization stage. To re-use image loader code as much as possible, the image loader logic is splitted into two stages, the loading stage and environmental preparation stage. Most part of the loading stage are common logic, and environmental preparation stage should be completely arch-specific. The best place for stage two loader logic is arch_vm_prepare_bsp, which prepares vcpu register states based on the loaded image (entry point, load address, etc.). This commit refactors only the rawimage loader. Other loaders are left for future improvement. Tracked-On: #8830 Signed-off-by: Yifan Liu <yifan1.liu@intel.com> Reviewed-by: Fei Li <fei1.li@intel.com> Acked-by: Wang Yu1 <yu1.wang@intel.com>