diff options
author | Xiong Zhang <xiong.y.zhang@intel.corp-partner.google.com> | 2019-11-11 18:32:02 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-03-06 01:50:11 +0000 |
commit | ea6cf66ab537ea554c53fa8723f5bd20b8ec98bf (patch) | |
tree | 97459fb0112c4860a9e631dca89e78028dda00ad /devices/src/lib.rs | |
parent | dc7f52bdb76a8f3b3cf6260bc0d861758956991e (diff) | |
download | crosvm-ea6cf66ab537ea554c53fa8723f5bd20b8ec98bf.tar crosvm-ea6cf66ab537ea554c53fa8723f5bd20b8ec98bf.tar.gz crosvm-ea6cf66ab537ea554c53fa8723f5bd20b8ec98bf.tar.bz2 crosvm-ea6cf66ab537ea554c53fa8723f5bd20b8ec98bf.tar.lz crosvm-ea6cf66ab537ea554c53fa8723f5bd20b8ec98bf.tar.xz crosvm-ea6cf66ab537ea554c53fa8723f5bd20b8ec98bf.tar.zst crosvm-ea6cf66ab537ea554c53fa8723f5bd20b8ec98bf.zip |
Vfio: multi vfio group support
current one container contains one group only, but one container could contain multi groups actually. The main gap that current code to support multi groups is that container will be initialized multi times when multi groups exist, as each group will initialize container one time. This patch extracts the code which should run one time only on a container, so when the first group is added into container, this container initialize code will run once. The container once initialize code contains: a. Set iommu driver type as VfioType1V2 b. Setup Iommu table on each guest memory region c. create vfio_kvm device, so kernel kvm and vfio is associated. BUG=chromium:992270 TEST=passthrough two/three vfio devices into guest, these devices belong to different vfio groups, then check these devices function in guest. Change-Id: I94c9c86f70f49957a5e5c1dfd2c7d823ad042320 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2078970 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Xiong Zhang <xiong.y.zhang@intel.corp-partner.google.com>
Diffstat (limited to 'devices/src/lib.rs')
-rw-r--r-- | devices/src/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/devices/src/lib.rs b/devices/src/lib.rs index 2319d86..1ecfc9c 100644 --- a/devices/src/lib.rs +++ b/devices/src/lib.rs @@ -44,5 +44,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::vfio::{VfioContainer, VfioDevice}; pub use self::virtio::VirtioPciDevice; |