mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-26 07:21:37 +00:00
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 guest kernel only. Linux kernel bzImage boot protocol guarantees its load address to be high than GPA 8K so the 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
8af704beec
commit
f44fb6856b
@ -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 kernel bzImage format */
|
||||
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
Block a user