vmm: tdx: Pass ACPI tables through the HOB

Relying on helpers for creating the ACPI tables and to add each table to
the HOB, this patch connects the dot to provide the set of ACPI tables
to the TD firmware.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2021-12-17 16:41:16 +01:00 committed by Rob Bradford
parent 2acb50f752
commit 7b9a110540
2 changed files with 12 additions and 1 deletions

View File

@ -778,7 +778,6 @@ pub fn create_acpi_tables(
}
#[cfg(feature = "tdx")]
#[allow(unused)]
pub fn create_acpi_tables_tdx(
device_manager: &Arc<Mutex<DeviceManager>>,
cpu_manager: &Arc<Mutex<CpuManager>>,

View File

@ -1841,6 +1841,18 @@ impl Vm {
)
.map_err(Error::PopulateHob)?;
// Loop over the ACPI tables and copy them to the HOB.
#[cfg(feature = "acpi")]
for acpi_table in crate::acpi::create_acpi_tables_tdx(
&self.device_manager,
&self.cpu_manager,
&self.memory_manager,
&self.numa_nodes,
) {
hob.add_acpi_table(&mem, acpi_table.as_slice())
.map_err(Error::PopulateHob)?;
}
hob.finish(&mem).map_err(Error::PopulateHob)?;
Ok(hob_offset)