A VT_MESSAGE is one command on ring 0, at most 16 KiB, so it carries about
1,000 page runs: the message's own and those of each surface it lends. A
surface whose pages make more (a large frame's, its pages scattered: a 4K
frame of 10-bit samples is about 1,500 pages of 16 KiB) was refused by the
arm64e kext, which answered the guest's VideoToolbox kVTParameterErr and
sent the host nothing. A decode whose output buffers are such surfaces then
failed every frame: the host's Dbuf went unanswered and each frame was
emitted -12902. Measured on arm64 macOS 15.6.1 under TCG on a 780M host: a
4K Main 10 stream's hardware decode lost all 6 frames so, and the guest's
wallpaper video extension, a client of the service, failed the same way.
The kext now writes such a surface's runs into a run table, wired memory of
its own that it frees as it lets go of the lend, and sends the table's runs
with RGFX_VT_SURFACE_RUN_TABLE in the record's run_count instead. The host
reads the table from guest RAM as it takes the message, and refuses a table
that does not hold the surface's bytes. Each surface a message lends gets
an even share of the room the message's own runs leave.
For the guest: surfaces of any size lend. A host that predates the flag
refuses such a message as malformed, as the kext refused it before.