From 0eca4d7c68562876a1bbc7421a464ba2d2322be5 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Fri, 17 Apr 2026 09:52:06 +0100 Subject: [PATCH] virtio-devices: Rename control parameter for VIRTIO_F_ACCESS_PLATFORM Rename from iommu to access_platform_enabled. The original name was iommu as this feature was exposed for devices behind an IOMMU however this feature is also now used for confidential VMs so adopt a more general name. Signed-off-by: Rob Bradford --- virtio-devices/src/block.rs | 4 ++-- virtio-devices/src/console.rs | 4 ++-- virtio-devices/src/net.rs | 12 ++++++------ virtio-devices/src/pmem.rs | 4 ++-- virtio-devices/src/rng.rs | 4 ++-- virtio-devices/src/vhost_user/blk.rs | 8 ++++---- virtio-devices/src/vhost_user/fs.rs | 8 ++++---- virtio-devices/src/vhost_user/generic_vhost_user.rs | 8 ++++---- virtio-devices/src/vhost_user/net.rs | 8 ++++---- virtio-devices/src/vsock/device.rs | 4 ++-- 10 files changed, 32 insertions(+), 32 deletions(-) diff --git a/virtio-devices/src/block.rs b/virtio-devices/src/block.rs index 71c0b7ed3..2e28c60da 100644 --- a/virtio-devices/src/block.rs +++ b/virtio-devices/src/block.rs @@ -734,7 +734,7 @@ impl Block { mut disk_image: DiskBackend, disk_path: PathBuf, read_only: bool, - iommu: bool, + access_platform_enabled: bool, num_queues: usize, queue_size: u16, serial: Option, @@ -793,7 +793,7 @@ impl Block { warn!("sparse=on requested but backend does not support sparse operations"); } - if iommu { + if access_platform_enabled { avail_features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM; } diff --git a/virtio-devices/src/console.rs b/virtio-devices/src/console.rs index f141d08b1..0a4cf65cf 100644 --- a/virtio-devices/src/console.rs +++ b/virtio-devices/src/console.rs @@ -602,7 +602,7 @@ impl Console { id: String, endpoint: Endpoint, resize_pipe: Option, - iommu: bool, + access_platform_enabled: bool, seccomp_action: SeccompAction, exit_evt: EventFd, state: Option, @@ -619,7 +619,7 @@ impl Console { ) } else { let mut avail_features = (1u64 << VIRTIO_F_VERSION_1) | (1u64 << VIRTIO_CONSOLE_F_SIZE); - if iommu { + if access_platform_enabled { avail_features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM; } diff --git a/virtio-devices/src/net.rs b/virtio-devices/src/net.rs index 7ddbccca8..d7e1d1f36 100644 --- a/virtio-devices/src/net.rs +++ b/virtio-devices/src/net.rs @@ -468,7 +468,7 @@ impl Net { id: String, taps: Vec, guest_mac: Option, - iommu: bool, + access_platform_enabled: bool, num_queues: usize, queue_size: u16, seccomp_action: SeccompAction, @@ -499,7 +499,7 @@ impl Net { | (1 << VIRTIO_RING_F_EVENT_IDX) | (1 << VIRTIO_F_VERSION_1); - if iommu { + if access_platform_enabled { avail_features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM; } @@ -587,7 +587,7 @@ impl Net { guest_mac: Option, host_mac: &mut Option, mtu: Option, - iommu: bool, + access_platform_enabled: bool, num_queues: usize, queue_size: u16, seccomp_action: SeccompAction, @@ -613,7 +613,7 @@ impl Net { id, taps, guest_mac, - iommu, + access_platform_enabled, num_queues, queue_size, seccomp_action, @@ -632,7 +632,7 @@ impl Net { fds: &[RawFd], guest_mac: Option, mtu: Option, - iommu: bool, + access_platform_enabled: bool, queue_size: u16, seccomp_action: SeccompAction, rate_limiter_config: Option, @@ -666,7 +666,7 @@ impl Net { id, taps, guest_mac, - iommu, + access_platform_enabled, num_queue_pairs * 2, queue_size, seccomp_action, diff --git a/virtio-devices/src/pmem.rs b/virtio-devices/src/pmem.rs index eb94e7104..94f2716b6 100644 --- a/virtio-devices/src/pmem.rs +++ b/virtio-devices/src/pmem.rs @@ -287,7 +287,7 @@ impl Pmem { disk: File, addr: GuestAddress, mapping: UserspaceMapping, - iommu: bool, + access_platform_enabled: bool, seccomp_action: SeccompAction, exit_evt: EventFd, state: Option, @@ -308,7 +308,7 @@ impl Pmem { let mut avail_features = 1u64 << VIRTIO_F_VERSION_1; - if iommu { + if access_platform_enabled { avail_features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM; } (avail_features, 0, config, false) diff --git a/virtio-devices/src/rng.rs b/virtio-devices/src/rng.rs index 2f43ac66d..8d11a3d7b 100644 --- a/virtio-devices/src/rng.rs +++ b/virtio-devices/src/rng.rs @@ -169,7 +169,7 @@ impl Rng { pub fn new( id: String, path: &str, - iommu: bool, + access_platform_enabled: bool, seccomp_action: SeccompAction, exit_evt: EventFd, state: Option, @@ -182,7 +182,7 @@ impl Rng { } else { let mut avail_features = 1u64 << VIRTIO_F_VERSION_1; - if iommu { + if access_platform_enabled { avail_features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM; } diff --git a/virtio-devices/src/vhost_user/blk.rs b/virtio-devices/src/vhost_user/blk.rs index 83653147b..2526b36f6 100644 --- a/virtio-devices/src/vhost_user/blk.rs +++ b/virtio-devices/src/vhost_user/blk.rs @@ -45,7 +45,7 @@ pub struct Blk { guest_memory: Option>, seccomp_action: SeccompAction, exit_evt: EventFd, - iommu: bool, + access_platform_enabled: bool, } impl Blk { @@ -55,7 +55,7 @@ impl Blk { vu_cfg: VhostUserConfig, seccomp_action: SeccompAction, exit_evt: EventFd, - iommu: bool, + access_platform_enabled: bool, state: Option, ) -> Result { let num_queues = vu_cfg.num_queues; @@ -191,7 +191,7 @@ impl Blk { guest_memory: None, seccomp_action, exit_evt, - iommu, + access_platform_enabled, }) } @@ -217,7 +217,7 @@ impl VirtioDevice for Blk { fn features(&self) -> u64 { let mut features = self.vu_common.virtio_common.avail_features; - if self.iommu { + if self.access_platform_enabled { features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM; } features diff --git a/virtio-devices/src/vhost_user/fs.rs b/virtio-devices/src/vhost_user/fs.rs index 509a7a34f..c062edf19 100644 --- a/virtio-devices/src/vhost_user/fs.rs +++ b/virtio-devices/src/vhost_user/fs.rs @@ -68,7 +68,7 @@ pub struct Fs { seccomp_action: SeccompAction, guest_memory: Option>, exit_evt: EventFd, - iommu: bool, + access_platform_enabled: bool, } impl Fs { @@ -83,7 +83,7 @@ impl Fs { cache: Option<(VirtioSharedMemoryList, MmapRegion)>, seccomp_action: SeccompAction, exit_evt: EventFd, - iommu: bool, + access_platform_enabled: bool, state: Option, ) -> Result { // Calculate the actual number of queues needed. @@ -200,7 +200,7 @@ impl Fs { seccomp_action, guest_memory: None, exit_evt, - iommu, + access_platform_enabled, }) } @@ -226,7 +226,7 @@ impl VirtioDevice for Fs { fn features(&self) -> u64 { let mut features = self.vu_common.virtio_common.avail_features; - if self.iommu { + if self.access_platform_enabled { features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM; } features diff --git a/virtio-devices/src/vhost_user/generic_vhost_user.rs b/virtio-devices/src/vhost_user/generic_vhost_user.rs index aed24b082..dda891e91 100644 --- a/virtio-devices/src/vhost_user/generic_vhost_user.rs +++ b/virtio-devices/src/vhost_user/generic_vhost_user.rs @@ -42,7 +42,7 @@ pub struct GenericVhostUser { seccomp_action: SeccompAction, guest_memory: Option>, exit_evt: EventFd, - iommu: bool, + access_platform_enabled: bool, cfg_warning: AtomicBool, } @@ -57,7 +57,7 @@ impl GenericVhostUser { cache: Option<(VirtioSharedMemoryList, MmapRegion)>, seccomp_action: SeccompAction, exit_evt: EventFd, - iommu: bool, + access_platform_enabled: bool, state: Option, ) -> Result { // Calculate the actual number of queues needed. @@ -159,7 +159,7 @@ since the backend only supports {backend_num_queues}\n", seccomp_action, guest_memory: None, exit_evt, - iommu, + access_platform_enabled, cfg_warning: AtomicBool::new(false), }) } @@ -201,7 +201,7 @@ impl VirtioDevice for GenericVhostUser { fn features(&self) -> u64 { let mut features = self.vu_common.virtio_common.avail_features; - if self.iommu { + if self.access_platform_enabled { features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM; } features diff --git a/virtio-devices/src/vhost_user/net.rs b/virtio-devices/src/vhost_user/net.rs index 4803ade33..e5f9eda7d 100644 --- a/virtio-devices/src/vhost_user/net.rs +++ b/virtio-devices/src/vhost_user/net.rs @@ -48,7 +48,7 @@ pub struct Net { ctrl_queue_epoll_thread: Option>, seccomp_action: SeccompAction, exit_evt: EventFd, - iommu: bool, + access_platform_enabled: bool, } impl Net { @@ -62,7 +62,7 @@ impl Net { server: bool, seccomp_action: SeccompAction, exit_evt: EventFd, - iommu: bool, + access_platform_enabled: bool, state: Option, offload_tso: bool, offload_ufo: bool, @@ -220,7 +220,7 @@ impl Net { ctrl_queue_epoll_thread: None, seccomp_action, exit_evt, - iommu, + access_platform_enabled, }) } @@ -252,7 +252,7 @@ impl VirtioDevice for Net { fn features(&self) -> u64 { let mut features = self.vu_common.virtio_common.avail_features; - if self.iommu { + if self.access_platform_enabled { features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM; } features diff --git a/virtio-devices/src/vsock/device.rs b/virtio-devices/src/vsock/device.rs index 0b202945b..c20288c2d 100644 --- a/virtio-devices/src/vsock/device.rs +++ b/virtio-devices/src/vsock/device.rs @@ -339,7 +339,7 @@ where cid: u32, path: PathBuf, mut backend: B, - iommu: bool, + access_platform_enabled: bool, seccomp_action: SeccompAction, exit_evt: EventFd, state: Option, @@ -353,7 +353,7 @@ where } else { let mut avail_features = (1u64 << VIRTIO_F_VERSION_1) | (1u64 << VIRTIO_F_IN_ORDER); - if iommu { + if access_platform_enabled { avail_features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM; } (avail_features, 0, false)