Skip to content

Commit c078f90

Browse files
binbinwu1acrnsi
authored andcommitted
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>
1 parent 245a732 commit c078f90

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

hypervisor/arch/x86/configs/vm_config.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <vm_config.h>
88
#include <logmsg.h>
99
#include <cat.h>
10+
#include <pgtable.h>
1011

1112
/*
1213
* @pre vm_id < CONFIG_MAX_VM_NUM
@@ -89,6 +90,8 @@ bool sanitize_vm_config(void)
8990
} else if (((vm_config->guest_flags & GUEST_FLAG_LAPIC_PASSTHROUGH) != 0U)
9091
&& ((vm_config->guest_flags & GUEST_FLAG_RT) == 0U)) {
9192
ret = false;
93+
}else if (vm_config->epc.size != 0UL) {
94+
ret = false;
9295
} else {
9396
pre_launch_pcpu_bitmap |= vm_config->pcpu_bitmap;
9497
}
@@ -119,6 +122,10 @@ bool sanitize_vm_config(void)
119122
}
120123
}
121124

125+
if (((vm_config->epc.size | vm_config->epc.base) & ~PAGE_MASK) != 0UL) {
126+
ret = false;
127+
}
128+
122129
if (ret) {
123130
/* make sure no identical UUID in following VM configurations */
124131
ret = check_vm_uuid_collision(vm_id);

hypervisor/include/arch/x86/vm_config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <acrn_common.h>
1414
#include <mptable.h>
1515
#include <vm_configurations.h>
16+
#include <sgx.h>
1617

1718
#define PLUG_CPU(n) (1U << (n))
1819
#define MAX_VUART_NUM_PER_VM 2U
@@ -84,6 +85,7 @@ struct acrn_vm_config {
8485
* We could add more guest flags in future;
8586
*/
8687
struct acrn_vm_mem_config memory; /* memory configuration of VM */
88+
struct epc_section epc; /* EPC memory configuration of VM */
8789
uint16_t pci_ptdev_num; /* indicate how many PCI PT devices in VM */
8890
struct acrn_vm_pci_ptdev_config *pci_ptdevs; /* point to PCI PT devices BDF list */
8991
struct acrn_vm_os_config os_config; /* OS information the VM */

0 commit comments

Comments
 (0)