From 6c99f764048f7972710736150449e54c3760e8b0 Mon Sep 17 00:00:00 2001 From: Victor Sun Date: Wed, 5 Jun 2019 23:20:49 +0800 Subject: [PATCH] HV: prepare ve820 for apl up2 We need ve820 table to enable prelaunched VM for apl-up2 board; Tracked-On: #3214 Signed-off-by: Victor Sun --- hypervisor/arch/x86/configs/apl-up2/ve820.c | 37 +++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/hypervisor/arch/x86/configs/apl-up2/ve820.c b/hypervisor/arch/x86/configs/apl-up2/ve820.c index c1e5bedd3..3e6f8b1c8 100644 --- a/hypervisor/arch/x86/configs/apl-up2/ve820.c +++ b/hypervisor/arch/x86/configs/apl-up2/ve820.c @@ -6,11 +6,44 @@ #include +#define VE820_ENTRIES_APL_UP2 5U +static const struct e820_entry ve820_entry[VE820_ENTRIES_APL_UP2] = { + { /* usable RAM under 1MB */ + .baseaddr = 0x0UL, + .length = 0xF0000UL, /* 960KB */ + .type = E820_TYPE_RAM + }, + + { /* mptable */ + .baseaddr = 0xF0000UL, /* 960KB */ + .length = 0x10000UL, /* 16KB */ + .type = E820_TYPE_RESERVED + }, + + { /* lowmem */ + .baseaddr = 0x100000UL, /* 1MB */ + .length = 0x1FF00000UL, /* 511MB */ + .type = E820_TYPE_RAM + }, + + { /* between lowmem and PCI hole */ + .baseaddr = 0x20000000UL, /* 512MB */ + .length = 0xA0000000UL, /* 2560MB */ + .type = E820_TYPE_RESERVED + }, + + { /* between PCI hole and 4GB */ + .baseaddr = 0xe0000000UL, /* 3.5GB */ + .length = 0x20000000UL, /* 512MB */ + .type = E820_TYPE_RESERVED + }, +}; + /** * @pre vm != NULL */ void create_prelaunched_vm_e820(struct acrn_vm *vm) { - vm->e820_entry_num = 0U; - vm->e820_entries = NULL; + vm->e820_entry_num = VE820_ENTRIES_APL_UP2; + vm->e820_entries = (struct e820_entry *)ve820_entry; }