diff --git a/hypervisor/arch/x86/guest/guest.c b/hypervisor/arch/x86/guest/guest.c index 7b1dfe455..cd82463d6 100644 --- a/hypervisor/arch/x86/guest/guest.c +++ b/hypervisor/arch/x86/guest/guest.c @@ -552,6 +552,14 @@ static void rebuild_vm0_e820(void) e820_mem.total_mem_size -= CONFIG_RAM_SIZE; } +/** + * @param[inout] vm pointer to a vm descriptor + * + * @return 0 - on success + * + * @pre vm != NULL + * @pre is_vm0(vm) == true + */ int prepare_vm0_memmap_and_e820(struct vm *vm) { unsigned int i; @@ -565,9 +573,6 @@ int prepare_vm0_memmap_and_e820(struct vm *vm) IA32E_EPT_UNCACHED); struct e820_entry *entry; - - ASSERT(is_vm0(vm), "This func only for vm0"); - rebuild_vm0_e820(); dev_dbg(ACRN_DBG_GUEST, "vm0: bottom memory - 0x%llx, top memory - 0x%llx\n", diff --git a/hypervisor/boot/sbl/multiboot.c b/hypervisor/boot/sbl/multiboot.c index 9dbe06dca..225d3a5b2 100644 --- a/hypervisor/boot/sbl/multiboot.c +++ b/hypervisor/boot/sbl/multiboot.c @@ -103,16 +103,20 @@ static void *get_kernel_load_addr(void *kernel_src_addr) return kernel_src_addr; } +/** + * @param[inout] vm pointer to a vm descriptor + * + * @return 0 - on success + * @return -EINVAL - on invalid parameters + * + * @pre vm != NULL + * @pre is_vm0(vm) == true + */ int init_vm0_boot_info(struct vm *vm) { struct multiboot_module *mods = NULL; struct multiboot_info *mbi = NULL; - if (!is_vm0(vm)) { - pr_err("just for vm0 to get info!"); - return -EINVAL; - } - if (boot_regs[0] != MULTIBOOT_INFO_MAGIC) { ASSERT(false, "no multiboot info found"); return -EINVAL;