vmm: Parallelise functionality with kernel loading

Move fuctionality earlier in the boot so as to run in parallel with the
loading of the kernel.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2022-04-28 16:33:39 +01:00
parent e70bd069b3
commit 744a049007

View File

@ -2139,6 +2139,13 @@ impl Vm {
};
current_state.valid_transition(new_state)?;
// Do earlier to parallelise with loading kernel
#[cfg(target_arch = "x86_64")]
let rsdp_addr = self.create_acpi_tables();
self.setup_signal_handler()?;
self.setup_tty()?;
// Load kernel if configured
let entry_point = self.entry_point()?;
@ -2163,8 +2170,6 @@ impl Vm {
Vec::new()
};
let rsdp_addr = self.create_acpi_tables();
// Configuring the TDX regions requires that the vCPUs are created.
#[cfg(feature = "tdx")]
let hob_address = if self.config.lock().unwrap().tdx.is_some() {
@ -2174,6 +2179,11 @@ impl Vm {
None
};
// On aarch64 the ACPI tables depend on the vCPU mpidr which is only
// available after they are configured
#[cfg(target_arch = "aarch64")]
let rsdp_addr = self.create_acpi_tables();
// Configure shared state based on loaded kernel
entry_point
.map(|_| {
@ -2208,9 +2218,6 @@ impl Vm {
.map_err(Error::CpuManager)?;
}
self.setup_signal_handler()?;
self.setup_tty()?;
let mut state = self.state.try_write().map_err(|_| Error::PoisonedState)?;
*state = new_state;
event!("vm", "booted");