From 7b9a110540131c7d6d97d7ae875ed5789e7c3164 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Fri, 17 Dec 2021 16:41:16 +0100 Subject: [PATCH] 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 --- vmm/src/acpi.rs | 1 - vmm/src/vm.rs | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/vmm/src/acpi.rs b/vmm/src/acpi.rs index 73826c03e..f09eaba29 100644 --- a/vmm/src/acpi.rs +++ b/vmm/src/acpi.rs @@ -778,7 +778,6 @@ pub fn create_acpi_tables( } #[cfg(feature = "tdx")] -#[allow(unused)] pub fn create_acpi_tables_tdx( device_manager: &Arc>, cpu_manager: &Arc>, diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index d74d22d84..82998df3d 100644 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -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)