vm_loader

Struct Loader

Source
pub struct Loader<'a, R> { /* private fields */ }

Implementations§

Source§

impl<R> Loader<'_, R>

Source

pub fn new( gm: GuestMemory, mem_layout: &MemoryLayout, max_vtl: Vtl, ) -> Loader<'_, R>

Source

pub fn initial_regs(self) -> Vec<R>

Source

pub fn initial_regs_and_accepted_ranges( self, ) -> (Vec<R>, Vec<(MemoryRange, PageVisibility)>)

Source

pub fn accept_new_range( &mut self, page_base: u64, page_count: u64, tag: &str, acceptance: BootPageAcceptance, ) -> Result<()>

Accept a new page range with a given acceptance into the map of accepted ranges.

Trait Implementations§

Source§

impl<'a, R: Debug> Debug for Loader<'a, R>

Source§

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

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

impl<R: Debug + GuestArch> ImageLoad<R> for Loader<'_, R>

Source§

fn isolation_config(&self) -> IsolationConfig

Get the isolation configuration for this loader. This can be used by loaders to load different state depending on the platform.
Source§

fn import_pages( &mut self, page_base: u64, page_count: u64, debug_tag: &str, acceptance: BootPageAcceptance, data: &[u8], ) -> Result<()>

Import data into the guest address space with the given acceptance type. data.len() must be smaller than or equal to the number of pages being imported. Read more
Source§

fn import_vp_register(&mut self, register: R) -> Result<()>

Import a register into the BSP.
Source§

fn verify_startup_memory_available( &mut self, page_base: u64, page_count: u64, memory_type: StartupMemoryType, ) -> Result<()>

Verify with the loader that memory is available in guest address space with the given type.
Source§

fn set_vp_context_page(&mut self, _page_base: u64) -> Result<()>

Notify the loader to deposit architecture specific VP context information at the given page. Read more
Source§

fn create_parameter_area( &mut self, _page_base: u64, _page_count: u32, _debug_tag: &str, ) -> Result<ParameterAreaIndex>

Create a parameter area for the given page_base and page_count, which can be used to import parameters. Read more
Source§

fn create_parameter_area_with_data( &mut self, _page_base: u64, _page_count: u32, _debug_tag: &str, _initial_data: &[u8], ) -> Result<ParameterAreaIndex>

Create a parameter area for the given page_base, page_count, and initial_data which can be used to import parameters. Read more
Source§

fn import_parameter( &mut self, _parameter_area: ParameterAreaIndex, _byte_offset: u32, _parameter_type: IgvmParameterType, ) -> Result<()>

Import an IGVM parameter into the given parameter area index at the given offset. Read more
Source§

fn relocation_region( &mut self, _gpa: u64, _size_bytes: u64, _relocation_alignment: u64, _minimum_relocation_gpa: u64, _maximum_relocation_gpa: u64, _apply_rip_offset: bool, _apply_gdtr_offset: bool, _vp_index: u16, ) -> Result<()>

Specify this region as relocatable.
Source§

fn page_table_relocation( &mut self, _page_table_gpa: u64, _size_pages: u64, _used_pages: u64, _vp_index: u16, ) -> Result<()>

Specify a region as relocatable page table memory.
Source§

fn set_imported_regions_config_page(&mut self, _page_base: u64)

Lets the loader know what the base page of where the config page containing list of accepted regions should be. This list should contain the pages that will be accepted by the loader and therefore should not be accepted again by either the boot shim or the vtl 2 firmware. The list will be sorted in ascending order (on the base page) and be an array of non-overlapping [loader_defs::paravisor::ImportedRegionDescriptor]. A [loader_defs::paravisor::ImportedRegionDescriptor] with a page count of 0 indicates the end of the list.

Auto Trait Implementations§

§

impl<'a, R> Freeze for Loader<'a, R>

§

impl<'a, R> !RefUnwindSafe for Loader<'a, R>

§

impl<'a, R> Send for Loader<'a, R>
where R: Send,

§

impl<'a, R> Sync for Loader<'a, R>
where R: Sync,

§

impl<'a, R> Unpin for Loader<'a, R>
where R: Unpin,

§

impl<'a, R> !UnwindSafe for Loader<'a, R>

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more