Crate Reference: All 13 RVM Crates
April 5, 2026 ยท View on GitHub
This chapter provides a concise reference for every crate in the RVM workspace. Each section describes what the crate does, lists its key public types, notes its feature flags and internal dependencies, and points to the chapter with deeper coverage.
For the big picture of how these crates fit together, see Architecture. For a quick setup guide, see Quickstart.
1. rvm-types
Foundation types for the entire hypervisor.
rvm-types defines every shared type used across the workspace. It has no
dependencies on other RVM crates and only one external dependency (bitflags),
making it the stable foundation that all other crates build on. If you are
reading RVM source code for the first time, start here.
Key public types:
PartitionId-- 16-bit identifier for a partitionVcpuId-- virtual CPU identifierCapRights,CapToken,CapType,Capability,CapabilityId-- capability model primitivesWitnessHash,WitnessRecord,ActionKind-- witness trail typesCoherenceScore,CommEdge,CutPressure,PhiValue-- coherence monitoring typesPartitionConfig,PartitionState-- partition lifecycle typesMemoryRegion,MemoryTier-- memory model typesDeviceLease-- device assignment typeProofResult,ProofTier,ProofToken-- proof engine typesPriority,SchedulerMode-- scheduling typesFailureClass,RecoveryCheckpoint-- fault recovery typesRvmConfig-- top-level configurationRvmError,RvmResult-- error handling
Feature flags: std, alloc (both off by default)
Workspace dependencies: None (only bitflags)
See also: Core Concepts for how these types model the hypervisor's domain, Glossary for definitions.
2. rvm-hal
Hardware abstraction layer.
rvm-hal defines the trait boundaries between RVM and the underlying hardware
platform. It does not contain any hardware-specific code itself; instead, it
specifies what a platform implementation must provide. A bare-metal deployment
supplies a concrete implementation of these traits; the test suite uses stubs.
Key public traits:
Platform-- top-level platform trait:cpu_count(),total_memory(),halt()MmuOps-- memory management unit:map_page(),unmap_page(),translate(),flush_tlb()TimerOps-- timer access:now_ns(),set_deadline_ns(),cancel_deadline()InterruptOps-- interrupt controller:enable(),disable(),acknowledge(),end_of_interrupt()
Modules:
aarch64-- type stubs for AArch64 bare-metal targets
Feature flags: std, alloc (both off by default)
Workspace dependencies: rvm-types
See also: Bare-Metal Deployment for writing a HAL
implementation, Architecture for where rvm-hal sits in
the dependency tree.
3. rvm-cap
Capability-based access control.
rvm-cap manages the capability tables that control which partitions can
access which resources. Capabilities form a derivation tree: a parent
capability can delegate a subset of its rights to a child, up to a configurable
maximum delegation depth. Revocation cascades from parent to all descendants.
Key public types and functions:
CapabilityManager-- top-level manager for creating, delegating, and revoking capabilitiesCapabilityTable-- per-partition table mappingCapabilityIdtoCapabilityDerivationTree-- tracks parent-child relationships for cascading revocationProofVerifier-- verifies proof tokens against capability stateGrantPolicy-- policy for whether a delegation request should be allowedrevoke_single()-- revoke a single capability and its descendants
Constants:
DEFAULT_MAX_DELEGATION_DEPTH= 8DEFAULT_CAP_TABLE_CAPACITY= 256
Feature flags: std, alloc (both off by default)
Workspace dependencies: rvm-types, spin
See also: Capabilities and Proofs for the full capability model, Security for hardening guidance.
4. rvm-witness
Tamper-evident witness logging.
rvm-witness maintains an append-only ring buffer of WitnessRecord entries.
Every security decision, partition lifecycle event, and state transition is
logged here. Records are cryptographically signed (when the crypto-sha256
feature is enabled) and can be chained to detect tampering.
Key public types and functions:
WitnessEmitter-- emits new witness records into the logWitnessLog-- the ring buffer holding all recordsWitnessRecord-- a single audit entry: partition, action, timestamp, signatureverify_chain()-- verify the cryptographic integrity of a range of recordsquery_by_partition()-- filter records by partition IDquery_by_action_kind()-- filter records by action typequery_by_time_range()-- filter records by timestamp range
Signers:
DefaultSigner-- HMAC-SHA256 signer (requirescrypto-sha256)StrictSigner-- enforces non-null signatures (default behavior withstrict-signing)HmacWitnessSigner-- explicit HMAC-based signer for witness records
Constants:
DEFAULT_RING_CAPACITY= 262,144 entries
Feature flags: std, alloc, crypto-sha256 (on by default),
strict-signing (on by default), null-signer (off -- testing only)
Workspace dependencies: rvm-types, spin, optionally sha2 and hmac
See also: Witness and Audit for querying and
verifying the witness trail, Security for why
null-signer should never be used in production.
5. rvm-proof
Proof-gated state transitions.
rvm-proof ensures that every state-mutating operation in the hypervisor is
backed by a verifiable proof. Proofs operate at three tiers of increasing
strength. The crate also provides software TEE (Trusted Execution Environment)
support for environments that lack hardware TEE.
Key public types and functions:
ProofTier-- the three proof tiers:Hash,Witness,ZkProof-- a proof object containing tier, data hash, and optional signatureverify()-- verify a standalone proofverify_with_cap()-- verify a proof in the context of a capabilitycompute_data_hash()-- compute the SHA-256 hash of a data buffer
TEE support:
SoftwareTeeProvider-- software-emulated TEE for development and testingSoftwareTeeVerifier-- verifies attestations from the software TEETeeWitnessSigner-- signs witness records using TEE-derived keys
Modules:
policy-- proof policy engine with a context builder for constructing policy decisions
Feature flags: std, alloc, crypto-sha256 (on by default),
ed25519 (off -- adds Ed25519 signature support via ed25519-dalek),
strict-signing (on by default), null-signer (off -- testing only)
Workspace dependencies: rvm-types, rvm-cap, rvm-witness, spin,
subtle, optionally sha2, hmac, ed25519-dalek
See also: Capabilities and Proofs for proof tiers and verification flow, Security for TEE attestation guidance.
6. rvm-partition
Partition lifecycle and communication.
rvm-partition defines the partition -- the fundamental isolation boundary in
RVM. A partition owns a set of memory regions, capabilities, virtual CPUs, and
device leases. This crate also manages inter-partition communication (IPC) via
message queues and scored region assignment for partition split and merge.
Key public types:
PartitionManager-- creates, destroys, and queries partitionsPartition-- the partition object itselfCapabilityTable-- per-partition capability storage (delegated fromrvm-cap)CommEdge-- a communication edge between two partitions in the coherence graphIpcManager-- manages IPC channels between partitionsMessageQueue-- bounded message queue for inter-partition messagesDeviceLeaseManager-- assigns and revokes device leases to partitions
Operations:
- Split:
scored_region_assignment()-- assigns memory regions to child partitions based on scoring - Merge:
merge_preconditions_met()-- checks whether two partitions can be safely merged
Constants:
MAX_PARTITIONS= 256
Feature flags: std, alloc (both off by default)
Workspace dependencies: rvm-types, rvm-cap, rvm-witness, spin
See also: Partitions and Scheduling for the full partition lifecycle, Memory Model for how partitions own memory regions.
7. rvm-sched
Coherence-aware scheduler.
rvm-sched assigns virtual CPUs to physical CPUs. It supports three
scheduling modes that adapt to the current system state. When the coherence
feature is enabled at the kernel level, the scheduler can receive coherence
feedback to prioritize partitions that contribute to overall system coherence.
Key public types and functions:
Scheduler-- the top-level scheduler interfacePerCpuScheduler-- per-physical-CPU run queue and dispatch logicSmpCoordinator-- coordinates scheduling decisions across multiple CPUsEpochTracker-- tracks scheduling epochs for fairness and starvation preventionSchedulerMode-- the three modes:Reflex(low-latency),Flow(throughput),Recovery(fault handling)compute_priority()-- compute the effective priority for a partition based on base priority, coherence score, and modepartition_switch()-- perform a context switch between partitions
Context switch types:
SwitchContext-- captures the state needed for a partition switchSwitchResult-- the outcome of a switch attempt
Feature flags: std, alloc (both off by default)
Workspace dependencies: rvm-types, rvm-partition, rvm-witness, spin
See also: Partitions and Scheduling for scheduling modes and priority computation, Performance for tuning scheduler parameters.
8. rvm-memory
Memory management and address spaces.
rvm-memory manages physical memory allocation and guest physical address
spaces. It provides a buddy allocator for page-level allocation, a region
manager for tracking which memory regions belong to which partitions, and a
tiered memory system that classifies memory by access frequency.
Key public types and functions:
BuddyAllocator-- power-of-two page allocatorTierManager-- classifies memory regions into four tiers:Hot,Warm,Dormant,ColdRegionManager-- tracks ownership and permissions of memory regionsReconstructionPipeline-- reconstructs memory state after a partition crash or migrationMemoryRegion-- describes a contiguous range of physical memoryMemoryPermissions-- read/write/execute permission flagsvalidate_region()-- checks that a memory region is well-formedregions_overlap()-- checks whether two guest regions overlapregions_overlap_host()-- checks whether a guest region overlaps a host-reserved range
Constants:
PAGE_SIZE= 4096 bytes
Feature flags: std, alloc (both off by default)
Workspace dependencies: rvm-types
See also: Memory Model for the full memory architecture, Bare-Metal Deployment for physical memory layout on real hardware.
9. rvm-coherence
Coherence monitoring and Phi computation.
rvm-coherence implements the coherence monitoring engine that distinguishes
RVM from traditional hypervisors. It models the partition communication
topology as a graph and computes coherence metrics inspired by Integrated
Information Theory (IIT). These metrics can feed back into the scheduler to
prioritize partitions that contribute to system-wide coherence.
Key public types and functions:
CoherenceGraph-- a graph of partitions connected by communication edgesEmaFilter-- exponential moving average filter for smoothing sensor readingsMinCutBridge-- computes the minimum cut of the coherence graph using a Stoer-Wagner heuristicCoherenceEngine-- computes coherence scores from the graph topologyAdaptiveCoherenceEngine-- extendsCoherenceEnginewith adaptive thresholds and hysteresisSensorReading-- a raw coherence measurement from a partition pairphi_to_coherence_bp()-- converts a raw Phi value to a coherence score in basis points
Feature flags: std, alloc, sched (enables scheduler integration via
rvm-sched), ruvector (enables bridge to external ruvector crates)
Workspace dependencies: rvm-types, rvm-partition, optionally rvm-sched
See also: Core Concepts for what coherence means in RVM, Advanced and Exotic Features for the Phi computation algorithm, Partitions and Scheduling for how coherence scores influence scheduling.
10. rvm-boot
Deterministic boot sequence.
rvm-boot orchestrates the seven-phase boot sequence that brings RVM from
reset to a running system. Each phase is gated: it must complete before the
next begins, and every transition is recorded in the witness trail. The crate
also supports measured boot, where a hash chain accumulates over all phase
measurements to produce a boot attestation.
Key public types and functions:
BootTracker-- tracks progress through the seven boot phasesBootPhase-- enum of the seven phases:HalInit,MemoryInit,CapabilityInit,WitnessInit,SchedulerInit,RootPartition,HandoffBootSequence-- the full boot sequence executor (ADR-137)BootContext-- context object passed between boot phasesMeasuredBootState-- hash-chain accumulator for boot attestationrun_boot_sequence()-- execute the complete boot sequenceBootStage,PhaseTiming-- boot stage metadata and timing information
HAL initialization:
HalInit-- trait that a platform must implement to initialize hardware during Phase 0StubHal-- stub implementation for testingUartConfig,MmuConfig,InterruptConfig-- configuration types for HAL initialization
Feature flags: std, alloc, crypto-sha256 (on by default, enables
measured boot hash chain)
Workspace dependencies: rvm-types, rvm-hal, rvm-partition,
rvm-witness, rvm-sched, rvm-memory, subtle, optionally sha2
See also: Architecture for the boot phase table, Bare-Metal Deployment for booting on real hardware, Security for measured boot verification.
11. rvm-wasm
WebAssembly guest runtime.
rvm-wasm provides an optional WebAssembly runtime for hosting lightweight
agents inside RVM partitions. It validates Wasm modules, manages agent
lifecycle (load, validate, run, terminate), supports live migration between
partitions, and enforces resource quotas to prevent a misbehaving agent from
starving other workloads.
Key public types and functions:
WasmModuleInfo-- metadata about a loaded Wasm moduleWasmModuleState-- lifecycle states:Loaded,Validated,Running,Terminatedvalidate_module()-- validates a Wasm binary for structural correctness and safetyWasmSectionId-- identifies sections within a Wasm module
Modules:
- Agent lifecycle management (load, start, stop, terminate)
- Migration support (snapshot state, transfer, resume)
- Quota enforcement (memory limits, instruction budgets)
Constants:
MAX_MODULE_SIZE= 1 MB
Feature flags: std, alloc (both off by default)
Workspace dependencies: rvm-types, rvm-partition, rvm-cap, rvm-witness
See also: WASM Agents for writing and deploying Wasm agents, Partitions and Scheduling for how Wasm agents interact with the partition model.
12. rvm-security
Unified security gate.
rvm-security is the single entry point for all security policy enforcement
in RVM. Every hypercall passes through its three-stage gate: capability check,
proof verification, and witness logging. The crate also provides input
validation, attestation chain management, and DMA/resource budget enforcement.
Key public types and functions:
SecurityGate,SignedSecurityGate-- the three-stage security gate (the signed variant uses cryptographic witness signatures)GateRequest,GateResponse-- request and response types for the gatePolicyDecision--AlloworDeny(RvmError)PolicyRequest-- lightweight policy evaluation requestSecurityError-- security-specific error typeP3WitnessChain-- witness chain for Phase 3 (witness logging stage) of the gate
Attestation:
AttestationChain-- chain of attestation reports for platform verificationAttestationReport-- a single attestation measurementverify_attestation()-- verify an attestation chain
Resource control:
DmaBudget-- limits on DMA transfers per partitionResourceQuota-- general resource quotas (memory, CPU time, I/O bandwidth)
Modules:
gate-- the unified security gate implementationvalidation-- input validation for security-critical parametersattestation-- attestation chain and report generationbudget-- DMA and resource budget enforcement
Feature flags: std, alloc, crypto-sha256 (on by default)
Workspace dependencies: rvm-types, rvm-witness, subtle, optionally sha2
See also: Architecture for the hypercall data flow through the gate, Security for security hardening guidance, Capabilities and Proofs for the capability and proof models that the gate enforces.
13. rvm-kernel
Top-level integration crate.
rvm-kernel wires all 12 subsystem crates together into a single API surface.
It re-exports every subsystem under a short module name (e.g.,
rvm_kernel::cap, rvm_kernel::witness), defines the VERSION constant, and
provides the signer bridge (ADR-142) that connects the 64-byte proof-crate
signer to the 8-byte witness-crate signer.
Key public items:
VERSION-- the current RVM version string (fromCargo.toml)CRATE_COUNT-- the number of subsystem crates (13)- Module re-exports:
boot,cap,coherence,hal,memory,partition,proof,sched,security,types,wasm,witness
Signer bridge (ADR-142):
signer_bridge::CryptoSignerAdapter<S>-- wraps a 64-byte proof-crateWitnessSignerand adapts it to the 8-byte witness-crateWitnessSignerinterface by computing a SHA-256 digest and truncating the signature
Feature flags: std, alloc, wasm, coherence, coherence-sched,
crypto-sha256 (on by default). All std and alloc flags propagate to
every subsystem crate.
Workspace dependencies: All 12 subsystem crates.
See also: Architecture for how rvm-kernel sits
atop the dependency tree, Quickstart for building and
running RVM, README for the project overview.
Dependency Summary
The table below shows which RVM crates each crate depends on. External
dependencies (bitflags, spin, sha2, hmac, subtle, ed25519-dalek,
lz4_flex) are not listed.
| Crate | Depends on |
|---|---|
| rvm-types | (none) |
| rvm-hal | rvm-types |
| rvm-cap | rvm-types |
| rvm-witness | rvm-types |
| rvm-proof | rvm-types, rvm-cap, rvm-witness |
| rvm-partition | rvm-types, rvm-cap, rvm-witness |
| rvm-sched | rvm-types, rvm-partition, rvm-witness |
| rvm-memory | rvm-types |
| rvm-coherence | rvm-types, rvm-partition, optionally rvm-sched |
| rvm-boot | rvm-types, rvm-hal, rvm-partition, rvm-witness, rvm-sched, rvm-memory |
| rvm-wasm | rvm-types, rvm-partition, rvm-cap, rvm-witness |
| rvm-security | rvm-types, rvm-witness |
| rvm-kernel | all 12 above |
Where to Go Next
- How the crates fit together: Architecture
- Capabilities and proof tiers: Capabilities and Proofs
- Witness trail in depth: Witness and Audit
- Partition lifecycle: Partitions and Scheduling
- Memory regions and allocation: Memory Model
- WebAssembly agents: WASM Agents
- Security hardening: Security
- Performance tuning: Performance
- Running on bare metal: Bare-Metal Deployment
- Exotic features and Phi: Advanced and Exotic Features
- Troubleshooting: Troubleshooting
- Term definitions: Glossary
- Full cross-reference: Cross-Reference