diff --git a/hypervisor/arch/x86/guest/vm.c b/hypervisor/arch/x86/guest/vm.c index c9fa2eafb..593e519b2 100644 --- a/hypervisor/arch/x86/guest/vm.c +++ b/hypervisor/arch/x86/guest/vm.c @@ -321,6 +321,13 @@ static void create_sos_vm_e820(struct acrn_vm *vm) filter_mem_from_sos_e820(vm, vm_config->memory.start_hpa, vm_config->memory.start_hpa + vm_config->memory.size); sos_vm_config->memory.size -= vm_config->memory.size; + + /* if HPA2 is available, filter it out as well*/ + if (vm_config->memory.size_hpa2 != 0UL) { + filter_mem_from_sos_e820(vm, vm_config->memory.start_hpa2, + vm_config->memory.start_hpa2 + vm_config->memory.size_hpa2); + sos_vm_config->memory.size -= vm_config->memory.size_hpa2; + } } } } diff --git a/hypervisor/include/arch/x86/vm_config.h b/hypervisor/include/arch/x86/vm_config.h index f4a0672ea..b11431251 100644 --- a/hypervisor/include/arch/x86/vm_config.h +++ b/hypervisor/include/arch/x86/vm_config.h @@ -37,8 +37,9 @@ enum acrn_vm_load_order { struct acrn_vm_mem_config { uint64_t start_hpa; /* the start HPA of VM memory configuration, for pre-launched VMs only */ uint64_t size; /* VM memory size configuration */ - uint64_t start_hpa2; /* the start HPA of VM memory configuration, for pre-launched VMs only */ - uint64_t size_hpa2; /* VM shared memory size configuration */ + uint64_t start_hpa2; /* Start of second HPA for non-contiguous allocations in VM memory configuration, + for pre-launched VMs only */ + uint64_t size_hpa2; /* Size of second HPA for non-contiguous allocations in VM memory configuration */ }; struct target_vuart {