HV: add acpi module support for pre-launched VM

Previously we use a pre-defined structure as vACPI table for pre-launched
VM, the structure is initialized by HV code. Now change the method to use a
pre-loaded multiboot module instead. The module file will be generated by
acrn-config tool and loaded to GPA 0x7ff00000, a hardcoded RSDP table at
GPA 0x000f2400 will point to the XSDT table which at GPA 0x7ff00080;

Tracked-On: #5266

Signed-off-by: Victor Sun <victor.sun@intel.com>
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Victor Sun
2020-09-02 15:42:20 +08:00
committed by Fuzhong Liu
parent 4290a79951
commit 34547e1e19
8 changed files with 67 additions and 3 deletions

View File

@@ -187,6 +187,7 @@ int32_t direct_boot_sw_loader(struct acrn_vm *vm)
struct sw_kernel_info *sw_kernel = &(vm->sw.kernel_info);
struct sw_module_info *bootargs_info = &(vm->sw.bootargs_info);
struct sw_module_info *ramdisk_info = &(vm->sw.ramdisk_info);
struct sw_module_info *acpi_info = &(vm->sw.acpi_info);
/* get primary vcpu */
struct acrn_vcpu *vcpu = vcpu_from_vid(vm, BSP_CPU_ID);
@@ -216,6 +217,10 @@ int32_t direct_boot_sw_loader(struct acrn_vm *vm)
(uint64_t)bootargs_info->load_addr,
(strnlen_s((char *)bootargs_info->src_addr, MAX_BOOTARGS_SIZE) + 1U));
}
/* Copy Guest OS ACPI to its load location */
if (acpi_info->size == ACPI_MODULE_SIZE) {
(void)copy_to_gpa(vm, acpi_info->src_addr, (uint64_t)acpi_info->load_addr, ACPI_MODULE_SIZE);
}
switch (vm->sw.kernel_type) {
case KERNEL_BZIMAGE:
prepare_loading_bzimage(vm, vcpu);