A reset (the framebuffer's STATUS 0, and QEMU's reset of the device at a
reboot inside one QEMU run) put the rings and the display back, but told the
host nothing: the decoder kept every texture, heap, buffer, pipeline, library,
surface view (with its lease on guest RAM and its imports), device cache and
managed copy, and the region kept every block grant. A rebooted guest then met
its own leaked objects: the next boot's WindowServer had its buffer pins
refused by Metal's space ("refused the pin: Held { requested:
400000008000.., held: 400000008000 }"), and its command buffers faulted by
the thousand.
After a reset the device now looks new, as a real device does after a function
reset. Every queue ends and is fenced, no block is any process's, and the host
is told on the control thread (Host::device_reset), before the thread takes
anything published after the reset. The decoder drops every context's objects
as a close does, each in a refusal scope, lowest context first, and with them
the surface views, the device caches (uncopied: the pages are the rebooted
guest's), the library cache, the presents waiting, the pipelines compiling and
the shown surface. Nothing begun before the reset reaches the guest after it:
a poster carries the reset count its work began at, a queue made before the
reset hands the host nothing more (not even its destroy, which the reset
stands for), and a compile begun before it stores nothing.
What the guest observes after a reset: the ids it picks, the texture resource
ids and pinned GPU addresses it uses, and the samplers' ids it is handed are
free as on a new device; a library lookup misses; no answer or event of work
from before the reset arrives.