hv: add ACPI support for pre-launched VMs

Statically define the per vm RSDP/XSDT/MADT ACPI template tables in vacpi.c,
RSDP/XSDT tables are copied to guest physical memory after checksum is
calculated. For MADT table, first fix up process id/lapic id in its lapic
subtable, then the MADT table's checksum is calculated before it is copies to
guest physical memory.

Add 8-bit checksum function in util.h

Tracked-On: #3601
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
dongshen
2019-08-21 19:37:33 -07:00
committed by wenlingz
parent 96b422ce9d
commit b447ce3d86
7 changed files with 191 additions and 4 deletions

View File

@@ -743,6 +743,7 @@ void prepare_vm(uint16_t vm_id, struct acrn_vm_config *vm_config)
if (err == 0) {
if (is_prelaunched_vm(vm)) {
(void)mptable_build(vm);
build_vacpi(vm);
}
(void )vm_sw_loader(vm);