hv: vm_config: add epc info in vm config

Add EPC information in vm configuration structure.
EPC information contains the EPC base and size allocated to a VM.

Tracked-On: #3179
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Binbin Wu 2019-05-22 15:18:18 +08:00 committed by ACRN System Integration
parent 245a732055
commit c078f90d77
2 changed files with 9 additions and 0 deletions

View File

@ -7,6 +7,7 @@
#include <vm_config.h>
#include <logmsg.h>
#include <cat.h>
#include <pgtable.h>
/*
* @pre vm_id < CONFIG_MAX_VM_NUM
@ -89,6 +90,8 @@ bool sanitize_vm_config(void)
} else if (((vm_config->guest_flags & GUEST_FLAG_LAPIC_PASSTHROUGH) != 0U)
&& ((vm_config->guest_flags & GUEST_FLAG_RT) == 0U)) {
ret = false;
}else if (vm_config->epc.size != 0UL) {
ret = false;
} else {
pre_launch_pcpu_bitmap |= vm_config->pcpu_bitmap;
}
@ -119,6 +122,10 @@ bool sanitize_vm_config(void)
}
}
if (((vm_config->epc.size | vm_config->epc.base) & ~PAGE_MASK) != 0UL) {
ret = false;
}
if (ret) {
/* make sure no identical UUID in following VM configurations */
ret = check_vm_uuid_collision(vm_id);

View File

@ -13,6 +13,7 @@
#include <acrn_common.h>
#include <mptable.h>
#include <vm_configurations.h>
#include <sgx.h>
#define PLUG_CPU(n) (1U << (n))
#define MAX_VUART_NUM_PER_VM 2U
@ -84,6 +85,7 @@ struct acrn_vm_config {
* We could add more guest flags in future;
*/
struct acrn_vm_mem_config memory; /* memory configuration of VM */
struct epc_section epc; /* EPC memory configuration of VM */
uint16_t pci_ptdev_num; /* indicate how many PCI PT devices in VM */
struct acrn_vm_pci_ptdev_config *pci_ptdevs; /* point to PCI PT devices BDF list */
struct acrn_vm_os_config os_config; /* OS information the VM */