Files
cloud-hypervisor/vmm/Cargo.toml
Bo Chen fe5f991c37 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>
2026-04-10 22:55:38 +00:00

103 lines
3.2 KiB
TOML

[package]
authors = ["The Cloud Hypervisor Authors"]
edition.workspace = true
name = "vmm"
rust-version.workspace = true
version = "0.1.0"
[features]
dbus_api = ["blocking", "futures", "zbus"]
default = []
dhat-heap = ["dhat"] # For heap profiling
fw_cfg = ["devices/fw_cfg"]
guest_debug = ["gdbstub", "gdbstub_arch", "kvm"]
igvm = ["dep:igvm", "hex", "igvm_defs", "mshv-bindings", "range_map_vec"]
io_uring = ["block/io_uring"]
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",
]
mshv = [
"hypervisor/mshv",
"pci/mshv",
"vfio-ioctls/mshv",
"virtio-devices/mshv",
"vm-device/mshv",
]
pvmemcontrol = ["devices/pvmemcontrol"]
sev_snp = ["arch/sev_snp", "hypervisor/sev_snp", "virtio-devices/sev_snp"]
tdx = ["arch/tdx", "hypervisor/tdx"]
tracing = ["tracer/tracing"]
[dependencies]
acpi_tables = { workspace = true }
anyhow = { workspace = true }
arch = { path = "../arch" }
bitflags = { workspace = true }
block = { path = "../block" }
blocking = { version = "1.6.2", optional = true }
cfg-if = { workspace = true }
clap = { workspace = true }
devices = { path = "../devices" }
dhat = { workspace = true, optional = true }
epoll = { workspace = true }
event_monitor = { path = "../event_monitor" }
flume = { workspace = true }
futures = { version = "0.3.32", optional = true }
gdbstub = { version = "0.7.10", optional = true }
gdbstub_arch = { version = "0.3.3", optional = true }
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"] }
log = { workspace = true }
micro_http = { git = "https://github.com/firecracker-microvm/micro-http", branch = "main" }
mshv-bindings = { workspace = true, features = [
"fam-wrappers",
"with-serde",
], optional = true }
net_util = { path = "../net_util" }
option_parser = { path = "../option_parser" }
pci = { path = "../pci" }
range_map_vec = { version = "0.2.0", optional = true }
rate_limiter = { path = "../rate_limiter" }
seccompiler = { workspace = true }
serde = { workspace = true, features = ["derive", "rc"] }
serde_json = { workspace = true }
serial_buffer = { path = "../serial_buffer" }
signal-hook = { workspace = true }
thiserror = { workspace = true }
tracer = { path = "../tracer" }
uuid = { workspace = true }
vfio-ioctls = { workspace = true, default-features = false }
vfio_user = { workspace = true }
vhost = { workspace = true }
virtio-bindings = { workspace = true }
virtio-devices = { path = "../virtio-devices" }
vm-allocator = { path = "../vm-allocator" }
vm-device = { path = "../vm-device" }
vm-memory = { workspace = true, features = [
"backend-atomic",
"backend-bitmap",
"backend-mmap",
] }
vm-migration = { path = "../vm-migration" }
vm-virtio = { path = "../vm-virtio" }
vmm-sys-util = { workspace = true, features = ["with-serde"] }
zbus = { version = "5.14.0", optional = true }
zerocopy = { workspace = true, features = ["alloc", "derive"] }
[lints]
workspace = true