devices: Add userspace IOAPIC implementation

The goal for cloud-hypervisor is to keep the host safe. With this in
mind, we want to emulate as much as possible in userspace instead of
in kernel directly.

The IOAPIC is a good candidate to move from kernel to userspace, which
is why this commit introduces a userspace implementation of the IOAPIC
82093AA based on the documentation:
https://pdos.csail.mit.edu/6.828/2016/readings/ia32/ioapic.pdf

This code is inspired from the files devices/src/ioapic.rs and
devices/src/split_irqchip_common.rs from the crosvm codebase. The
reference version used being 6c1e23eee3065b3f3d6fc4fb992ac9884dbabf68.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2019-06-12 01:12:45 -07:00
committed by Samuel Ortiz
parent c8c4a4d444
commit 950bd205c6
3 changed files with 354 additions and 1 deletions

View File

@@ -8,8 +8,11 @@
//! Emulates virtual and hardware devices.
extern crate byteorder;
extern crate epoll;
extern crate kvm_bindings;
extern crate kvm_ioctls;
extern crate libc;
#[macro_use]
extern crate log;
extern crate vm_memory;
extern crate vmm_sys_util;
@@ -17,6 +20,7 @@ use std::fs::File;
use std::{io, result};
mod bus;
pub mod ioapic;
pub mod legacy;
pub use self::bus::{Bus, BusDevice, Error as BusError};