arch, vmm: Add e820 entry related to SGX EPC region

SGX expects the EPC region to be reported as "reserved" from the e820
table. This patch adds a new entry to the table if SGX is enabled.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2020-07-09 10:25:37 +02:00
committed by Samuel Ortiz
parent e10d9b13d4
commit a5c4f0fc6f
2 changed files with 47 additions and 1 deletions

View File

@@ -584,6 +584,14 @@ impl Vm {
));
}
let sgx_epc_region = self
.memory_manager
.lock()
.unwrap()
.sgx_epc_region()
.as_ref()
.cloned();
match entry_addr.setup_header {
Some(hdr) => {
arch::configure_system(
@@ -595,6 +603,7 @@ impl Vm {
Some(hdr),
rsdp_addr,
BootProtocol::LinuxBoot,
sgx_epc_region,
)
.map_err(Error::ConfigureSystem)?;
}
@@ -608,6 +617,7 @@ impl Vm {
None,
rsdp_addr,
entry_addr.protocol,
sgx_epc_region,
)
.map_err(Error::ConfigureSystem)?;
}