vmm: acpi: Take &T instead of &Arc<Mutex<T>>

Refactor ACPI table creation functions to accept borrowed
references, removing double indirection and moving locking
to callers.

Signed-off-by: Chinmoy <daschinmoyy21@gmail.com>
This commit is contained in:
Chinmoy
2026-02-16 22:28:31 +05:30
committed by Rob Bradford
parent 7461143194
commit ef9133a3ee
3 changed files with 43 additions and 58 deletions

View File

@@ -2514,9 +2514,9 @@ impl Vm {
// Loop over the ACPI tables and copy them to the HOB.
for acpi_table in crate::acpi::create_acpi_tables_tdx(
&self.device_manager,
&self.cpu_manager,
&self.memory_manager,
&self.device_manager.lock().unwrap(),
&self.cpu_manager.lock().unwrap(),
&self.memory_manager.lock().unwrap(),
&self.numa_nodes,
) {
hob.add_acpi_table(&mem, acpi_table.as_slice())
@@ -2576,9 +2576,9 @@ impl Vm {
let tpm_enabled = self.config.lock().unwrap().tpm.is_some();
let rsdp_addr = crate::acpi::create_acpi_tables(
&mem,
&self.device_manager,
&self.cpu_manager,
&self.memory_manager,
&self.device_manager.lock().unwrap(),
&self.cpu_manager.lock().unwrap(),
&self.memory_manager.lock().unwrap(),
&self.numa_nodes,
tpm_enabled,
);
@@ -2643,9 +2643,9 @@ impl Vm {
if fw_cfg_config.acpi_tables {
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.device_manager.lock().unwrap(),
&self.cpu_manager.lock().unwrap(),
&self.memory_manager.lock().unwrap(),
&self.numa_nodes,
tpm_enabled,
)?;