Skip to main content

Module vm

Module vm 

Source
Expand description

Guest execution and physical memory management.

OSTD provides safe interfaces for running virtual machines. A kernel supplies guest memory and CPU state, handles VM exits, and implements device emulation and scheduling policy.

§Guest memory

A GuestPhysMemSpace maps guest physical addresses (Gpaddrs) to host memory backed by untyped frames (UFrames). A kernel can load guest code and data into these frames. It can query the guest memory mappings through gpm_space::Cursor and modify them through gpm_space::CursorMut.

§Guest execution

A GuestContext holds a virtual CPU’s (vCPU’s) register state. GuestMode::execute starts or resumes guest execution in a GuestPhysMemSpace from the register state in the supplied context.

On success, execution returns a GuestReturnReason:

The kernel handles the return reason, updates the guest context as needed, and calls GuestMode::execute again to resume the guest.

Re-exports§

pub use self::gpm_space::GuestPhysMemSpace;

Modules§

gpm_space
Guest physical memory space.

Structs§

DummyGuestHooks
A set of no-op guest mode hooks.
GuestMode
An execution mode for isolated guests.

Enums§

GuestReturnReason
The reason guest execution returned to the kernel client.

Traits§

GuestModeHooks
Hooks called around each guest-entry attempt.

Type Aliases§

Gpaddr
A guest physical address.