mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vfio: Initial PCI support
This brings the initial PCI support to the VFIO crate. The VfioPciDevice is the main structure and holds an inner VfioDevice. VfioPciDevice implements the PCI trait, leaving the IRQ assignments empty as this will be driven by both the guest and the VFIO PCI device, not by the VMM. As we must trap BAR programming from the guest (We don't want to program the actual device with guest addresses), we use our local PCI configuration cache to read and write BARs. Signed-off-by: Zhang, Xiong Y <xiong.y.zhang@intel.com> Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
@@ -5,22 +5,26 @@
|
||||
|
||||
//#![deny(missing_docs)]
|
||||
//! Virtual Function I/O (VFIO) API
|
||||
|
||||
extern crate byteorder;
|
||||
extern crate devices;
|
||||
extern crate kvm_bindings;
|
||||
extern crate kvm_ioctls;
|
||||
extern crate log;
|
||||
extern crate pci;
|
||||
extern crate vfio_bindings;
|
||||
extern crate vm_allocator;
|
||||
extern crate vm_memory;
|
||||
#[macro_use]
|
||||
extern crate vmm_sys_util;
|
||||
|
||||
mod vfio_device;
|
||||
mod vfio_ioctls;
|
||||
mod vfio_pci;
|
||||
|
||||
use std::mem::size_of;
|
||||
|
||||
pub use vfio_device::{VfioDevice, VfioError};
|
||||
pub use vfio_pci::VfioPciDevice;
|
||||
|
||||
// Returns a `Vec<T>` with a size in bytes at least as large as `size_in_bytes`.
|
||||
fn vec_with_size_in_bytes<T: Default>(size_in_bytes: usize) -> Vec<T> {
|
||||
|
||||
Reference in New Issue
Block a user