HV: modularization: move module check to sanitize multiboot info

ACRN used to support deprivileged boot mode which do not need multiboot
modules, while direct boot mode need multiboot modules at lease for
service VM bzImage, so ACRN postponed the multiboot modules sanity check
in init_vm_boot_info.

Now deprivileged boot mode was totally removed, so we can do multiboot
module check in sanitize_acrn_multiboot_info().

Tracked-On: #5661

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Victor Sun 2021-03-07 15:56:35 +08:00 committed by wenlingz
parent a5839e7269
commit bc828dff19
2 changed files with 6 additions and 5 deletions

View File

@ -263,11 +263,7 @@ int32_t init_vm_boot_info(struct acrn_vm *vm)
int32_t ret = -EINVAL; int32_t ret = -EINVAL;
stac(); stac();
if ((mbi->mi_flags & MULTIBOOT_INFO_HAS_MODS) == 0U) { ret = init_vm_sw_load(vm, mbi);
panic("no multiboot module info found");
} else {
ret = init_vm_sw_load(vm, mbi);
}
clac(); clac();
return ret; return ret;

View File

@ -88,6 +88,11 @@ int32_t sanitize_acrn_multiboot_info(uint32_t magic, uint32_t info)
acrn_mbi.mi_flags &= ~MULTIBOOT_INFO_HAS_MODS; acrn_mbi.mi_flags &= ~MULTIBOOT_INFO_HAS_MODS;
} }
if ((acrn_mbi.mi_flags & MULTIBOOT_INFO_HAS_MODS) == 0U) {
pr_err("no multiboot module info found");
mbi_status = -EINVAL;
}
if ((acrn_mbi.mi_flags & MULTIBOOT_INFO_HAS_MMAP) == 0U) { if ((acrn_mbi.mi_flags & MULTIBOOT_INFO_HAS_MMAP) == 0U) {
pr_err("wrong multiboot flags: 0x%08x", acrn_mbi.mi_flags); pr_err("wrong multiboot flags: 0x%08x", acrn_mbi.mi_flags);
mbi_status = -EINVAL; mbi_status = -EINVAL;