From 9628f61e7125bb6ee2ae921756af185d83a9c2aa Mon Sep 17 00:00:00 2001 From: Xiong Zhang Date: Tue, 23 Apr 2019 17:14:43 +0800 Subject: vfio: Implement PciDevice Trait for vfio device According to kernel Documents/vfio.txt and Documents/vfio-mediated-device.txt,user pass host assigned device or mdev to crosvm through --vfio parameter, vfio module open this device and get this device's information. Implement PciDevice trait on this device, then vfio_pci module could trap guest pci cfg r/w and mmio r/w, and transfer this operation into kernel vfio. Currently the relationship of vfio container:group:device are 1:1:1, in the future it could extend to 1:m:n. BUG=chromium:992270 TEST=none Change-Id: I8006ef65022d56197eaeb464811a59db2ce54b9a Signed-off-by: Xiong Zhang Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1580458 Reviewed-by: Zach Reizner Reviewed-by: Daniel Verkamp Tested-by: kokoro Commit-Queue: Daniel Verkamp --- devices/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'devices/src/lib.rs') diff --git a/devices/src/lib.rs b/devices/src/lib.rs index bc9c8c1..512d08b 100644 --- a/devices/src/lib.rs +++ b/devices/src/lib.rs @@ -19,6 +19,7 @@ mod serial; pub mod split_irqchip_common; pub mod usb; mod utils; +pub mod vfio; pub mod virtio; pub use self::bus::Error as BusError; @@ -28,6 +29,7 @@ pub use self::i8042::I8042Device; pub use self::ioapic::Ioapic; pub use self::pci::{ Ac97Dev, PciConfigIo, PciConfigMmio, PciDevice, PciDeviceError, PciInterruptPin, PciRoot, + VfioPciDevice, }; pub use self::pic::Pic; pub use self::pit::{Pit, PitError}; @@ -40,4 +42,5 @@ pub use self::serial::{ }; pub use self::usb::host_backend::host_backend_device_provider::HostBackendDeviceProvider; pub use self::usb::xhci::xhci_controller::XhciController; +pub use self::vfio::VfioDevice; pub use self::virtio::VirtioPciDevice; -- cgit 1.4.1