Skip to content

feat: Prototype virtio-mem auto memory#167

Draft
lox wants to merge 7 commits into
mainfrom
lox/prototype-virtio-mem
Draft

feat: Prototype virtio-mem auto memory#167
lox wants to merge 7 commits into
mainfrom
lox/prototype-virtio-mem

Conversation

@lox

@lox lox commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

spore run --memory auto currently pays the full 16GiB guest startup cost before PID 1 can respond, even for tiny commands. The goal of this prototype is to make auto boot like small memory while still exposing the 16GiB ceiling as elastic guest RAM.

Design: fresh managed runs are the only path that opts into virtio-mem. They boot with 512MiB of normal RAM, advertise the remaining 15.5GiB as one grow-only virtio-mem region, then request the plug after the guest readiness path. Explicit memory sizes, custom --kernel, SPOREVM_KERNEL_IMAGE, custom initrd, capture, and resume stay fixed-RAM so existing artifacts do not silently depend on hotplug. The virtio-mem device is shared virtio-mmio model code; HVF and KVM only do the backend-specific memory mapping behind the existing VM boundary.

This moves the managed run kernel default to cleanroom-kernels v0.6.0, and both the Zig resolver and shell helper verify the required hotplug config symbols before accepting a managed kernel.

Developer impact: the public --memory auto surface stays the same, but fresh managed runs can take the small-memory cold path while still growing to 16GiB after boot. This is intentionally a prototype: no pressure policy and no unplug policy.

Local checks already run: mise run test, mise run build, formatting/shell/diff checks, and HVF smokes. The managed /bin/true smoke reported ram_mib=512, virtio_mem_mib=15872, response_ms=31; the custom-kernel guard reported ram_mib=16384, virtio_mem_mib=0; the delayed Alpine smoke reported MemTotal: 16760636 kB after plug.

Kept draft until A1/KVM validation runs on the branch.

@lox lox force-pushed the lox/prototype-virtio-mem branch from 2d25312 to 5aae5f3 Compare June 23, 2026 21:14
@lox lox force-pushed the lox/prototype-virtio-mem branch from 5aae5f3 to 0fd0a92 Compare June 25, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant