pub struct PartitionInfo {Show 19 fields
pub vtl2_ram: ArrayVec<MemoryEntry, MAX_VTL2_RAM_RANGES>,
pub vtl2_full_config_region: MemoryRange,
pub vtl2_config_region_reclaim: MemoryRange,
pub vtl2_reserved_region: MemoryRange,
pub vtl2_pool_memory: MemoryRange,
pub vtl2_used_ranges: ArrayVec<MemoryRange, MAX_VTL2_USED_RANGES>,
pub partition_ram: ArrayVec<MemoryEntry, MAX_PARTITION_RAM_RANGES>,
pub isolation: IsolationType,
pub bsp_reg: u32,
pub cpus: ArrayVec<CpuEntry, MAX_CPU_COUNT>,
pub vmbus_vtl2: VmbusInfo,
pub vmbus_vtl0: VmbusInfo,
pub cmdline: ArrayString<COMMAND_LINE_SIZE>,
pub com3_serial_available: bool,
pub gic: Option<GicInfo>,
pub memory_allocation_mode: MemoryAllocationMode,
pub entropy: Option<ArrayVec<u8, MAX_ENTROPY_SIZE>>,
pub vtl0_alias_map: Option<u64>,
pub nvme_keepalive: bool,
}
Expand description
Information about the guest partition.
Fields§
§vtl2_ram: ArrayVec<MemoryEntry, MAX_VTL2_RAM_RANGES>
Ram assigned to VTL2. This is either parsed from the host via IGVM parameters, or the fixed at build value.
This vec is guaranteed to be sorted, and non-overlapping.
vtl2_full_config_region: MemoryRange
The parameter region.
vtl2_config_region_reclaim: MemoryRange
Additional ram that can be reclaimed from the parameter region. Today, this is the whole device tree provided by the host.
vtl2_reserved_region: MemoryRange
The vtl2 reserved region, that is reserved to both the kernel and usermode.
vtl2_pool_memory: MemoryRange
Memory used for the VTL2 private pool.
vtl2_used_ranges: ArrayVec<MemoryRange, MAX_VTL2_USED_RANGES>
Memory ranges that are in use by the bootshim, and any other persisted ranges, such as the VTL2 private pool.
TODO: Refactor these different ranges and consolidate address space management.
partition_ram: ArrayVec<MemoryEntry, MAX_PARTITION_RAM_RANGES>
The full memory map provided by the host.
isolation: IsolationType
The partiton’s isolation type.
bsp_reg: u32
The reg field in device tree for the BSP. This is either the apic_id on x64, or mpidr on aarch64.
cpus: ArrayVec<CpuEntry, MAX_CPU_COUNT>
Cpu info for enabled cpus.
vmbus_vtl2: VmbusInfo
VMBUS info for VTL2.
vmbus_vtl0: VmbusInfo
VMBUS info for VTL0.
cmdline: ArrayString<COMMAND_LINE_SIZE>
Command line to be used for the underhill kernel.
com3_serial_available: bool
Com3 serial device is available
gic: Option<GicInfo>
GIC information
memory_allocation_mode: MemoryAllocationMode
Memory allocation mode that was performed.
entropy: Option<ArrayVec<u8, MAX_ENTROPY_SIZE>>
Entropy from the host to be used by the OpenHCL kernel
vtl0_alias_map: Option<u64>
The VTL0 alias map physical address.
nvme_keepalive: bool
Host is compatible with DMA preservation / NVMe keep-alive.
Implementations§
Source§impl PartitionInfo
impl PartitionInfo
pub fn read_from_dt<'a>( params: &'a ShimParams, storage: &'a mut Self, can_trust_host: bool, ) -> Result<Option<&'a mut Self>, DtError>
Source§impl PartitionInfo
impl PartitionInfo
Sourcepub fn select_vtl2_mmio_range(
&self,
vtl2_size: u64,
) -> Result<MemoryRange, DtError>
pub fn select_vtl2_mmio_range( &self, vtl2_size: u64, ) -> Result<MemoryRange, DtError>
Select the mmio range that VTL2 should use from looking at VTL0 mmio ranges.
VTL2 MMIO is partitioned such that:
- All MMIO low range is assigned to VTL0.
- VTL2_MMIO_HIGH_RANGE_SIZE bytes from the end of the high range is assigned to VTL2.
- The remaining high range is assigned to VTL0.
Assumes input ranges are non-overlapping and in increasing address order.
On success, returns the mmio that VTL2 should use.
Returns an error if the input VTL0 MMIO range is invalid or if the VTL2 allocation amount was not satisfied due to a lack of high MMIO assigned to VTL0.
Source§impl PartitionInfo
impl PartitionInfo
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Create an empty PartitionInfo
.
Sourcepub fn vtl2_config_regions(&self) -> impl Iterator<Item = MemoryRange> + use<>
pub fn vtl2_config_regions(&self) -> impl Iterator<Item = MemoryRange> + use<>
Returns the parameter regions that are not being reclaimed.