HV: init VM bootargs only for LaaG
Currently the VM bootargs load address is hard-coded at 8KB right before kernel load address, this should work for Linux kernel only since Linux kernel is guaranteed to be loadered high than GPA 8K so its load address would never be overflowed, other OS like Zephyr has no such assumption. Tracked-On: #5689 Signed-off-by: Victor Sun <victor.sun@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
parent
3310412148
commit
6bb7a45672
|
@ -225,7 +225,10 @@ static int32_t init_vm_sw_load(struct acrn_vm *vm, const struct acrn_multiboot_i
|
|||
}
|
||||
|
||||
if (ret == 0) {
|
||||
init_vm_bootargs_info(vm, mbi);
|
||||
/* Currently VM bootargs only support Linux guest */
|
||||
if (vm->sw.kernel_type == KERNEL_BZIMAGE) {
|
||||
init_vm_bootargs_info(vm, mbi);
|
||||
}
|
||||
/* check whether there is a ramdisk module */
|
||||
mod = get_mod_by_tag(mbi, vm_config->os_config.ramdisk_mod_tag);
|
||||
if (mod != NULL) {
|
||||
|
|
|
@ -212,7 +212,7 @@ int32_t vm_sw_loader(struct acrn_vm *vm)
|
|||
ramdisk_info->size);
|
||||
}
|
||||
/* Copy Guest OS bootargs to its load location */
|
||||
if (bootargs_info->size != 0U) {
|
||||
if ((bootargs_info->size != 0U) && (bootargs_info->load_addr != NULL)) {
|
||||
(void)copy_to_gpa(vm, bootargs_info->src_addr,
|
||||
(uint64_t)bootargs_info->load_addr,
|
||||
(strnlen_s((char *)bootargs_info->src_addr, MAX_BOOTARGS_SIZE) + 1U));
|
||||
|
|
Loading…
Reference in New Issue