ScarletNX / ScarletNX documentation / GPU-owned guest memory (design) · ← previous · next →
The trap model
- A trap covers one producer's byte ranges (a video surface, a VIC output plane, a DMA destination) and has three
levels, as Skyline's: none, write-only (reads pass) and read-write (every access traps). A host page gets the
strictest level of the traps on it, so one fault serves every trap sharing the page.
- A fault on a read-write trap lands the producer's data and drops the trap: the range is the CPU's again. A read
could keep the GPU copy (write-only), which Skyline never did because it doesn't decode the fault's direction.
That is a later step, once the landing path is measured.
- Deadlocks: the trap's own lock is never held across a Vulkan call, a guest memory access or a wait (Skyline's lock
callback rule). A handler that would wait for a producer drops the trap lock, waits, and looks the trap up again.
- Writeback never goes through the trapped view: the data is written through a second view of the same pages (a
mirror), then the trapped view is opened. No other thread can see the range half written.
← previous · next →