Files
reims-vgpu/guest/kext
Anees Iqbal c3befe17b9 🆕 Give each handed-out shared event a port of the kext's
A shared event's port is a connection of a new user-client type, 'RGSE'
(0x52475345), on the accelerator. The kext can give a process no port of an
object of its own: copyPortNameForObjectInTask is in com.apple.kpi.private
alone (the macOS 26.7.1 KDK's symbol sets), which check-imports refuses. Its
Export (0x113) posts SHARED_EVENT_NAME and answers once the host took the name;
its Import (0x114), by any task that holds the port, posts SHARED_EVENT_IMPORT.

The port is the capability. A call on it proves the caller holds it, and the
kext posts only through the client of the calling task that holds the context
the call names (rgfxPortCallerHolds), with that client's asks, which its close
waits for. Submit refuses the three messages, so no process names or makes an
event in another's context, or imports one it was not handed.

The accelerator's client answers IOConnectAddClient of a port: success only
for a shared event's port of its accelerator. The kernel looks the port up in
the caller's space and sends it nothing, so the bundle asks it before it calls
on a port it was handed: an IOKit call on a port that is no kernel object kills
the caller (measured on the 5300M and the 630, oracle_events connect), where
Metal answers nil.

The port holds the name until IOKit frees the connection, once no task holds a
send right of it, and its free posts SHARED_EVENT_UNNAME. Its close, and IOKit's
word that its creator died, only detach it from the accelerator, so a port
another process holds outlives an exporter killed with SIGKILL.

The kext takes SHARED_EVENT_NAMES where offered and sets kext feature 1 << 6.
2026-11-05 21:59:36 -08:00
..