Iotlb

Struct Iotlb 

Source
pub struct Iotlb { /* private fields */ }
Available on crate feature 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

Source

pub fn new() -> Self

Create a new empty instance.

Source

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.

Source

pub fn invalidate_mapping(&mut self, iova: GuestAddress, length: usize)

Remove any mapping in the given IOVA range.

Source

pub fn invalidate_all(&mut self)

Remove all mappings.

Source

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.

Trait Implementations§

Source§

impl Debug for Iotlb

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Iotlb

Source§

fn default() -> Iotlb

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Iotlb

§

impl RefUnwindSafe for Iotlb

§

impl Send for Iotlb

§

impl Sync for Iotlb

§

impl Unpin for Iotlb

§

impl UnwindSafe for Iotlb

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.