Struct PartitionInfo

Source
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

Source

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

Source

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

Source

pub const fn new() -> Self

Create an empty PartitionInfo.

Source

pub fn vtl2_config_regions(&self) -> impl Iterator<Item = MemoryRange> + use<>

Returns the parameter regions that are not being reclaimed.

Trait Implementations§

Source§

impl Debug for PartitionInfo

Source§

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

Formats the value using the given formatter. Read more

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.

§

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> Same for T

Source§

type Output = T

Should always be Self
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