pub struct GuestMemoryManager { /* private fields */ }
Expand description
The HvLite memory manager.
Implementations§
Source§impl GuestMemoryManager
impl GuestMemoryManager
Sourcepub fn client(&self) -> GuestMemoryClient
pub fn client(&self) -> GuestMemoryClient
Returns an object to access guest memory.
Sourcepub fn device_memory_mapper(&self) -> DeviceMemoryMapper
pub fn device_memory_mapper(&self) -> DeviceMemoryMapper
Returns an object to map device memory into the VM.
Sourcepub fn ram_visibility_control(&self) -> RamVisibilityControl
pub fn ram_visibility_control(&self) -> RamVisibilityControl
Returns an object for manipulating the visibility state of different RAM regions.
Returns the shared memory resources that can be used to reconstruct the memory backing.
This can be used with GuestMemoryBuilder::existing_backing
to create a
new memory manager with the same memory state. Only one instance of this
type should be managing a given memory backing at a time, though, or the
guest may see unpredictable results.
Sourcepub async fn attach_partition(
&mut self,
vtl: Vtl,
partition: &Arc<dyn PartitionMemoryMap>,
process: Option<RemoteProcess>,
) -> Result<(), PartitionAttachError>
pub async fn attach_partition( &mut self, vtl: Vtl, partition: &Arc<dyn PartitionMemoryMap>, process: Option<RemoteProcess>, ) -> Result<(), PartitionAttachError>
Attaches the guest memory to a partition, mapping it to the guest physical address space.
If process
is provided, then allocate a VA range in that process for
the guest memory, and map the memory into the partition from that
process. This is necessary to work around WHP’s lack of support for
mapping multiple partitions from a single process.
TODO: currently, all VTLs will get the same mappings–no support for per-VTL memory protections is supported.