pub struct AddressSpaceManagerBuilder<'a, I: Iterator<Item = MemoryRange>> {
manager: &'a mut AddressSpaceManager,
vtl2_ram: &'a [MemoryEntry],
bootshim_used: MemoryRange,
persisted_state_region: MemoryRange,
vtl2_config: I,
reserved_range: Option<MemoryRange>,
sidecar_image: Option<MemoryRange>,
page_tables: Option<MemoryRange>,
log_buffer: Option<MemoryRange>,
pool_range: Option<MemoryRange>,
}Expand description
A builder used to initialize an AddressSpaceManager.
Fields§
§manager: &'a mut AddressSpaceManager§vtl2_ram: &'a [MemoryEntry]§bootshim_used: MemoryRange§persisted_state_region: MemoryRange§vtl2_config: I§reserved_range: Option<MemoryRange>§sidecar_image: Option<MemoryRange>§page_tables: Option<MemoryRange>§log_buffer: Option<MemoryRange>§pool_range: Option<MemoryRange>Implementations§
Source§impl<'a, I: Iterator<Item = MemoryRange>> AddressSpaceManagerBuilder<'a, I>
impl<'a, I: Iterator<Item = MemoryRange>> AddressSpaceManagerBuilder<'a, I>
Sourcepub fn new(
manager: &'a mut AddressSpaceManager,
vtl2_ram: &'a [MemoryEntry],
bootshim_used: MemoryRange,
persisted_state_region: MemoryRange,
vtl2_config: I,
) -> AddressSpaceManagerBuilder<'a, I>
pub fn new( manager: &'a mut AddressSpaceManager, vtl2_ram: &'a [MemoryEntry], bootshim_used: MemoryRange, persisted_state_region: MemoryRange, vtl2_config: I, ) -> AddressSpaceManagerBuilder<'a, I>
Create a new builder to initialize an AddressSpaceManager.
vtl2_ram is the list of ram ranges for VTL2, which must be sorted.
bootshim_used is the range used by the bootshim, but may be reclaimed
as ram by the kernel.
persisted_state_region is the range used to store the persisted state
header described by [loader_defs::shim::PersistedStateHeader] and
corresponding protbuf payload.
Other ranges described by other methods must lie within bootshim_used.
Sourcepub fn with_reserved_range(self, reserved_range: MemoryRange) -> Self
pub fn with_reserved_range(self, reserved_range: MemoryRange) -> Self
A reserved range reported as type [MemoryVtlType::VTL2_RESERVED].
Sourcepub fn with_sidecar_image(self, sidecar_image: MemoryRange) -> Self
pub fn with_sidecar_image(self, sidecar_image: MemoryRange) -> Self
The sidecar image, reported as type [MemoryVtlType::VTL2_SIDECAR_IMAGE].
Sourcepub fn with_page_tables(self, page_tables: MemoryRange) -> Self
pub fn with_page_tables(self, page_tables: MemoryRange) -> Self
Pagetables that are reported as type [MemoryVtlType::VTL2_TDX_PAGE_TABLES].
Sourcepub fn with_log_buffer(self, log_buffer: MemoryRange) -> Self
pub fn with_log_buffer(self, log_buffer: MemoryRange) -> Self
Log buffer that is reported as type [MemoryVtlType::VTL2_BOOTSHIM_LOG_BUFFER].
Sourcepub fn with_pool_range(self, pool_range: MemoryRange) -> Self
pub fn with_pool_range(self, pool_range: MemoryRange) -> Self
Existing VTL2 GPA pool ranges, reported as type [MemoryVtlType::VTL2_GPA_POOL].
Sourcepub fn init(self) -> Result<&'a mut AddressSpaceManager, Error>
pub fn init(self) -> Result<&'a mut AddressSpaceManager, Error>
Consume the builder and initialize the address space manager.