Files
reims-vgpu/vm
Anees IqbalandClaude bf8b1dc0b0 🔥 ABI v18 drops dmabuf_for_pages, and AGENTS.md's ban on host-pointer imports becomes the type that replaced it
Component: `crates/reims-vgpu` (`qemu::abi`, `qemu::host_ops`, `runtime::host`,
the shared ABI header), `AGENTS.md`, `vm/boot-x86.sh`, and the `vendor/qemu`
submodule pointer. Both pathways; no behavior change — nothing had called any
of this since the rail was rewired in 159fde84.

Removes `ReimsVgpuHostOps.dmabuf_for_pages`, `HostOps::dmabuf_for_pages`,
`DmaBufExportError` and its nine variants, the eight `REIMS_VGPU_DMABUF_ERR_*`
constants, `REIMS_VGPU_DMABUF_MAX_RUNS`, and their two `header_define` tests.
`the_abi_header_agrees_on_the_dmabuf_codes` and
`every_dmabuf_code_maps_to_its_own_named_check` are replaced by the guest-RAM
equivalents rather than dropped — the crossing they guarded still exists, under
a different name.

Version 17 -> 18 with a history entry saying what went and why. The struct
layout changed, so this is a real ABI break and the handshake in
`copy_host_ops` is what enforces it: a shim and a staticlib that disagree fail
every `device_create` rather than degrading.

## The AGENTS.md rewrite

The Support Matrix paragraph that read "Host-pointer imports over guest RAM are
forbidden" is gone, along with the dma-buf prose beneath it. No "formerly"
paragraph — `b3df160` records what a plausible-but-dead name costs. The
replacement states:

- guest RAM is reached by a host-pointer import sized to a RAMBlock on all
  three hosts, and names the per-platform primitive;
- the bound is `GuestRamImport` / `GuestSlice` and it is a **type, not a review
  rule**, with the explicit note that no scanner enforces it and none should be
  written;
- the import is never required — the copying rails are the no-extension rails
  and the dGPU rails, and `REIMS_VGPU_GUEST_IMPORT=off` is how they get
  exercised;
- page recycling is unchanged and `storage_flush/guards.rs` is still the guard;
- `memory-backend-memfd` is no longer required for guest-memory access, and why
  it is still in the boot scripts (`storage_flush/fence.rs`: the shared memfd is
  what makes uffd minor-fault mode applicable);
- the pinning difference stated honestly — a udmabuf fd pinned and could be
  revoked, `VK_EXT_external_memory_host` promises neither, and two drivers doing
  `get_user_pages` in practice is an observation rather than a contract.

The memory/DMA cell table becomes a memory/import table and now says what each
cell *does*: on unified the import is the rail, on discrete it is the backing
store for a device-local working copy, and a `caps::memory_topology`
misclassification must stay a performance bug.

`vm/boot-x86.sh`'s memfd comment is corrected the same way.

Tests: `cargo test -p reims-vgpu --no-default-features --features
backend-vulkan,host-window -- --test-threads=1` — 1640 lib + all integration
green, ignored counts unchanged. Clippy `-D warnings` clean on all three arms.
`ninja qemu-system-x86_64` links against the v18 staticlib.

Not verified: no live boot on either pathway. The `backend-metal` test arm was
not run (Linux host).

Known incomplete, and the first thing to finish: roughly 54 stale *prose*
mentions of the dma-buf rail remain in Rust doc comments across the crate
(`engine/exec.rs`, `runtime/mapping_write`, `runtime/drain`, `engine/pools`,
`runtime/storage_flush/land.rs`, `runtime/scanout/tests.rs` and others). They
are comments only — nothing compiles against a deleted symbol, and all three
clippy arms are clean — but they describe a rail that is gone and will send the
next reader hunting for it.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-07 14:43:33 +03:00
..
2026-07-26 15:24:53 +03:00

vm/ — macOS guests for the reims-vgpu pathways

crates/reims-vgpu runs three backend pathways over two guest rails. Pick the boot script for the guest you are on and the QEMU/reims-vgpu backend for the host GPU path.

Pathway Script Host accel Backend Typical device
x86 macOS / Linux Vulkan vm/boot-x86.sh KVM / OpenCore+OVMF Vulkan via metal2vulkan reims-vgpu-pci
arm64 macOS / macOS Metal vm/boot-arm64.sh HVF / vmapple Metal-direct reims-vgpu-mmio (product) or apple-gfx-mmio (Apple reference A/B)
arm64 macOS / macOS Vulkan vm/boot-arm64.sh HVF / vmapple Vulkan via metal2vulkan through MoltenVK reims-vgpu-mmio
# arm64 macOS guest on Mac host (Metal or Vulkan/MoltenVK backend)
vm/boot-arm64.sh --testing                 # agent boot: GUI + serial-to-file, hard kill, reverts
vm/boot-arm64.sh --interactive             # human boot: GUI, no time limit, reverts
vm/boot-arm64.sh --device reims-vgpu-mmio --testing
vm/boot-arm64.sh --device apple-gfx-mmio --testing   # Apple-paravirt reference (arm only)

# x86 macOS guest on Linux host
vm/boot-x86.sh --testing
vm/boot-x86.sh --device reims-vgpu-pci --testing

Both scripts use a snapshot-revert lifecycle (testing vs interactive classes; testing hard kill). QMP is a per-boot unix socket under the run dir for that pathway (scripts/qmp/qmp.py).

Networking is typically QEMU SLIRP with SSH hostfwd. Guest disks, IPSWs, OpenCore blobs, and runtime clones are gitignored - private and large; never commit them.

Layout (gitignored runtime)

Pathway-specific trees hold provisioned disks, snapshots, and per-boot clones. See the boot and provisioning scripts for where golden images and SSH setup live.

Stop a wedged guest with the pathway's shutdown helper when available (scripts/vmapple-shutdown on arm); otherwise use QMP quit plus a process kill.