mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
devices: Add acpi tables to fw_cfg
The acpi tables are created in the same place the acpi tables would be created for the regular bootflow, except here we add them to the fw_cfg device to be measured by the fw and then the fw will put the acpi tables into memory. Signed-off-by: Alex Orozco <alexorozco@google.com>
This commit is contained in:
@@ -355,6 +355,10 @@ pub enum Error {
|
||||
#[cfg(feature = "fw_cfg")]
|
||||
#[error("Error creating e820 map")]
|
||||
CreatingE820Map(#[source] io::Error),
|
||||
|
||||
#[cfg(feature = "fw_cfg")]
|
||||
#[error("Error creating acpi tables")]
|
||||
CreatingAcpiTables(#[source] io::Error),
|
||||
}
|
||||
pub type Result<T> = result::Result<T, Error>;
|
||||
|
||||
@@ -2361,10 +2365,21 @@ impl Vm {
|
||||
} else {
|
||||
VmState::Running
|
||||
};
|
||||
|
||||
current_state.valid_transition(new_state)?;
|
||||
|
||||
#[cfg(feature = "fw_cfg")]
|
||||
Self::populate_fw_cfg(&self.device_manager, &self.config)?;
|
||||
{
|
||||
Self::populate_fw_cfg(&self.device_manager, &self.config)?;
|
||||
let tpm_enabled = self.config.lock().unwrap().tpm.is_some();
|
||||
crate::acpi::create_acpi_tables_for_fw_cfg(
|
||||
&self.device_manager,
|
||||
&self.cpu_manager,
|
||||
&self.memory_manager,
|
||||
&self.numa_nodes,
|
||||
tpm_enabled,
|
||||
)?
|
||||
}
|
||||
|
||||
// Do earlier to parallelise with loading kernel
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
|
||||
Reference in New Issue
Block a user