mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: acpi: Move MemoryManager ACPI device to an MMIO address
Migrate the MemoryManager from a fixed I/O port address to an allocated MMIO address. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
committed by
Sebastien Boeuf
parent
28ab6cea0e
commit
6006068951
+13
-16
@@ -18,6 +18,8 @@ use crate::interrupt::kvm::KvmMsiInterruptManager as MsiInterruptManager;
|
||||
#[cfg(feature = "mshv")]
|
||||
use crate::interrupt::mshv::MshvMsiInterruptManager as MsiInterruptManager;
|
||||
use crate::interrupt::LegacyUserspaceInterruptManager;
|
||||
#[cfg(feature = "acpi")]
|
||||
use crate::memory_manager::MEMORY_MANAGER_ACPI_SIZE;
|
||||
use crate::memory_manager::{Error as MemoryManagerError, MemoryManager};
|
||||
#[cfg(feature = "acpi")]
|
||||
use crate::vm::NumaNodes;
|
||||
@@ -897,22 +899,17 @@ impl DeviceManager {
|
||||
)));
|
||||
|
||||
#[cfg(feature = "acpi")]
|
||||
self.address_manager
|
||||
.allocator
|
||||
.lock()
|
||||
.unwrap()
|
||||
.allocate_io_addresses(Some(GuestAddress(0x0a00)), 0x18, None)
|
||||
.ok_or(DeviceManagerError::AllocateIOPort)?;
|
||||
|
||||
#[cfg(feature = "acpi")]
|
||||
self.address_manager
|
||||
.io_bus
|
||||
.insert(
|
||||
Arc::clone(&self.memory_manager) as Arc<Mutex<dyn BusDevice>>,
|
||||
0xa00,
|
||||
0x18,
|
||||
)
|
||||
.map_err(DeviceManagerError::BusError)?;
|
||||
{
|
||||
let memory_manager_acpi_address = self.memory_manager.lock().unwrap().acpi_address;
|
||||
self.address_manager
|
||||
.mmio_bus
|
||||
.insert(
|
||||
Arc::clone(&self.memory_manager) as Arc<Mutex<dyn BusDevice>>,
|
||||
memory_manager_acpi_address.0,
|
||||
MEMORY_MANAGER_ACPI_SIZE as u64,
|
||||
)
|
||||
.map_err(DeviceManagerError::BusError)?;
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
self.add_legacy_devices(
|
||||
|
||||
Reference in New Issue
Block a user