HV: boot guest with boot params

Previously the load GPA of LaaG boot params like zeropage/cmdline and
initgdt are all hard-coded, this would bring potential LaaG boot issues.

The patch will try to fix this issue by finding a 32KB load_params memory
block for LaaG to store these guest boot params.

For other guest with raw image, in general only vgdt need to be cared of so
the load_params will be put at 0x800 since it is a common place that most
guests won't touch for entering protected mode.

Tracked-On: #5626

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
Victor Sun
2021-05-24 01:51:32 +08:00
committed by wenlingz
parent ed97022646
commit 268d4c3f3c
3 changed files with 120 additions and 75 deletions

View File

@@ -900,12 +900,16 @@ void prepare_vm(uint16_t vm_id, struct acrn_vm_config *vm_config)
build_vrsdp(vm);
}
(void)vm_sw_loader(vm);
err = vm_sw_loader(vm);
if (err == 0) {
/* start vm BSP automatically */
start_vm(vm);
/* start vm BSP automatically */
start_vm(vm);
pr_acrnlog("Start VM id: %x name: %s", vm_id, vm_config->name);
pr_acrnlog("Start VM id: %x name: %s", vm_id, vm_config->name);
} else {
pr_err("Failed to load VM id: %x name: %s, error = %d", vm_id, vm_config->name, err);
}
}
}