Skip to main content

Module machine

Module machine 

Source
Expand description

s9vm : kernel bridge between a vCPU and the pure emulation layer.

crate::s9vm::emulate is written against two abstractions: PhysMemory (physical memory access) and GuestContext (general registers, instruction pointer, CR3, paging state). This module supplies the kernel implementations : the higher-half direct map for physical memory, the vCPUโ€™s entry frame and control block for the guest context : and exposes Machine, the per-world object that the exit loops call.

Keeping the bridge separate from the model means the model stays pure and host-testable, while the kernel-specific and unsafe parts stay in one small, auditable file.

Re-exportsยง

use super::apic::LocalApic; ๐Ÿ”’
use super::cpuid::CpuidPolicy; ๐Ÿ”’
use super::emulate; ๐Ÿ”’
use super::emulate::isa_gsi; ๐Ÿ”’
use super::emulate::pulse_device_line; ๐Ÿ”’
use super::emulate::Devices; ๐Ÿ”’
use super::emulate::EmuError; ๐Ÿ”’
use super::emulate::GuestContext; ๐Ÿ”’
use super::emulate::MemoryView; ๐Ÿ”’
use super::emulate::PhysMemory; ๐Ÿ”’
use super::exit::ExitClass; ๐Ÿ”’
use super::pit; ๐Ÿ”’
use super::vcpu::ExitInfo; ๐Ÿ”’
use super::backend::VcpuOps; ๐Ÿ”’

Structsยง

HhdmMemory
Physical memory access through the higher-half direct map.
Machine
Device model, CPU description and emulation state of one world.
VcpuGuest ๐Ÿ”’
Guest context backed by a vCPU.

Constantsยง

CPUID_INSTRUCTION_LEN ๐Ÿ”’
Length in bytes of the CPUID instruction (0F A2).

Functionsยง

host_unix_time ๐Ÿ”’
Host wall-clock time, when the host RTC driver can provide it.