pub struct Iotlb { /* private fields */ }iommu only.Expand description
Provides an IOTLB.
The IOTLB caches IOMMU mappings. It must be preemptively updated whenever mappings are
restricted or removed; in contrast, adding mappings or making them more permissive does not
require preemptive updates, as subsequent accesses that violate the previous (more restrictive)
permissions will trigger TLB misses or access failures, which is then supposed to result in an
update from the outer Iommu object that performs the translation.
Implementations§
Source§impl Iotlb
impl Iotlb
Sourcepub fn set_mapping(
&mut self,
iova: GuestAddress,
map_to: GuestAddress,
length: usize,
perm: Permissions,
) -> Result<(), Error>
pub fn set_mapping( &mut self, iova: GuestAddress, map_to: GuestAddress, length: usize, perm: Permissions, ) -> Result<(), Error>
Change the mapping of the given IOVA range.
Sourcepub fn invalidate_mapping(&mut self, iova: GuestAddress, length: usize)
pub fn invalidate_mapping(&mut self, iova: GuestAddress, length: usize)
Remove any mapping in the given IOVA range.
Sourcepub fn invalidate_all(&mut self)
pub fn invalidate_all(&mut self)
Remove all mappings.
Sourcepub fn lookup<D: Deref<Target = Iotlb>>(
this: D,
iova: GuestAddress,
length: usize,
access: Permissions,
) -> Result<IotlbIterator<D>, IotlbFails>
pub fn lookup<D: Deref<Target = Iotlb>>( this: D, iova: GuestAddress, length: usize, access: Permissions, ) -> Result<IotlbIterator<D>, IotlbFails>
Perform a lookup for the given range and the given access mode.
If the whole range is mapped and accessible, return an iterator over all mappings.
If any part of the range is not mapped or does not permit the given access mode, return an
Err(_) that contains a list of all such subranges.