Files
reims-vgpu/crates
Anees Iqbal 2bd446bc0e 🐛 Correctness fix: refuse an in-place image over a copied import
An IOSurface shape's image in place over its pages lies in the cache's import
of them, and where rt takes neither the pages' pointer nor a dma-buf of them,
that import is a copy of the pages, a Shared block of rt's own, which a command
buffer syncs with the pages only through the objects it uses that name the
copy from their make. The image for views made over it named no copy, nor did
its views or the views a move in place retargets onto it, so the command
buffers that used them synced nothing: the GPU read the copy as it was made,
missing the guest CPU's later writes, and its writes through the views never
reached the guest's pages, which the caches take for the image's own bytes and
never download (read from code; no boot log since 11-25 shows a merging copy
beside shapes in place, the M3 boots' 6 copied imports being read-only and
unchanging pages).

The make now refuses as "copied" where the buffer lies in a copy, before rt is
asked, so the shape takes an image of its own with the caches' fills and
downloads, as for any refusal. For the guest: on a host where the import of a
surface's pages falls back to a copy, textures over the surface read the CPU's
writes and their GPU writes reach the CPU. Found by reading (audit, in-place
reads R1); the test makes the image over a merging copy, its pointer refused,
and finds it refused.
2026-12-03 03:52:43 -08:00
..