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.