mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
arch, vmm: Create SGX virtual EPC sections from MemoryManager
Based on the presence of one or multiple SGX EPC sections from the VM configuration, the MemoryManager will allocate a contiguous block of guest address space to hold the entire EPC region. Within this EPC region, each EPC section is memory mapped. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
committed by
Samuel Ortiz
parent
d9244e9f4c
commit
84cf12d86a
@@ -351,6 +351,17 @@ impl Vm {
|
||||
)
|
||||
.map_err(Error::MemoryManager)?;
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
{
|
||||
if let Some(sgx_epc_config) = config.lock().unwrap().sgx_epc.clone() {
|
||||
memory_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.setup_sgx(sgx_epc_config)
|
||||
.map_err(Error::MemoryManager)?;
|
||||
}
|
||||
}
|
||||
|
||||
let new_vm = Vm::new_from_memory_manager(
|
||||
config,
|
||||
memory_manager,
|
||||
|
||||
Reference in New Issue
Block a user