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:
@@ -17,8 +17,10 @@ ivshmem = ["devices/ivshmem"]
|
||||
kvm = [
|
||||
"arch/kvm",
|
||||
"hypervisor/kvm",
|
||||
"iommufd-ioctls",
|
||||
"pci/kvm",
|
||||
"vfio-ioctls/kvm",
|
||||
"vfio-ioctls/vfio_cdev",
|
||||
"virtio-devices/kvm",
|
||||
"vm-device/kvm",
|
||||
]
|
||||
@@ -55,6 +57,7 @@ hex = { version = "0.4.3", optional = true }
|
||||
hypervisor = { path = "../hypervisor" }
|
||||
igvm = { workspace = true, optional = true }
|
||||
igvm_defs = { workspace = true, optional = true }
|
||||
iommufd-ioctls = { workspace = true, optional = true }
|
||||
landlock = "0.4.4"
|
||||
libc = { workspace = true }
|
||||
linux-loader = { workspace = true, features = ["bzimage", "elf", "pe"] }
|
||||
|
||||
Reference in New Issue
Block a user