Files
reims-vgpu/firmware/prebuilt/ReimsGraphics.toml
Anees Iqbal 2e1b9c570f 🔒 Keep the surface hold word where no process maps it
The hold word lay at byte 8 of a cached block's header, which every process
holding the surface maps writable: any holder could store RAISED there and
hold the other holders' read-write CPU locks of the surface. The word now
lies in the block's own part, which no process maps. Each block laid out in
place keeps a 4 KiB hold page past the span its holders map and before its
runs, and the word is the page's first u32, at region offset runs_offset -
RGFX_SURFACE_HOLD_ROOM, where the host finds it from SURFACE_PAGES. The kext
maps the page with the header and stores 0 there as it caches the block, so
only the kext and the host write the word.

The hold moves to FEATURES_EXT bit 2 (feature bit 66). Bit 1, the hold in
the header, is retired: no host offers it, a write of it takes nothing, and
it is never reused. A mixed pair therefore takes no hold. A guest with an
older kext on this host, or this kext on an older host, gets no image made
in place over a cached surface's pages (declined no-lock-hold) and no
answered creates of textures over pages buffers. Mixed pairs come only from
a stale install, since reims-ctl carries the kext sets with the host.

The host refuses a word that would lie in the block's first 4 KiB, where the
header is: such a block has no hold word, is counted (rt-shape-hold-no-word)
and its makes that copy are declined no-lock-hold. Our kexts lay out none.
The host lowers the word on every exit of a make whose span it opened: rt's
after, or the fence's own drop where the make fails or unwinds past it. As
before, a lock's wait also ends where the device stops or resets, or the
thread is aborted; rgfxHoldSleep now carries those ends, and the native test
holds them. The kext logs the live in-place blocks and what their hold pages
take of the region, and the host logs its holds with the no-word count, so
one boot per guest reads both.

What the guest sees: each in-place block takes 4 KiB more of the region on
x86-64, and 0 or 16 KiB on arm64, where blocks are whole 16 KiB pages; no
process can hold another's locks through the word. The option ROM's record
takes the wire header's new hash; the ROM's bytes are unchanged. Both kext
sets are built again with the next commit.
2026-12-03 07:11:01 -08:00

18 lines
1.3 KiB
TOML

# prebuilt/ReimsGraphics.rom, the option ROM reims-ctl carries for reims-vgpu's own device,
# and the sha256 of each file it was built from: make -C firmware prebuilt writes both on a
# Mac, and make -C firmware prebuilt-check checks them against the tree. Built with:
# Apple clang version 21.0.0 (clang-2100.4.1.1)
# Homebrew LLD 23.1.5 (compatible with GNU linkers)
rom = "ebf34561fbf4e687dd957a3f67817345373dfc41697cc07295812fe7b92b65ec"
[sources]
"crates/reims-vgpu-graphics/include/reims_graphics_wire.h" = "4a73c2acf1c218a5cf4f7d12b9713b0457570116f503c082b65c91e0e575332d"
"firmware/Makefile" = "d85b14a3b40cc59b7c07a9e3a3a273c257e81c5674963c70c3c45eb386e653d0"
"firmware/src/OptionRom.S" = "b910fe61a880580996a81134fba75900d3a9f48ca266e76fe2d6b8eb5a011eb9"
"firmware/src/ReimsGraphics.c" = "554751ff15edbdf69a038d5b2aefd8315b9c54610c090c0890d9c72b13dacdef"
"firmware/src/ReimsGraphics.h" = "83e3439b9baf9c06ee75c57537792770efa7a5cb07e22bf1fb47f6ffef7af169"
"firmware/src/ReimsGraphicsName.c" = "107e7e34240a3942dcd410b701768ab81013f42932783b7fa90fcefc3f815f19"
"firmware/src/ReimsGraphicsOutput.c" = "c35ed747684d90c2b195d95613d79111a9f7c0777654f5f027ed9951bdd7a112"
"firmware/src/ReimsGraphicsRom.S" = "7b0482515ec151272c609b8a2c343476c525aa1f916997df0999e5eeaf42474c"
"firmware/src/Uefi.h" = "d9b349424b645428c114d141b0ca7c4b92ccef573803e16eea501258eb5572ee"