vmm: Duplicate Vm::entry_point() across architectures

These will have very different implementations when asynchronously
loading the kernel.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2022-04-28 15:46:41 +01:00
parent 1d1a087fc5
commit 56fe4c61af

View File

@ -2055,12 +2055,23 @@ impl Vm {
Some(rsdp_addr)
}
#[cfg(target_arch = "x86_64")]
fn entry_point(&mut self) -> Result<Option<EntryPoint>> {
#[cfg(feature = "tdx")]
if self.config.lock().unwrap().tdx.is_some() {
return Ok(None);
}
Ok(if self.kernel.as_ref().is_some() {
Some(self.load_kernel()?)
} else {
None
})
}
#[cfg(target_arch = "aarch64")]
fn entry_point(&mut self) -> Result<Option<EntryPoint>> {
Ok(if self.kernel.as_ref().is_some() {
#[cfg(feature = "tdx")]
if self.config.lock().unwrap().tdx.is_some() {
return Ok(None);
}
Some(self.load_kernel()?)
} else {
None