Expand description
s9vm : handlers for the SYS_VMM_* syscalls (ABI block 560β589).
P0 scope: management of the world registry (CREATE, DESTROY,
INFO) and the execution surface driven by the injected exits. The
appended P1 calls LIST (584) and STATS (585) expose the world registry
and the cumulative engine counters without growing VmmInfo; LOAD_IMAGE
(586) and ACPI (587) prepare a guest, and the per-vCPU introspection pair
VCPU_LIST (588) / VCPU_REGS (589) publishes the vCPU snapshot and
register block.
The calls that depend on guest execution (MAP_MEM, SET_REGS, RUN,
INJECT_IRQ, EXIT_HANDLER, IRQ_WAIT) are implemented by the vCPU
layer; their ABI is frozen.
Access control: CREATE requires silo administration; the other calls
take a capability handle returned by CREATE
(ResourceType::Vmm) or CREATE_VCPU (ResourceType::Vcpu). The handle
is opaque to user space; internal identifiers are never accepted
directly.
Re-exportsΒ§
use super::error::SyscallError;πuse crate::capability::get_capability_manager;πuse crate::capability::CapId;πuse crate::capability::CapPermissions;πuse crate::capability::ResourceType;πuse crate::memory::UserSliceRead;πuse crate::memory::UserSliceWrite;πuse crate::process::current_task_clone;πuse crate::s9vm;πuse crate::s9vm::cpuid;πuse crate::s9vm::cpuid::CpuidPolicy;πuse crate::s9vm::iommu::IommuError;πuse crate::s9vm::memmap::MapError;πuse crate::s9vm::vm;πuse crate::s9vm::vm::VmError;πuse crate::silo;πuse alloc::vec;πuse alloc::vec;πuse strat9_abi::vmm::iommu_flags;πuse strat9_abi::vmm::state;πuse strat9_abi::vmm::vcpu_flags;πuse strat9_abi::vmm::VmmCpuidPolicy;πuse strat9_abi::vmm::VmmImageInfo;πuse strat9_abi::vmm::VmmInfo;πuse strat9_abi::vmm::VmmIommuMap;πuse strat9_abi::vmm::VmmRegs;πuse strat9_abi::vmm::VmmVcpuInfo;πuse strat9_abi::vmm::VmmWorldEntry;πuse strat9_abi::vmm::VmmWorldStats;πuse strat9_abi::vmm::VMM_ABI_VERSION;πuse strat9_abi::vmm::VMM_CMDLINE_MAX;πuse strat9_abi::vmm::VMM_DISK_MAX_BYTES;πuse strat9_abi::vmm::VMM_DISK_SECTOR_SIZE;πuse strat9_abi::vmm::VMM_IOMMU_MAX_MAP_BYTES;πuse strat9_abi::vmm::VMM_LIST_MAX;πuse strat9_abi::vmm::VMM_MODULE_MAX_BYTES;πuse strat9_abi::vmm::VMM_NAME_MAX;πuse strat9_abi::vmm::VMM_VCPU_LIST_MAX;π
ConstantsΒ§
- MAX_
CONSOLE_ πIO - Maximum bytes transferred by one console syscall.
- MAX_
IMAGE_ πBYTES - Maximum size of a guest image accepted by
SYS_VMM_LOAD_IMAGE. - MAX_
LIST_ πENTRIES - Maximum number of entries written by one
SYS_VMM_LISTcall. - MAX_
STRUCT π - Maximum size of a structure read from user space.
- MAX_
VCPU_ πLIST_ ENTRIES - Maximum number of entries written by one
SYS_VMM_VCPU_LISTcall. - RUN_
TIMEOUT_ πNS - Timeout applied to one
SYS_VMM_RUN(10 s). - VCPU_
OWNER π - Rights of a vCPU: read, write, execute (
RUN). - VMM_
OWNER π - Rights of a world creator: read, write, revoke.
FunctionsΒ§
- cpuid_
policy_ πfrom_ abi - Converts an ABI CPU description into the engine model.
- defaulted π
- A zero ABI field means βkeep the engine defaultβ.
- install_
handle π - Installs a capability in the current task and returns its handle.
- list_
scope π - Resolves the scope of a
SYS_VMM_LISTcall. - list_
worlds - Builds a vector of worlds for the shell command (diagnostic).
- map_
disk_ πerror - Maps a
vm::DiskErrorto the syscall ABI. - map_
iommu_ πerror - Maps an IOMMU model error to the syscall ABI.
- map_
run_ πerror - map_
vcpu_ πerror - map_
vm_ πerror - mark_
running - Marks a world as running (used by the selftest and the shell). Returns
falseif the world is unknown. - mark_
stopped - Marks a world as stopped.
- read_
struct π - require_
control π CREATEremains a silo administration operation: creating a world is not covered by an existing capability.- resolve_
handle π - Resolves a capability handle to an internal resource identifier.
- revoke_
handle π - Revokes a handle (removes the capability from the task and from the global registry).
- sys_
vmm_ acpi - SYS_VMM_ACPI (587): writes the firmware description tables of a world.
- sys_
vmm_ boot_ info - SYS_VMM_BOOT_INFO (583): writes the guest boot-information page.
- sys_
vmm_ boot_ params - SYS_VMM_BOOT_PARAMS (590): writes the guest boot-parameter block.
- sys_
vmm_ console_ input - SYS_VMM_CONSOLE_INPUT (581): queues bytes for the guest console.
- sys_
vmm_ console_ output - SYS_VMM_CONSOLE_OUTPUT (582): drains console output bytes.
- sys_
vmm_ create - SYS_VMM_CREATE (560): creates a virtual world.
- sys_
vmm_ create_ vcpu - SYS_VMM_CREATE_VCPU (570): creates a logical vCPU in a world.
- sys_
vmm_ debug_ dump - SYS_VMM_DEBUG_DUMP (579): logs an engine snapshot.
- sys_
vmm_ destroy - SYS_VMM_DESTROY (561): destroys a world.
- sys_
vmm_ destroy_ vcpu - SYS_VMM_DESTROY_VCPU (571): destroys a logical vCPU.
- sys_
vmm_ exit_ complete - SYS_VMM_EXIT_COMPLETE (580): completes an exit emulated by the policy.
- sys_
vmm_ exit_ handler - SYS_VMM_EXIT_HANDLER (567): pops an exit event.
- sys_
vmm_ get_ regs - SYS_VMM_GET_REGS (564): reads a vCPUβs register block.
- sys_
vmm_ info - SYS_VMM_INFO (569): snapshot of a world, or global summary if
vmm_id = 0. - sys_
vmm_ inject_ irq - SYS_VMM_INJECT_IRQ (566): schedules the injection of an external interrupt into a vCPU; it will be delivered on the next guest entry.
- sys_
vmm_ inject_ nmi - SYS_VMM_INJECT_NMI (578): schedules an NMI for the next
RUN. - sys_
vmm_ irq_ wait - SYS_VMM_IRQ_WAIT (568): waits for a vCPU exit event.
- sys_
vmm_ list - SYS_VMM_LIST (584): enumerates worlds into a caller buffer.
- sys_
vmm_ load_ disk - SYS_VMM_LOAD_DISK (593): replaces a worldβs block-device image.
- sys_
vmm_ load_ image - SYS_VMM_LOAD_IMAGE (586): loads an ELF64 guest image into a world.
- sys_
vmm_ load_ module - SYS_VMM_LOAD_MODULE (591): loads a module/initrd blob into a world.
- sys_
vmm_ map_ iommu - SYS_VMM_MAP_IOMMU (572): programs the device translation domain of a world.
- sys_
vmm_ map_ mem - SYS_VMM_MAP_MEM (562): maps guest RAM into a world.
- sys_
vmm_ pause - SYS_VMM_PAUSE (575): pauses a world.
- sys_
vmm_ resume - SYS_VMM_RESUME (576): resumes a paused world.
- sys_
vmm_ run - SYS_VMM_RUN (565): runs a vCPU until the next βpolicyβ exit and pushes the event onto the worldβs queue.
- sys_
vmm_ set_ cmdline - SYS_VMM_SET_CMDLINE (592): stores the guest kernel command line.
- sys_
vmm_ set_ cpuid_ policy - SYS_VMM_SET_CPUID_POLICY (573): replaces the guest CPU description of a world.
- sys_
vmm_ set_ regs - SYS_VMM_SET_REGS (563): writes a vCPUβs register block.
- sys_
vmm_ stats - SYS_VMM_STATS (585): writes the cumulative counters of a world.
- sys_
vmm_ vcpu_ list - SYS_VMM_VCPU_LIST (588): enumerates the vCPUs of a world into a caller buffer.
- sys_
vmm_ vcpu_ regs - SYS_VMM_VCPU_REGS (589): reads a vCPUβs live register block.
- vcpu_
target π - Resolves a vCPU handle (
ResourceType::Vcpu). - vmm_
world π - Resolves a world handle (
ResourceType::Vmm). - world_
info - Builds a
VmmInfofor a world (diagnostic, without user copy). - write_
struct π