Skip to main content

ProtoPartition

Trait ProtoPartition 

Source
pub trait ProtoPartition {
    type Partition: Partition;
    type ProcessorBinder: 'static + BindProcessor + Send;
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn max_physical_address_size(&self) -> u8;
    fn build(
        self,
        config: PartitionConfig<'_>,
    ) -> Result<(Self::Partition, Vec<Self::ProcessorBinder>), Self::Error>;

    // Provided method
    fn supports_memory_fault_resolution(&self) -> bool { ... }
}
Expand description

Trait for a prototype partition, one that is partially created but still needs final configuration.

This is separate from the partition so that it can be queried to determine the final partition configuration.

Required Associated Types§

Source

type Partition: Partition

The partition type.

Source

type ProcessorBinder: 'static + BindProcessor + Send

The VP binder type.

Source

type Error: Error + Send + Sync + 'static

The error type when creating the partition.

Required Methods§

Source

fn max_physical_address_size(&self) -> u8

The maximum physical address width that processors and devices for this partition can access.

This may be smaller than what is reported to the guest via architectural interfaces by default, and it may be larger or smaller than what the VMM ultimately chooses to report to the guest.

Source

fn build( self, config: PartitionConfig<'_>, ) -> Result<(Self::Partition, Vec<Self::ProcessorBinder>), Self::Error>

Constructs the full partition.

Provided Methods§

Source

fn supports_memory_fault_resolution(&self) -> bool

Whether the partition delivers guest-memory-access faults back to the VMM and resolves them through a ResolveMemoryFault supplied in PartitionConfig::fault_resolver.

Defaults to false. A backend that forwards memory faults to the VMM (e.g. WHP) overrides this to true. The code assembling PartitionConfig uses it to decide whether to supply a resolver, and the memory backing uses it to select a lazy commit strategy.

Implementors§