pub struct IgvmLoader<R: VbsRegister + GuestArch> {Show 16 fields
accepted_ranges: RangeMap<u64, RangeInfo>,
relocatable_regions: RangeMap<u64, RelocationType>,
required_memory: Vec<RequiredMemory>,
page_table_region: Option<PageTableRegion>,
platform_header: IgvmPlatformHeader,
initialization_headers: Vec<IgvmInitializationHeader>,
directives: Vec<IgvmDirectiveHeader>,
page_data_directives: Vec<IgvmDirectiveHeader>,
vp_context: Option<Box<dyn VpContextBuilder<Register = R>>>,
max_vtl: Vtl,
parameter_areas: BTreeMap<(u64, u32), u32>,
isolation_type: LoaderIsolationType,
paravisor_present: bool,
imported_regions_config_page: Option<u64>,
expected_page_hashes_config_page: Option<u64>,
snp_linux_direct: Option<SnpLinuxDirectConfig>,
}Fields§
§accepted_ranges: RangeMap<u64, RangeInfo>§relocatable_regions: RangeMap<u64, RelocationType>§required_memory: Vec<RequiredMemory>§page_table_region: Option<PageTableRegion>§platform_header: IgvmPlatformHeader§initialization_headers: Vec<IgvmInitializationHeader>§directives: Vec<IgvmDirectiveHeader>§page_data_directives: Vec<IgvmDirectiveHeader>§vp_context: Option<Box<dyn VpContextBuilder<Register = R>>>§max_vtl: Vtl§parameter_areas: BTreeMap<(u64, u32), u32>§isolation_type: LoaderIsolationType§paravisor_present: bool§imported_regions_config_page: Option<u64>§expected_page_hashes_config_page: Option<u64>§snp_linux_direct: Option<SnpLinuxDirectConfig>Implementations§
Source§impl IgvmLoader<X86Register>
impl IgvmLoader<X86Register>
Sourcepub fn new_snp_linux_direct(config: SnpLinuxDirectConfig) -> Self
pub fn new_snp_linux_direct(config: SnpLinuxDirectConfig) -> Self
Create a loader for a self-contained SNP Linux-direct image.
Source§impl<R: IgvmLoaderRegister + GuestArch + 'static> IgvmLoader<R>
impl<R: IgvmLoaderRegister + GuestArch + 'static> IgvmLoader<R>
pub fn new(with_paravisor: bool, isolation_type: LoaderIsolationType) -> Self
Sourcefn finalize_snp_linux_direct(
&mut self,
config: SnpLinuxDirectConfig,
) -> Result<()>
fn finalize_snp_linux_direct( &mut self, config: SnpLinuxDirectConfig, ) -> Result<()>
Adds the fixed-memory contract required by a self-contained Linux-direct image.
The generic Linux loader imports only the pages that contain boot data
and does not call verify_startup_memory_available. UEFI and paravisor
loaders use that callback to emit their required-memory directives, but
a direct Linux IGVM must describe its complete startup RAM here. When
requested, this also imports every otherwise-unused RAM page as measured
zero data. The caller then places the BSP VMSA after those page updates.
Compute both the combined SHA-384 over all shared (unmeasured) pages
(matching the value stored in ImportedRegionsPageHeader::sha384_hash)
and a per-page array of SHA-384s (one entry per 4 KB shared page, in
ascending-GPA order) suitable for the expected-page-hashes region.
The per-page array is what the boot shim uses to identify which individual pages diverged from the measured baseline on a hash mismatch.
Sourcepub fn finalize(self) -> Result<IgvmOutput>
pub fn finalize(self) -> Result<IgvmOutput>
Finalize the loader state, returning an IGVM file.
Sourcefn accept_new_range(
&mut self,
page_base: u64,
page_count: u64,
tag: &str,
acceptance: BootPageAcceptance,
) -> Result<()>
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.
fn imported_regions(&self) -> Vec<ImportedRegionDescriptor>
Sourcepub fn arch(&self) -> GuestArchKind
pub fn arch(&self) -> GuestArchKind
The guest architecture used by this loader.
Sourcepub fn next_available_gpa(&self) -> Result<u64>
pub fn next_available_gpa(&self) -> Result<u64>
Returns the first GPA after all imported page-data directives.
Sourcepub fn unimported_ram_ranges(
&self,
additional_imported_pages: impl IntoIterator<Item = u64>,
) -> Result<Vec<Range<u64>>>
pub fn unimported_ram_ranges( &self, additional_imported_pages: impl IntoIterator<Item = u64>, ) -> Result<Vec<Range<u64>>>
Returns unimported RAM page ranges for an SNP Linux-direct image.