summary refs log tree commit diff
path: root/devices/src/pci/mod.rs
diff options
context:
space:
mode:
authorXiong Zhang <xiong.y.zhang@intel.corp-partner.google.com>2019-04-23 17:14:43 +0800
committerCommit Bot <commit-bot@chromium.org>2019-09-18 17:23:59 +0000
commit9628f61e7125bb6ee2ae921756af185d83a9c2aa (patch)
treeb1c859fe8c635dd75ca78ed883da5c9dc9d6a79a /devices/src/pci/mod.rs
parent36cc5092fc6237ddbd1e63b8d2bc7c1460ea3041 (diff)
downloadcrosvm-9628f61e7125bb6ee2ae921756af185d83a9c2aa.tar
crosvm-9628f61e7125bb6ee2ae921756af185d83a9c2aa.tar.gz
crosvm-9628f61e7125bb6ee2ae921756af185d83a9c2aa.tar.bz2
crosvm-9628f61e7125bb6ee2ae921756af185d83a9c2aa.tar.lz
crosvm-9628f61e7125bb6ee2ae921756af185d83a9c2aa.tar.xz
crosvm-9628f61e7125bb6ee2ae921756af185d83a9c2aa.tar.zst
crosvm-9628f61e7125bb6ee2ae921756af185d83a9c2aa.zip
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 <xiong.y.zhang@intel.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1580458
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Diffstat (limited to 'devices/src/pci/mod.rs')
-rw-r--r--devices/src/pci/mod.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/devices/src/pci/mod.rs b/devices/src/pci/mod.rs
index 791161a..5d44dfc 100644
--- a/devices/src/pci/mod.rs
+++ b/devices/src/pci/mod.rs
@@ -11,6 +11,7 @@ mod ac97_regs;
 mod pci_configuration;
 mod pci_device;
 mod pci_root;
+mod vfio_pci;
 
 pub use self::ac97::Ac97Dev;
 pub use self::pci_configuration::{
@@ -21,6 +22,7 @@ pub use self::pci_configuration::{
 pub use self::pci_device::Error as PciDeviceError;
 pub use self::pci_device::PciDevice;
 pub use self::pci_root::{PciConfigIo, PciConfigMmio, PciRoot};
+pub use self::vfio_pci::VfioPciDevice;
 
 /// PCI has four interrupt pins A->D.
 #[derive(Copy, Clone)]