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§
- Counter
Tool - counter1 ported to KVM: on every subscribed syscall, RPC-increment the global total, then tail-inject so the backend executor still performs the syscall.
- Guest
Memory - A contiguous, page-aligned guest-physical memory region.
- Hierarchical
Counter - Aggregated global state for
HierarchicalCounterTool, the KVM port ofreverie-examples/counter2.rs: a process-tree total plus process and thread tallies, contributed once per process at exit. - Hierarchical
Counter Tool - 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. - Hierarchical
Totals - The counts exposed by
HierarchicalCounter. - KvmBackend
- A single-vCPU KVM backend used to exercise the syscall transport.
- KvmBackend
Stats - 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.
- KvmStack
Guard - Guard returned after KVM guest stack writes are committed.
- Strace
Entry - One intercepted syscall recorded by
StraceTool. - Strace
Log - Global state for
StraceTool: the ordered list of intercepted syscalls, aggregated from every guest thread through Reverie’s global RPC. - Strace
Tool - 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 throughcrate::KvmBackend::run_with_toolproves the KVMGuest/Toolinterface works: interception, typed decoding, argument dereferencing, global RPC, and injection all flow through the same Reverie contracts the ptrace backend uses. - Syscall
Counter - 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 ofreverie-examples/counter1.rs. - Syscall
Request - A Linux syscall request transported from guest to host memory.
- Tool
RunCompletion - Result of a Tool run after owned workers and children have completed.
Enums§
- Error
- Errors produced by the KVM backend prototype.
- Host
Resource - A host resource of this process’s own that the host can refuse it.
- KvmExit
Reason - 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§
- Syscall
Executor - Executes a syscall on behalf of a KVM guest.
- Syscall
Info - A trait that all syscalls implement.
Type Aliases§
- Result
- Result type used by the KVM backend prototype.