mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 06:28:39 +00:00
The guard refused every exported control whose parameter struct holds an NvP64, including three that stock CPU-RM forwards to GSP-RM flat. Refusing them left NVB06F_CTRL_CMD_MIGRATE_ENGINE_CTX_DATA on a channel GSP-RM created to nvdriver's own server, which does not hold that channel and answers OBJECT_NOT_FOUND (CodeRabbit review of #392). Stock, in 620.73.04 and 580.178.04 alike: - rmresControlSerialization_Prologue_IMPL calls serverSerializeCtrlDown for a control whose method entry is flagged RMCTRL_FLAGS_ROUTE_TO_PHYSICAL (0x40, control.h:230 in 620, :233 in 580; resource.c:209-222; ctrlFlags is the method entry's flags, resource.c:172). - serverSerializeCtrlDown returns NV_OK with the block unchanged when FINN does not serialize the control (rmapi_finn.c:85-87 in 620, :86-88 in 580). - rmresControl_Prologue_IMPL then sends the block to GSP-RM as it is (resource.c:254, NV_RM_RPC_CONTROL at :289). The exported NvP64 controls flagged ROUTE_TO_PHYSICAL that FINN does not serialize are the same three in both releases: - NV5080_CTRL_CMD_DEFERRED_API 0x50800101 (flags 0x50048) - NV5080_CTRL_CMD_DEFERRED_API_INTERNAL 0x50800104 (flags 0x500c8) - NVB06F_CTRL_CMD_MIGRATE_ENGINE_CTX_DATA 0xb06f010d (flags 0x14044) The method table of the closed 580.178.04 binary (rmapi::control_table::METHODS) has the same flags for all three. tools/check_pointer_controls.py now derives this from each tree: it reads every method entry's flags from the NVOC tables, the value of RMCTRL_FLAGS_ROUTE_TO_PHYSICAL from control.h, and leaves out of the expected list every exported NvP64 control whose entries all carry it and that the FINN serializer list does not hold. It fails when such a control is on a list. In the embeddedParamCopyIn cross-check, a control stock forwards flat is accounted for: MIGRATE_ENGINE_CTX_DATA, whose pEngineCtxBuff stock copies in first (embedded_param_copy.c:661-672 in 620, :673-684 in 580). Regenerated with it, NVP64_CONTROLS_620 goes from 56 to 53 commands (620.73.04 and 620.70.06) and NVP64_CONTROLS_580 from 53 to 50 (580.178.04). POINTER_CONTROLS is unchanged at 13. The check passes on all three trees. The guard still refuses every other NvP64 control, on both ABIs. A new unit test checks that the three are on no list, go flat through forwards_flat and escape_forwards_flat on both ABIs, and are flagged ROUTE_TO_PHYSICAL in control_table::METHODS. The module doc, the gsp_bringup::forward_escape comment and docs/REPLAY_TESTING.md drop the "stricter than stock" wording. They also record the difference that remains for MIGRATE_ENGINE_CTX_DATA: stock sends GSP-RM the address of CPU-RM's kernel copy of pEngineCtxBuff, while gsp_bringup passes the caller's block unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>