hv: refine for HPAn setting

The current code only supports 2 HPA regions per VM.

This patch extended ACRN to support 2+ HPA regions per VM, to use host
memory better if it is scatted among multiple regions.

This patch uses an array to describe the hpa region for the VM, and
change the logic of ve820 to support multiple regions.

This patch dependent on the config tool and GPA SSRAM change

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
This commit is contained in:
Chenli Wei
2022-03-25 10:10:28 +08:00
committed by acrnsi-robot
parent 6c0e8ff793
commit ed1c638c87
3 changed files with 77 additions and 72 deletions

View File

@@ -70,12 +70,15 @@ enum acrn_vm_severity {
SEVERITY_STANDARD_VM = 0x10U,
};
struct vm_hpa_regions {
uint64_t start_hpa;
uint64_t size_hpa;
};
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; /* 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 */
uint64_t region_num;
struct vm_hpa_regions *host_regions;
};
struct target_vuart {