mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-03 20:15:45 +00:00
vmm: cpu: Allocate I/O port for the CPU manager
The CPU manager uses an I/O port and to prevent potential clashes with assignment for PCI devices ensure that it is allocated by the allocator. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
07cdb37dda
commit
348a1bc30e
@ -113,6 +113,9 @@ pub enum Error {
|
|||||||
|
|
||||||
/// Cannot add legacy device to Bus.
|
/// Cannot add legacy device to Bus.
|
||||||
BusError(devices::BusError),
|
BusError(devices::BusError),
|
||||||
|
|
||||||
|
/// Failed to allocate IO port
|
||||||
|
AllocateIOPort,
|
||||||
}
|
}
|
||||||
pub type Result<T> = result::Result<T, Error>;
|
pub type Result<T> = result::Result<T, Error>;
|
||||||
|
|
||||||
@ -405,6 +408,13 @@ impl CpuManager {
|
|||||||
selected_cpu: 0,
|
selected_cpu: 0,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
device_manager
|
||||||
|
.allocator()
|
||||||
|
.lock()
|
||||||
|
.unwrap()
|
||||||
|
.allocate_io_addresses(Some(GuestAddress(0x0cd8)), 0x8, None)
|
||||||
|
.ok_or(Error::AllocateIOPort)?;
|
||||||
|
|
||||||
cpu_manager
|
cpu_manager
|
||||||
.lock()
|
.lock()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
Loading…
Reference in New Issue
Block a user