diff --git a/hypervisor/arch/x86/configs/apl-mrb/ve820.c b/hypervisor/arch/x86/configs/apl-mrb/ve820.c index 296c63080..8b1a7d767 100644 --- a/hypervisor/arch/x86/configs/apl-mrb/ve820.c +++ b/hypervisor/arch/x86/configs/apl-mrb/ve820.c @@ -7,7 +7,7 @@ #include #include -const struct e820_entry ve820_entry[NUM_E820_ENTRIES] = { +const struct e820_entry ve820_entry[E820_MAX_ENTRIES] = { { /* 0 to mptable */ .baseaddr = 0x0U, .length = 0xEFFFFU, diff --git a/hypervisor/arch/x86/configs/dnv-cb2/ve820.c b/hypervisor/arch/x86/configs/dnv-cb2/ve820.c index a18e69dd1..5ba4c4d49 100644 --- a/hypervisor/arch/x86/configs/dnv-cb2/ve820.c +++ b/hypervisor/arch/x86/configs/dnv-cb2/ve820.c @@ -7,7 +7,7 @@ #include #include -const struct e820_entry ve820_entry[NUM_E820_ENTRIES] = { +const struct e820_entry ve820_entry[E820_MAX_ENTRIES] = { { /* 0 to mptable */ .baseaddr = 0x0U, .length = 0xEFFFFU, diff --git a/hypervisor/arch/x86/guest/vm.c b/hypervisor/arch/x86/guest/vm.c index 84d814c58..dbd964ecd 100644 --- a/hypervisor/arch/x86/guest/vm.c +++ b/hypervisor/arch/x86/guest/vm.c @@ -126,7 +126,7 @@ uint16_t get_vm_pcpu_nums(struct acrn_vm_config *vm_config) */ static void create_prelaunched_vm_e820(struct acrn_vm *vm) { - vm->e820_entry_num = NUM_E820_ENTRIES; + vm->e820_entry_num = E820_MAX_ENTRIES; vm->e820_entries = (struct e820_entry *)ve820_entry; } #endif diff --git a/hypervisor/include/arch/x86/e820.h b/hypervisor/include/arch/x86/e820.h index bb3ebf4b7..f144df6e0 100644 --- a/hypervisor/include/arch/x86/e820.h +++ b/hypervisor/include/arch/x86/e820.h @@ -33,6 +33,8 @@ struct e820_mem_params { uint64_t total_mem_size; }; +extern const struct e820_entry ve820_entry[E820_MAX_ENTRIES]; + /* HV read multiboot header to get e820 entries info and calc total RAM info */ void init_e820(void); diff --git a/hypervisor/include/arch/x86/guest/vm.h b/hypervisor/include/arch/x86/guest/vm.h index 313bf0bff..c6054ad3b 100644 --- a/hypervisor/include/arch/x86/guest/vm.h +++ b/hypervisor/include/arch/x86/guest/vm.h @@ -281,15 +281,6 @@ typedef int32_t (*vm_sw_loader_t)(struct acrn_vm *vm); extern vm_sw_loader_t vm_sw_loader; #ifdef CONFIG_PARTITION_MODE -/* - * Default e820 mem map: - * - * Assumption is every VM launched by ACRN in partition mode uses 2G of RAM. - * there is reserved memory of 64K for MPtable and PCI hole of 512MB - */ -#define NUM_E820_ENTRIES 5U -extern const struct e820_entry ve820_entry[NUM_E820_ENTRIES]; - uint16_t get_vm_pcpu_nums(struct acrn_vm_config *vm_config); void vrtc_init(struct acrn_vm *vm); #endif