Expand description
Wire format for the host ↔ guest “run this PVM program” RPC.
The host pre-publishes each Cap it wants the guest to see via
the FN_ID_NUB_PUT_CAP RPC (rkyv-archived WireCap payload;
see the state_cache module in nub-arch-x86 for the guest-side
heap-resident directory it lands in), then ships a fixed-size
InvokePacket referencing the published Cap::Instance by
hash on every call. The invoke packet is #[repr(C)] bytes (no
codec); the response is rkyv-archived (InvocationResult).
Structs§
- Archived
Invocation Result - An archived
InvocationResult - Boot
Info - Boot-time info published by the guest at a known location (linker
section
.boot_info). The host reads it after the sandbox boots to learn the VA of the guest’s cap directory, then dereferences the directory directly from host code (the kernel half is mapped at the same VA via the shallow-PML4-copy mechanism, so a directory-VA pointer is valid both in guest kernel mode and via the host’s mmap shadow of the kernel image). - Invocation
Result - Invocation result. Both backends produce this shape on completion; rkyv-archived on the wire from the cached path’s response.
- Invocation
Result Resolver - The resolver for an archived
InvocationResult - Invoke
Packet - Fixed-layout invocation packet. Sent as raw
#[repr(C)]bytes via the existing rkyvRequestenvelope (itspayloadfield). The guest reads the bytes directly withcore::ptr::read_unaligned.
Constants§
- FN_
ID_ NUB_ GET_ BOOT_ INFO fn_idfor the boot-info-read diagnostic RPC. Empty payload; the guest replies with the raw bytes of itsBootInfostruct. The host can also obtain the same data by reading the kernel’s.boot_infoELF section directly — this RPC exists as a belt-and-braces fallback in case the ELF symbol lookup misses.- FN_
ID_ NUB_ HEAP_ STATS fn_idfor thenub_heap_statsdiagnostic. Payload is empty; response is 32 bytes packing four LE u64s (allocated_bytes, allocation_count, fragment_count, available_bytes).- FN_
ID_ NUB_ INVOKE_ CACHED fn_idfor the cache-based RPC. Payload is aInvokePacket(host-side#[repr(C)]bytes, no rkyv); the guest dereferences cache VAs byinstance_hashlookup, runs the JIT, and replies with rkyv-archivedInvocationResult.- FN_
ID_ NUB_ PUT_ CAP fn_idfor the heap-resident cap directoryput_capRPC.- FN_
ID_ NUB_ SMOKE fn_idfor thenub_smokeskeleton RPC (returns42u64).- GUEST_
FN_ TABLE_ SIZE - Number of guest-function slots reserved in the dispatch table.
Must be at least
max(FN_ID_*) + 1.
Type Aliases§
- CapHash
- 32-byte Cap::Instance identity hash. Matches
javm_cap::CapHashbyte-wise (kept as a local alias here sonub-arch-x86-abistays free of the javm-cap dependency, which pulls inalloc::collectionsetc.).