mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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 <rbradford@meta.com>
This commit is contained in:
@@ -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<String>,
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -602,7 +602,7 @@ impl Console {
|
||||
id: String,
|
||||
endpoint: Endpoint,
|
||||
resize_pipe: Option<File>,
|
||||
iommu: bool,
|
||||
access_platform_enabled: bool,
|
||||
seccomp_action: SeccompAction,
|
||||
exit_evt: EventFd,
|
||||
state: Option<ConsoleState>,
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -468,7 +468,7 @@ impl Net {
|
||||
id: String,
|
||||
taps: Vec<Tap>,
|
||||
guest_mac: Option<MacAddr>,
|
||||
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<MacAddr>,
|
||||
host_mac: &mut Option<MacAddr>,
|
||||
mtu: Option<u16>,
|
||||
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<MacAddr>,
|
||||
mtu: Option<u16>,
|
||||
iommu: bool,
|
||||
access_platform_enabled: bool,
|
||||
queue_size: u16,
|
||||
seccomp_action: SeccompAction,
|
||||
rate_limiter_config: Option<RateLimiterConfig>,
|
||||
@@ -666,7 +666,7 @@ impl Net {
|
||||
id,
|
||||
taps,
|
||||
guest_mac,
|
||||
iommu,
|
||||
access_platform_enabled,
|
||||
num_queue_pairs * 2,
|
||||
queue_size,
|
||||
seccomp_action,
|
||||
|
||||
@@ -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<PmemState>,
|
||||
@@ -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)
|
||||
|
||||
@@ -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<RngState>,
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ pub struct Blk {
|
||||
guest_memory: Option<GuestMemoryAtomic<GuestMemoryMmap>>,
|
||||
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<State>,
|
||||
) -> Result<Blk> {
|
||||
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
|
||||
|
||||
@@ -68,7 +68,7 @@ pub struct Fs {
|
||||
seccomp_action: SeccompAction,
|
||||
guest_memory: Option<GuestMemoryAtomic<GuestMemoryMmap>>,
|
||||
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<State>,
|
||||
) -> Result<Fs> {
|
||||
// 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
|
||||
|
||||
@@ -42,7 +42,7 @@ pub struct GenericVhostUser {
|
||||
seccomp_action: SeccompAction,
|
||||
guest_memory: Option<GuestMemoryAtomic<GuestMemoryMmap>>,
|
||||
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<State>,
|
||||
) -> Result<GenericVhostUser> {
|
||||
// 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
|
||||
|
||||
@@ -48,7 +48,7 @@ pub struct Net {
|
||||
ctrl_queue_epoll_thread: Option<thread::JoinHandle<()>>,
|
||||
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<State>,
|
||||
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
|
||||
|
||||
@@ -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<VsockState>,
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user