HV: Extend non-contiguous HPA for hybrid scenario

This patch extends non-contiguous HPA allocations for
pre-launched VMs in hybrid scenario.

Tracked-On: #4217
Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Vijay Dhanraj 2019-12-06 19:14:25 -08:00 committed by wenlingz
parent b32ae229fb
commit c8a4ca6c78
2 changed files with 10 additions and 2 deletions

View File

@ -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, filter_mem_from_sos_e820(vm, vm_config->memory.start_hpa,
vm_config->memory.start_hpa + vm_config->memory.size); vm_config->memory.start_hpa + vm_config->memory.size);
sos_vm_config->memory.size -= 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;
}
} }
} }
} }

View File

@ -37,8 +37,9 @@ enum acrn_vm_load_order {
struct acrn_vm_mem_config { struct acrn_vm_mem_config {
uint64_t start_hpa; /* the start HPA of VM memory configuration, for pre-launched VMs only */ 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 size; /* VM memory size configuration */
uint64_t start_hpa2; /* the start HPA of VM memory configuration, for pre-launched VMs only */ uint64_t start_hpa2; /* Start of second HPA for non-contiguous allocations in VM memory configuration,
uint64_t size_hpa2; /* VM shared memory size 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 { struct target_vuart {