On Wed Dec 2, 2026 at 10:53 AM JST, Agustín Pereira wrote: > Nova-core currently supports only fixed boot and teardown GSP RPCs > (`SetSystemInfo`, `SetRegistry`, `GetGspStaticInfo`, and > `UnloadingGuestDriver`). Higher-level GPU subsystems such as FIFO, GR, > and CE engines require allocating, controlling, and freeing GSP-RM > objects arranged in a client -> device -> subdevice hierarchy. > > Implement the GSP-RM object RPC layer and RAII handle abstractions:
The RPC API is deprecated as we are switching to GMC. > > - Add the r570.144 firmware definitions (`rpc_gsp_rm_alloc_v03_00`, > `rpc_gsp_rm_control_v03_00`, `rpc_free_v03_00`, > `NV0000_ALLOC_PARAMETERS`, `NV0080_ALLOC_PARAMETERS`, and > `NV2080_ALLOC_PARAMETERS`) and wrap them in firmware-independent > types in `gsp::fw::commands` with compile-time layout assertions and > `RmStatus` (`NV_STATUS` to kernel `Error`) conversion. > - Expose `MsgFunction::GspRmAlloc` and implement typed `CommandToGsp` / > `MessageFromGsp` commands (`RmAlloc`, `RmControl`, and `RmFree`) in > `gsp::commands`, draining echoed reply payload bytes so the command > queue does not warn on unprocessed data. > - Add `gsp::rm` providing `RmHandle`, an `IdPool`-backed > `RmClientIdAllocator` for handle allocation and recycling, and RAII > handles (`RmClient`, `RmDevice`, `RmSubdevice`, and `RmObject`) whose > Rust lifetime hierarchy enforces child-before-parent `FREE` teardown. > - Wire `Gsp::alloc_client()` into a `CONFIG_NOVA_CORE_SELFTESTS` probe > self-test and add KUnit unit tests (`nova_core_gsp_rm`) covering > handle encoding, allocator growth/recycling, `RmStatus` mapping, and > RPC wire serialization/reply decoding. > > Testing: > - Compiled `drivers/gpu/nova-core.o` and `drivers/gpu/nova-drm.o` with > `LLVM=1 W=1 CLIPPY=1` (`CONFIG_RUST=y`, `CONFIG_NOVA_CORE=m`, > `CONFIG_DRM_NOVA=m`) under both (`CONFIG_NOVA_CORE_SELFTESTS=y`, > `CONFIG_KUNIT=y`) and (`CONFIG_NOVA_CORE_SELFTESTS=n`, > `CONFIG_KUNIT=n`) with zero warnings. > - Verified formatting with `rustfmt --check` and patch style with > `scripts/checkpatch.pl`. > - Not tested on NVIDIA GPU hardware (live GSP `GSP_RM_ALLOC` / `FREE` > self-test execution remains to be verified on hardware); KUnit tests > were compile-tested only. > > This change was drafted with the assistance of an AI coding assistant > and must be reviewed and signed off by the human submitter. Are you even reading what you send, let alone understand it? I'd be thankful if you could stop sending patches.
