
Hyperlight is a lightweight Virtual Machine Manager (VMM) designed to be embedded within applications. It enables safe execution of untrusted code within micro virtual machines with very low latency and minimal overhead.
Repo hyperlight-dev/hyperlight, read from GitHub 1 min ago. hyperlight-dev has not joined Take My Repo.
HYPERLIGHT_SURROGATE_EXTRACT_DIR to configure the surrogate extraction directory on Windows.Sandbox::recreate(), which rebuilds a sandbox's VM and memory from a snapshot. It recovers unrecoverable sandboxes and keeps configuration, host functions, and interrupt handles by @ludfjig in #1751Snapshot::save caches memory-layer hashes and trusts existing same-lengthSnapshot::checked_save to recompute hashes, verify existing blobs, andSnapshot::save no longer synchronously flushes files to stable storage.TSC_ADJUST support.SandboxBuilder::init_data, GuestEnvironment, GuestBlob,GuestHandle, HyperlightPEB, and read_n_bytes_from_user_memory.ByteChunks reply.UninitializedSandbox::new takes a GuestBinary.print_debug feature and hyperlight_host::debug!. Use tracing::debug! instead.target\release\build\hls by @simongdavies in #2038Sandbox::snapshot_with_options takes a snapshot with SnapshotOptions. SnapshotOptions::scratch_size gives the sandbox, and later restores of the snapshot, a different scratch size. A guest can boot with the scratch its initialisation needs and run guest function calls from a snapshot with only the scratch they need, so each restore costs less. It can also give a guest more scratch than it booted with.Sandbox::scratch_allocated_bytes returns how much scratch the guest has allocated since the sandbox was last restored or snapshotted. The guest controls the value it is read from.hyperlight-component-csharp crate for generating C# host bindings from WIT worlds by @ludfjig in #1946Core dumps no longer record the guest binary path. The process name and command line are always <unknown>, as they already were for sandboxes created from snapshots by @ludfjig in #1975
Breaking: Generated libc bindings use usize for size_t arguments and return values, including strlen and memcpy. Rust callers that use u64 or c_ulong need explicit conversions. The C ABI is unchanged.
Breaking: Snapshots use ABI 9 and config schema v5. Existing snapshots
must be regenerated.
Breaking: PtRootFinder receives a SnapshotMemoryReader and returns a
Result<Vec<u64>>. Read snapshot bytes with snapshot.read_exact(gpa, buffer)?
and return roots with Ok(roots).
Related snapshots share immutable memory layers. This reduces capture time
and memory use. A guest can read data it overwrote before a snapshot from the
older layers of that snapshot.
KVM: deleting a memory slot flushes only that slot's guest mappings on Linux
6.12 and later. This speeds up the first guest call after a snapshot,
restore, or unmap changes memory slots.
Breaking: Sandbox::snapshot installs the captured snapshot into the
sandbox and removes map_region and map_file_cow regions, which only
restore removed before. Region pages the guest has not mapped into its page
tables become unreachable at the snapshot instead of at the next restore.
vmem::walk_va_spaces merges adjacent mappings of the same kind into one
mapping.
A new sandbox writes only the guest code, PEB and init data into its memory.
The host populates other pages on first guest touch, which speeds up sandbox
creation.
Use talc as the guest heap allocator. Guest init writes only the start and
end of the heap, which speeds up sandbox creation.
Breaking: Snapshots no longer contain a zero-filled heap region, which
makes them smaller and faster to create, save, and load. The guest heap is
backed by scratch and has no fixed size. Running out of scratch aborts the
guest with MallocFailed instead of failing the allocation.
Breaking: The transport arena sits one unmapped guard page below the reserved scratch-top pages, at an address independent of the scratch size, and the page tables at the scratch base. The guest's page allocator stops at the arena GPA the host publishes in the scratch-top metadata, so guests must be rebuilt. hyperlight_common::layout::scratch_allocator_limit_gpa is renamed scratch_reserved_top_gpa, the start of the reserved pages. An allocator that stops there runs into the arena. The minimum scratch size grows by that guard page. Snapshot ABI 7: existing snapshots must be regenerated.
Breaking: hyperlight-component-macro: host_bindgen! and guest_bindgen! encode values little-endian and qualify function names with their interface, such as wasi:http/types@0.2.0#[method]fields.get by @ludfjig in #1946
SandboxConfiguration::set_heap_size,SandboxConfiguration::DEFAULT_HEAP_SIZE, SandboxBuilder::heap_size, andSandboxBuilder::get_heap_size.SandboxConfiguration and SandboxBuilder, with allocations included in scratch sizing by @andreiltd in #1793 and #1794MsgHeader and external byte values, plus ExternalValueSource implementations for RecvChain and Segments by @andreiltd in #1792, #1793, and #1794MailboxValue, which defines the transport mailbox's allowed wire values, and virtq::canonical::validate_canon_prefix, which validates a bounded available descriptor prefix by @andreiltd in #1891Bytes and ByteChunks preserve contents and pointers across snapshot capture, restore, and cloning by @andreiltd in #1891hyperlight-guest by @andreiltd in #1889hyperlight-guest-bin by @syntactically in #1877VirtqProducer::reset and GuestContext::prepare_snapshot are unsafe. Peers must stay stopped with no live consumer-side chain handles until their consumers are reset or replaced by @andreiltd in #1793 and #1794Sandbox is the primary initialized sandbox type and is reached through hyperlight_host::Sandbox or hyperlight_host::sandbox::Sandbox. MultiUseSandbox remains as a deprecated alias, and sandbox::initialized_multi_use remains as a deprecated public path by @jprendes in #1866hyperlight_guest_bin::exception::arch, previously available on amd64 only, has been deprecated in favour of the new architecture-independent exception handling hooks. The new interfaces are significantly more limited, but more portable; they will be extended in the future by @syntactically in #1877SlotPool allocation and BufferLease ownership. BufferMap supplies complete owners exposing initialized bytes by @andreiltd in #1793ChainBuilder::build() allocates readable and writable requests. writable_avail() reserves available upper-tier slots within the descriptor budget. It may add zero slots to a nonempty chain by @andreiltd in #1793c_guest_dispatch_function when they do not need custom fallback dispatch by @ludfjig in #1848ByteChunks values as pointer and length arrays, and return typed hl_ReturnValue objects from C guest functions through hl_result_from_* constructors by @andreiltd in #1792OFF. hyperlight_guest_tracing::is_trace_enabled reports whether the configured level is above OFF rather than whether the tracing state was allocated by @jprendes in #1840GuestHandle methods, and its sandbox configuration and builder options by @andreiltd in #1794RunPool and the run-specific AllocError::InvalidAlign variant by @andreiltd in #1793SandboxBuilder, the entry point for creating a sandbox. It gathers machine configuration, host functions, init data and memory mappings, then builds a MultiUseSandbox from a guest binary on disk, a guest binary in memory, or a snapshot by @jprendes in #1725MultiUseSandbox::status(), which returns SandboxStatus for inspecting sandbox lifecycle state (poisoned, unrecoverable) by @ludfjig in #1727host_bindgen! / guest_bindgen! component bindgen macros by @andreiltd in #1589SandboxConfiguration::guest_msrs declares the MSRs a guest depends on: declared MSRs are captured in a snapshot and restored, while every other MSR resets to a clean default. On KVM the guest may only read or write declared MSRs, on MSHV and WHP this is not enforced by @ludfjig in #991PathBuf. GuestBinary::FilePath now stores a PathBuf instead of a String, and MultiUseSandbox::generate_crashdump_to_dir accepts Into<PathBuf> instead of Into<String>. Callers passing a String to GuestBinary::FilePath must convert it using .into() by @midsterx in #1652GuestBinary::Buffer owns its bytes as a Vec<u8>, so GuestBinary no longer borrows and carries no lifetime parameter by @jprendes in #1760MultiUseSandbox::poisoned in favor of MultiUseSandbox::status().is_poisoned() by @ludfjig in #1727MultiUseSandbox::restore has been made more flexible and now accepts snapshots from any guest binary or memory layout when host functions are compatible by @ludfjig in #1728rand() and random() after restoring a snapshot to avoid multiple sandboxes sharing PRNG state by @ludfjig in #1667ElfInfo::new() to prevent host process abort from malformed guest binaries. PT_LOAD segments are now bounds-checked, base_va/va_size are stored as fields, and load_at() uses fully checked arithmetic by @danbugsMultiuseSandbox::restore by @ludfjig in #991Snapshot::save, Snapshot::load, and Snapshot::checked_load for persisting and loading sandbox snapshots as OCI Image Layout directories by @ludfjig in #1465. Note that Hyperlight is at version 0.x, so a snapshot taken on one version may not load on another version.HYPERLIGHT_MAX_SURROGATES=0 by @danbugs in #1578flags! macro support for WIT flags types by @jsturtevant in #1327MultiUseSandbox::map_file_cow and UninitializedSandbox::map_file_cow no longer take a label argument. The APIs now accept only (file_path, guest_base) by @simongdavies in #1525.no_std, reducing overhead of loading unnecessary libraries by @simongdavies in #1533tracing-log with native tracing macros for guest log forwarding by @cshung in #1500run_vcpu for improved performance by @ludfjig in #1366VmAction::Halt fast path by @ludfjig in #1476memcpy/memset implementations by @ludfjig in #1473i686-guest, nanvix-unstable, and guest-counter feature flags, along with 32-bit (i686) guest support and its page-table/snapshot code paths. Hyperlight guests are now 64-bit only (x86_64 and aarch64) by @simongdavies in #1525.nomem constraint on out32 OUT-trap asm by @ludfjig in #1534map_region by @Richard-Durkee in #1464#[main] and #[dispatch] macros for type-safe guest entry points by @jprendes in #1384Registerable for MultiUseSandbox by @danbugs in #1392nanvix-unstable feature flag with i686-guest and guest-counter features by @danbugs and @ludfjig in #1385hyperlight_guest_bin by @jprendes in #1383#[main] and #[dispatch] macros for type-safe guest entry points by @jprendes in #1384