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:
Rob Bradford 2019-11-20 14:16:14 +00:00 committed by Sebastien Boeuf
parent 07cdb37dda
commit 348a1bc30e

View File

@ -113,6 +113,9 @@ pub enum Error {
/// Cannot add legacy device to Bus.
BusError(devices::BusError),
/// Failed to allocate IO port
AllocateIOPort,
}
pub type Result<T> = result::Result<T, Error>;
@ -405,6 +408,13 @@ impl CpuManager {
selected_cpu: 0,
}));
device_manager
.allocator()
.lock()
.unwrap()
.allocate_io_addresses(Some(GuestAddress(0x0cd8)), 0x8, None)
.ok_or(Error::AllocateIOPort)?;
cpu_manager
.lock()
.unwrap()