HV: vm_load: change kernel type for zephyr image
Previously we only support loading raw format of zephyr image as prelaunched Zephyr VM, this would cause guest F segment overridden issue because the zephyr raw image covers memory space from 0x1000 to 0x100000 upper. To fix this issue, we should support ELF format image loading so that parse and load the multiple segments from ELF image directly. Tracked-On: #6323 Signed-off-by: Victor Sun <victor.sun@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
cf1f3ac51d
commit
178b3e85e3
|
@ -61,7 +61,7 @@ static int32_t init_vm_kernel_info(struct acrn_vm *vm, const struct abi_module *
|
|||
if ((mod->start != NULL) && (mod->size != 0U)) {
|
||||
vm->sw.kernel_info.kernel_src_addr = mod->start;
|
||||
vm->sw.kernel_info.kernel_size = mod->size;
|
||||
if ((vm->sw.kernel_type == KERNEL_BZIMAGE) || (vm->sw.kernel_type == KERNEL_ZEPHYR)) {
|
||||
if ((vm->sw.kernel_type > 0) && (vm->sw.kernel_type < KERNEL_UNKNOWN)) {
|
||||
ret = 0;
|
||||
} else {
|
||||
pr_err("Unsupported Kernel type.");
|
||||
|
|
|
@ -493,7 +493,7 @@ int32_t vm_sw_loader(struct acrn_vm *vm)
|
|||
|
||||
ret = vm_bzimage_loader(vm);
|
||||
|
||||
} else if (vm->sw.kernel_type == KERNEL_ZEPHYR){
|
||||
} else if (vm->sw.kernel_type == KERNEL_RAWIMAGE){
|
||||
|
||||
ret = vm_rawimage_loader(vm);
|
||||
|
||||
|
|
|
@ -110,6 +110,9 @@ struct vuart_config {
|
|||
enum os_kernel_type {
|
||||
KERNEL_BZIMAGE = 1,
|
||||
KERNEL_ZEPHYR,
|
||||
KERNEL_RAWIMAGE,
|
||||
KERNEL_ELF,
|
||||
KERNEL_UNKNOWN,
|
||||
};
|
||||
|
||||
struct acrn_vm_os_config {
|
||||
|
|
Loading…
Reference in New Issue