mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Support device passthrough with vfio cdev and iommufd
When `--platform iommufd=on` is set, use the vfio cdev interface backed by iommufd instead of the legacy vfio container/group interface for device passthrough. The cdev path opens '/dev/iommu' via IommuFd, allocates an IOAS, and binds VFIO devices through VfioIommufd. The legacy container/group path remains the default and is used when iommufd is not enabled. Add iommufd-ioctls as a workspace dependency and enable the "vfio_cdev" feature on vfio-ioctls for KVM builds. Fixes: #6892 Signed-off-by: Bo Chen <bchen@crusoe.ai>
This commit is contained in:
20
Cargo.lock
generated
20
Cargo.lock
generated
@@ -1097,6 +1097,23 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iommufd-bindings"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fd7de3a04f6fd55f171a6682852f7aa360bb848a85e0c610513349e006b3c139"
|
||||
|
||||
[[package]]
|
||||
name = "iommufd-ioctls"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4eabd3414d9c4e716c9a198fbfac484625f088c075605372daf037edfe336e18"
|
||||
dependencies = [
|
||||
"iommufd-bindings",
|
||||
"thiserror",
|
||||
"vmm-sys-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ipnetwork"
|
||||
version = "0.20.0"
|
||||
@@ -2291,6 +2308,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d4b1d98dff7f0d219278e406323e7eda4d426447bd203c7828189baf0d8c07b7"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"iommufd-bindings",
|
||||
"iommufd-ioctls",
|
||||
"kvm-bindings",
|
||||
"kvm-ioctls",
|
||||
"libc",
|
||||
@@ -2521,6 +2540,7 @@ dependencies = [
|
||||
"hypervisor",
|
||||
"igvm",
|
||||
"igvm_defs",
|
||||
"iommufd-ioctls",
|
||||
"landlock",
|
||||
"libc",
|
||||
"linux-loader",
|
||||
|
||||
Reference in New Issue
Block a user