Skip to main content

Crate reverie_kvm

Crate reverie_kvm 

Source
Expand description

Minimal x86-64 KVM primitives for experimenting with a Reverie backend.

The crate supports the original real-mode transport probes and a bare long-mode process personality for fixed-address static ELF executables. The latter implements only a bounded, single-process subset of Linux semantics; see the crate README for its explicit limits.

The embedding process must reserve Linux real-time signal 64 exclusively for this backend. First vCPU entry installs a process-wide handler that is not restored when a backend is dropped. Existing or later signal ownership conflicts cause entry errors; these checks do not make concurrent use by another library safe. A thread that arms a preemption timer also reserves SIGSTKFLT, which the timer uses only to end KVM_RUN: the thread keeps it blocked outside KVM_RUN, so it interrupts no host call. SIGURG remains the separate worker-cancellation signal. See the crate README for the complete host signal requirements.

Modules§

native_exit_broker
Private source candidate for native terminal socket-reference retirement.

Structs§

CounterTool
counter1 ported to KVM: on every subscribed syscall, RPC-increment the global total, then tail-inject so the backend executor still performs the syscall.
GuestMemory
A contiguous, page-aligned guest-physical memory region.
HierarchicalCounter
Aggregated global state for HierarchicalCounterTool, the KVM port of reverie-examples/counter2.rs: a process-tree total plus process and thread tallies, contributed once per process at exit.
HierarchicalCounterTool
counter2 ported to KVM: each thread tallies its own syscalls in per-thread ThreadState; on thread exit that tally rolls up to the process; on process exit the process total is RPC’d once to the global aggregator.
HierarchicalTotals
The counts exposed by HierarchicalCounter.
KvmBackend
A single-vCPU KVM backend used to exercise the syscall transport.
KvmBackendStats
A stable snapshot of all KVM vCPU exits in one completed guest process tree.
KvmStack
A stack allocator backed by a low page reserved for Tool injection buffers.
KvmStackGuard
Guard returned after KVM guest stack writes are committed.
StraceEntry
One intercepted syscall recorded by StraceTool.
StraceLog
Global state for StraceTool: the ordered list of intercepted syscalls, aggregated from every guest thread through Reverie’s global RPC.
StraceTool
An strace-like Reverie tool: on every subscribed syscall it renders the syscall with its decoded arguments (dereferenced from guest memory), prints it to stderr, records it in StraceLog, and injects the syscall so the backend executor still performs it. Running this through crate::KvmBackend::run_with_tool proves the KVM Guest/Tool interface works: interception, typed decoding, argument dereferencing, global RPC, and injection all flow through the same Reverie contracts the ptrace backend uses.
SyscallCounter
Global state for CounterTool: one running total of intercepted syscalls, aggregated from every guest thread through Reverie’s global RPC. This is the KVM port of reverie-examples/counter1.rs.
SyscallRequest
A Linux syscall request transported from guest to host memory.
ToolRunCompletion
Result of a Tool run after owned workers and children have completed.

Enums§

Error
Errors produced by the KVM backend prototype.
HostResource
A host resource of this process’s own that the host can refuse it.
KvmExitReason
A stable, coarse category for a KVM VcpuExit.
Syscall
Full list of type-safe syscalls.
Sysno
Complete list of Linux syscalls.

Constants§

VMCALL_SYSCALL_TRANSPORT
KVM currently permits userspace exits for this standardized hypercall. The prototype uses it as a transport opcode and places the syscall frame address in the first hypercall argument.

Traits§

SyscallExecutor
Executes a syscall on behalf of a KVM guest.
SyscallInfo
A trait that all syscalls implement.

Type Aliases§

Result
Result type used by the KVM backend prototype.