mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: Rename VIRTIO_F_IOMMU_PLATFORM
Rename the transport feature bit constant from VIRTIO_F_IOMMU_PLATFORM to VIRTIO_F_ACCESS_PLATFORM across the entire virtio-devices crate. The virtio specification as of v1.1 carries bit 33 as VIRTIO_F_ACCESS_PLATFORM. The Linux kernel UAPI header <linux/virtio_config.h> carries VIRTIO_F_IOMMU_PLATFORM only as a backward-compatible alias. This is a pure rename with no functional or behavioral change. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
313d980538
commit
da0d0a2090
@@ -737,7 +737,7 @@ impl Block {
|
||||
}
|
||||
|
||||
if iommu {
|
||||
avail_features |= 1u64 << VIRTIO_F_IOMMU_PLATFORM;
|
||||
avail_features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM;
|
||||
}
|
||||
|
||||
if read_only {
|
||||
|
||||
@@ -25,7 +25,7 @@ use vmm_sys_util::eventfd::EventFd;
|
||||
|
||||
use super::{
|
||||
ActivateResult, EPOLL_HELPER_EVENT_LAST, EpollHelper, EpollHelperError, EpollHelperHandler,
|
||||
Error as DeviceError, VIRTIO_F_IOMMU_PLATFORM, VIRTIO_F_VERSION_1, VirtioCommon, VirtioDevice,
|
||||
Error as DeviceError, VIRTIO_F_ACCESS_PLATFORM, VIRTIO_F_VERSION_1, VirtioCommon, VirtioDevice,
|
||||
VirtioDeviceType, VirtioInterruptType,
|
||||
};
|
||||
use crate::seccomp_filters::Thread;
|
||||
@@ -609,7 +609,7 @@ impl Console {
|
||||
} else {
|
||||
let mut avail_features = (1u64 << VIRTIO_F_VERSION_1) | (1u64 << VIRTIO_CONSOLE_F_SIZE);
|
||||
if iommu {
|
||||
avail_features |= 1u64 << VIRTIO_F_IOMMU_PLATFORM;
|
||||
avail_features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM;
|
||||
}
|
||||
|
||||
(
|
||||
|
||||
@@ -71,7 +71,7 @@ const DEVICE_FAILED: u32 = 0x80;
|
||||
const VIRTIO_F_RING_INDIRECT_DESC: u32 = 28;
|
||||
const VIRTIO_F_RING_EVENT_IDX: u32 = 29;
|
||||
const VIRTIO_F_VERSION_1: u32 = 32;
|
||||
const VIRTIO_F_IOMMU_PLATFORM: u32 = 33;
|
||||
const VIRTIO_F_ACCESS_PLATFORM: u32 = 33;
|
||||
const VIRTIO_F_IN_ORDER: u32 = 35;
|
||||
const VIRTIO_F_ORDER_PLATFORM: u32 = 36;
|
||||
#[allow(dead_code)]
|
||||
|
||||
@@ -463,7 +463,7 @@ impl Net {
|
||||
| (1 << VIRTIO_F_VERSION_1);
|
||||
|
||||
if iommu {
|
||||
avail_features |= 1u64 << VIRTIO_F_IOMMU_PLATFORM;
|
||||
avail_features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM;
|
||||
}
|
||||
|
||||
// Configure TSO/UFO features when hardware checksum offload is enabled.
|
||||
|
||||
@@ -31,7 +31,7 @@ use vmm_sys_util::eventfd::EventFd;
|
||||
|
||||
use super::{
|
||||
ActivateError, ActivateResult, EPOLL_HELPER_EVENT_LAST, EpollHelper, EpollHelperError,
|
||||
EpollHelperHandler, Error as DeviceError, VIRTIO_F_IOMMU_PLATFORM, VIRTIO_F_VERSION_1,
|
||||
EpollHelperHandler, Error as DeviceError, VIRTIO_F_ACCESS_PLATFORM, VIRTIO_F_VERSION_1,
|
||||
VirtioCommon, VirtioDevice, VirtioDeviceType,
|
||||
};
|
||||
use crate::seccomp_filters::Thread;
|
||||
@@ -307,7 +307,7 @@ impl Pmem {
|
||||
let mut avail_features = 1u64 << VIRTIO_F_VERSION_1;
|
||||
|
||||
if iommu {
|
||||
avail_features |= 1u64 << VIRTIO_F_IOMMU_PLATFORM;
|
||||
avail_features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM;
|
||||
}
|
||||
(avail_features, 0, config, false)
|
||||
};
|
||||
|
||||
@@ -24,7 +24,7 @@ use vmm_sys_util::eventfd::EventFd;
|
||||
|
||||
use super::{
|
||||
ActivateError, ActivateResult, EPOLL_HELPER_EVENT_LAST, EpollHelper, EpollHelperError,
|
||||
EpollHelperHandler, Error as DeviceError, VIRTIO_F_IOMMU_PLATFORM, VIRTIO_F_VERSION_1,
|
||||
EpollHelperHandler, Error as DeviceError, VIRTIO_F_ACCESS_PLATFORM, VIRTIO_F_VERSION_1,
|
||||
VirtioCommon, VirtioDevice, VirtioDeviceType,
|
||||
};
|
||||
use crate::seccomp_filters::Thread;
|
||||
@@ -180,7 +180,7 @@ impl Rng {
|
||||
let mut avail_features = 1u64 << VIRTIO_F_VERSION_1;
|
||||
|
||||
if iommu {
|
||||
avail_features |= 1u64 << VIRTIO_F_IOMMU_PLATFORM;
|
||||
avail_features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM;
|
||||
}
|
||||
|
||||
(avail_features, 0, false)
|
||||
|
||||
@@ -28,7 +28,7 @@ use vmm_sys_util::eventfd::EventFd;
|
||||
|
||||
use crate::{
|
||||
ActivateError, ActivateResult, DEVICE_ACKNOWLEDGE, DEVICE_DRIVER, DEVICE_DRIVER_OK,
|
||||
DEVICE_FEATURES_OK, GuestMemoryMmap, VIRTIO_F_IOMMU_PLATFORM, VirtioCommon, VirtioDevice,
|
||||
DEVICE_FEATURES_OK, GuestMemoryMmap, VIRTIO_F_ACCESS_PLATFORM, VirtioCommon, VirtioDevice,
|
||||
VirtioInterrupt, VirtioInterruptType, get_host_address_range,
|
||||
};
|
||||
|
||||
@@ -164,7 +164,7 @@ impl Vdpa {
|
||||
|
||||
let iova_range = vhost.get_iova_range().map_err(Error::GetIovaRange)?;
|
||||
|
||||
if avail_features & (1u64 << VIRTIO_F_IOMMU_PLATFORM) == 0 {
|
||||
if avail_features & (1u64 << VIRTIO_F_ACCESS_PLATFORM) == 0 {
|
||||
return Err(Error::MissingAccessPlatformVirtioFeature);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ use super::{DEFAULT_VIRTIO_FEATURES, Error, Result};
|
||||
use crate::seccomp_filters::Thread;
|
||||
use crate::thread_helper::spawn_virtio_thread;
|
||||
use crate::vhost_user::VhostUserCommon;
|
||||
use crate::{GuestMemoryMmap, GuestRegionMmap, VIRTIO_F_IOMMU_PLATFORM, VirtioInterrupt};
|
||||
use crate::{GuestMemoryMmap, GuestRegionMmap, VIRTIO_F_ACCESS_PLATFORM, VirtioInterrupt};
|
||||
|
||||
const DEFAULT_QUEUE_NUMBER: usize = 1;
|
||||
|
||||
@@ -239,7 +239,7 @@ impl VirtioDevice for Blk {
|
||||
fn features(&self) -> u64 {
|
||||
let mut features = self.common.avail_features;
|
||||
if self.iommu {
|
||||
features |= 1u64 << VIRTIO_F_IOMMU_PLATFORM;
|
||||
features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM;
|
||||
}
|
||||
features
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ use crate::seccomp_filters::Thread;
|
||||
use crate::thread_helper::spawn_virtio_thread;
|
||||
use crate::vhost_user::VhostUserCommon;
|
||||
use crate::{
|
||||
ActivateResult, GuestMemoryMmap, GuestRegionMmap, MmapRegion, VIRTIO_F_IOMMU_PLATFORM,
|
||||
ActivateResult, GuestMemoryMmap, GuestRegionMmap, MmapRegion, VIRTIO_F_ACCESS_PLATFORM,
|
||||
VirtioCommon, VirtioDevice, VirtioDeviceType, VirtioInterrupt, VirtioSharedMemoryList,
|
||||
};
|
||||
|
||||
@@ -248,7 +248,7 @@ impl VirtioDevice for Fs {
|
||||
fn features(&self) -> u64 {
|
||||
let mut features = self.common.avail_features;
|
||||
if self.iommu {
|
||||
features |= 1u64 << VIRTIO_F_IOMMU_PLATFORM;
|
||||
features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM;
|
||||
}
|
||||
features
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ use crate::seccomp_filters::Thread;
|
||||
use crate::thread_helper::spawn_virtio_thread;
|
||||
use crate::vhost_user::VhostUserCommon;
|
||||
use crate::{
|
||||
ActivateResult, GuestMemoryMmap, GuestRegionMmap, MmapRegion, VIRTIO_F_IOMMU_PLATFORM,
|
||||
ActivateResult, GuestMemoryMmap, GuestRegionMmap, MmapRegion, VIRTIO_F_ACCESS_PLATFORM,
|
||||
VirtioCommon, VirtioDevice, VirtioInterrupt, VirtioSharedMemoryList,
|
||||
};
|
||||
|
||||
@@ -218,7 +218,7 @@ impl VirtioDevice for GenericVhostUser {
|
||||
fn features(&self) -> u64 {
|
||||
let mut features = self.common.avail_features;
|
||||
if self.iommu {
|
||||
features |= 1u64 << VIRTIO_F_IOMMU_PLATFORM;
|
||||
features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM;
|
||||
}
|
||||
features
|
||||
}
|
||||
|
||||
@@ -30,8 +30,8 @@ use crate::thread_helper::spawn_virtio_thread;
|
||||
use crate::vhost_user::vu_common_ctrl::{VhostUserConfig, VhostUserHandle};
|
||||
use crate::vhost_user::{DEFAULT_VIRTIO_FEATURES, Error, Result, VhostUserCommon};
|
||||
use crate::{
|
||||
ActivateResult, GuestMemoryMmap, GuestRegionMmap, NetCtrlEpollHandler, VIRTIO_F_IOMMU_PLATFORM,
|
||||
VirtioCommon, VirtioDevice, VirtioDeviceType, VirtioInterrupt,
|
||||
ActivateResult, GuestMemoryMmap, GuestRegionMmap, NetCtrlEpollHandler,
|
||||
VIRTIO_F_ACCESS_PLATFORM, VirtioCommon, VirtioDevice, VirtioDeviceType, VirtioInterrupt,
|
||||
};
|
||||
|
||||
const DEFAULT_QUEUE_NUMBER: usize = 2;
|
||||
@@ -275,7 +275,7 @@ impl VirtioDevice for Net {
|
||||
fn features(&self) -> u64 {
|
||||
let mut features = self.common.avail_features;
|
||||
if self.iommu {
|
||||
features |= 1u64 << VIRTIO_F_IOMMU_PLATFORM;
|
||||
features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM;
|
||||
}
|
||||
features
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ use crate::seccomp_filters::Thread;
|
||||
use crate::thread_helper::spawn_virtio_thread;
|
||||
use crate::{
|
||||
ActivateResult, EPOLL_HELPER_EVENT_LAST, EpollHelper, EpollHelperError, EpollHelperHandler,
|
||||
Error as DeviceError, GuestMemoryMmap, VIRTIO_F_IN_ORDER, VIRTIO_F_IOMMU_PLATFORM,
|
||||
Error as DeviceError, GuestMemoryMmap, VIRTIO_F_ACCESS_PLATFORM, VIRTIO_F_IN_ORDER,
|
||||
VIRTIO_F_VERSION_1, VirtioCommon, VirtioDevice, VirtioDeviceType, VirtioInterrupt,
|
||||
VirtioInterruptType,
|
||||
};
|
||||
@@ -349,7 +349,7 @@ where
|
||||
let mut avail_features = (1u64 << VIRTIO_F_VERSION_1) | (1u64 << VIRTIO_F_IN_ORDER);
|
||||
|
||||
if iommu {
|
||||
avail_features |= 1u64 << VIRTIO_F_IOMMU_PLATFORM;
|
||||
avail_features |= 1u64 << VIRTIO_F_ACCESS_PLATFORM;
|
||||
}
|
||||
(avail_features, 0, false)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user