pub struct Invlpgb { /* private fields */ }
Available on crate feature instructions only.
Expand description

Used to broadcast flushes to all logical processors.

use x86_64::VirtAddr;
use x86_64::structures::paging::Page;
use x86_64::instructions::tlb::Invlpgb;

// Check that `invlpgb` and `tlbsync` are supported.
let invlpgb = Invlpgb::new().unwrap();

// Broadcast flushing some pages to all logical processors.
let start: Page = Page::from_start_address(VirtAddr::new(0xf000_0000)).unwrap();
let pages = Page::range(start, start + 3);
invlpgb.build().pages(pages).include_global().flush();

// Wait for all logical processors to respond.
invlpgb.tlbsync();

Implementations§

source§

impl Invlpgb

source

pub fn new() -> Option<Self>

Check that invlpgb and tlbsync are supported and query limits.

§Panics

Panics if the CPL is not 0.

source

pub fn invlpgb_count_max(&self) -> u16

Returns the maximum count of pages to be flushed supported by the processor.

source

pub fn tlb_flush_nested(&self) -> bool

Returns whether the processor supports flushing translations used for guest translation.

source

pub fn nasid(&self) -> u32

Returns the number of available address space identifiers.

source

pub fn build(&self) -> InvlpgbFlushBuilder<'_>

Create a InvlpgbFlushBuilder.

source

pub fn tlbsync(&self)

Wait for all previous invlpgb instruction executed on the current logical processor to be acknowledged by all other logical processors.

Trait Implementations§

source§

impl Clone for Invlpgb

source§

fn clone(&self) -> Invlpgb

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Invlpgb

source§

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

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

impl Copy for Invlpgb

Auto Trait Implementations§

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>,

§

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>,

§

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.