mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-queue: Remove queue addresses translation
Now that the virtio-devices crate can take care of the queue addresses when placed behind a vIOMMU, we can remove the corresponding code. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
committed by
Rob Bradford
parent
ce6446501d
commit
f29f3085ed
@@ -271,12 +271,6 @@ impl<M: GuestAddressSpace> Queue<M, QueueState> {
|
|||||||
pub fn iter(&mut self) -> Result<AvailIter<'_, M::T>, Error> {
|
pub fn iter(&mut self) -> Result<AvailIter<'_, M::T>, Error> {
|
||||||
self.state.iter(self.mem.memory())
|
self.state.iter(self.mem.memory())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set the queue to "ready", and update desc_table, avail_ring and
|
|
||||||
/// used_ring addresses based on the AccessPlatform handler.
|
|
||||||
pub fn enable(&mut self, set: bool) {
|
|
||||||
self.state.enable(set)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
@@ -156,28 +156,6 @@ impl QueueState {
|
|||||||
.map(Wrapping)
|
.map(Wrapping)
|
||||||
.map_err(Error::GuestMemory)
|
.map_err(Error::GuestMemory)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set the queue to "ready", and update desc_table, avail_ring and
|
|
||||||
/// used_ring addresses based on the AccessPlatform handler.
|
|
||||||
pub fn enable(&mut self, set: bool) {
|
|
||||||
self.ready = set;
|
|
||||||
|
|
||||||
if set {
|
|
||||||
// Translate address of descriptor table and vrings.
|
|
||||||
if let Some(access_platform) = &self.access_platform {
|
|
||||||
self.desc_table =
|
|
||||||
GuestAddress(access_platform.translate(self.desc_table.0, 0).unwrap());
|
|
||||||
self.avail_ring =
|
|
||||||
GuestAddress(access_platform.translate(self.avail_ring.0, 0).unwrap());
|
|
||||||
self.used_ring =
|
|
||||||
GuestAddress(access_platform.translate(self.used_ring.0, 0).unwrap());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
self.desc_table = GuestAddress(0);
|
|
||||||
self.avail_ring = GuestAddress(0);
|
|
||||||
self.used_ring = GuestAddress(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> QueueStateGuard<'a> for QueueState {
|
impl<'a> QueueStateGuard<'a> for QueueState {
|
||||||
|
|||||||
Reference in New Issue
Block a user