[−][src]Module vm_memory::guest_memory
Traits to track and access the physical memory of the guest.
To make the abstraction as generic as possible, all the core traits declared here only define methods to access guest's memory, and never define methods to manage (create, delete, insert, remove etc) guest's memory. This way, the guest memory consumers (virtio device drivers, vhost drivers and boot loaders etc) may be decoupled from the guest memory provider (typically a hypervisor).
Traits and Structs
GuestAddress
: represents a guest physical address (GPA).MemoryRegionAddress
: represents an offset inside a region.GuestMemoryRegion
: represent a continuous region of guest's physical memory.GuestMemory
: represent a collection ofGuestMemoryRegion
objects. The main responsibilities of theGuestMemory
trait are:- hide the detail of accessing guest's physical address.
- map a request address to a
GuestMemoryRegion
object and relay the request to it. - handle cases where an access request spanning two or more
GuestMemoryRegion
objects.
Whenever a collection of GuestMemoryRegion
objects is mutable,
GuestAddressSpace
should be implemented
for clients to obtain a GuestMemory
reference or smart pointer.
Structs
FileOffset | Represents the start point within a |
GuestAddress | Represents a guest physical address (GPA). |
MemoryRegionAddress | Represents an offset inside a region. |
Enums
Error | Errors associated with handling guest memory accesses. |
Traits
GuestAddressSpace |
|
GuestMemory |
|
GuestMemoryRegion | Represents a continuous region of guest physical memory. |
Type Definitions
GuestUsize | Type of the raw value stored in a |
Result | Result of guest memory operations. |