From e3055432c8db427c816accdf847c58d1f6c6085d Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Tue, 6 Oct 2026 20:45:07 -0400 Subject: vgsp: mode 35 F2 - MAIN mapped promote (pa+va, nonmapped=0) after the lane promote to reach the per-buffer commit (sets pEngCtx+0x135; gate for the 0xc5c0 construct) --- kernel/gsp_phys_booter.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'kernel/gsp_phys_booter.c') diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c index 7d4893a..35a9b1c 100644 --- a/kernel/gsp_phys_booter.c +++ b/kernel/gsp_phys_booter.c @@ -12812,6 +12812,55 @@ static int gsp_phys_rmcall_user_lane_promote(void __iomem *bar0) return 0; } +/* + * Mode 35 / F2: a single-entry MAIN promote in the mapped (D/golden) shape. + * The capture's user-lane promote is PA-only bNonmapped=1, whose per-entry + * server path bypasses the per-buffer commit 0x5b00d2c; a mapped MAIN entry + * (pa+va, bNonmapped=0) reaches that commit and runs the context-image + * initializer 0x52a94f8, the only writer of the "MAIN ctx buffer initialized" + * byte (pEngCtx+0x135) the 0xc5c0 construct requires. Sent on V7 after the + * capture-faithful 3-entry lane promote and before TURING_COMPUTE_A. + */ +static int gsp_phys_rmcall_user_lane_main_promote(void __iomem *bar0) +{ + struct gsp_phys_rmcall_promote_params *p; + u32 rpc_result = 0, status = 0; + int ret; + + p = kvzalloc(sizeof(*p), GFP_KERNEL); + if (!p) + return -ENOMEM; + p->engine_type = cpu_to_le32(GSP_PHYS_RMCALL_ENGINE_GR0); + p->h_client = cpu_to_le32(0); + p->ch_id = cpu_to_le32(0); + p->h_chan_client = cpu_to_le32(boot_stage.rmcall_client); + p->h_object = cpu_to_le32(GSP_PHYS_RMCALL_HANDLE_USER_LANE); + p->h_virt_memory = cpu_to_le32(0); + p->virt_address = cpu_to_le64(0); + p->size = cpu_to_le64(0); + gsp_phys_rmcall_promote_entry_fill(p, 0, + GSP_PHYS_RMCALL_GR_CTX_BUFFER_ID_MAIN, + boot_stage.rmcall_ctx_pa, boot_stage.rmcall_ctx_va, + boot_stage.rmcall_ctx_size, + GSP_PHYS_RMCALL_GR_CTX_PHYS_ATTR_FB, 1, 0); + p->entry_count = cpu_to_le32(1); + pr_info("vgsp-boot: rm-call: mode 35 MAIN mapped promote (F2): bufferId=%u pa=0x%llx va=0x%llx size=0x%llx physAttr=0x%x bInitialize=1 bNonmapped=0\n", + le16_to_cpu(p->entry[0].buffer_id), + le64_to_cpu(p->entry[0].gpu_phys_addr), + le64_to_cpu(p->entry[0].gpu_virt_addr), + le64_to_cpu(p->entry[0].size), + le32_to_cpu(p->entry[0].phys_attr)); + ret = gsp_phys_rmcall_control(bar0, boot_stage.rmcall_subdevice, + GSP_PHYS_RMCALL_CTRL_GPU_PROMOTE_CTX, + p, sizeof(*p), 24, NULL, 0, &rpc_result, &status, + "GPU_PROMOTE_CTX (mode 35 MAIN mapped, F2)"); + pr_info("vgsp-boot: rm-call: PROMOTE_CTX mode 35 MAIN mapped (F2): entryCount=1 status=0x%x rpc_result=0x%x (hObject=V7 0x%x pa=0x%llx va=0x%llx)\n", + status, rpc_result, GSP_PHYS_RMCALL_HANDLE_USER_LANE, + boot_stage.rmcall_ctx_pa, boot_stage.rmcall_ctx_va); + kvfree(p); + return ret; +} + static int gsp_phys_rmcall_stage3(void __iomem *bar0) { struct gsp_phys_rmcall_vas_params vas; @@ -13209,6 +13258,10 @@ static int gsp_phys_rmcall_stage3(void __iomem *bar0) ret); return ret; } + ret = gsp_phys_rmcall_user_lane_main_promote(bar0); + if (ret) + pr_err("vgsp-boot: rm-call: mode 35 MAIN mapped promote (F2) failed (%d); continuing best-effort (the construct result shows whether the initialized flag was set)\n", + ret); ret = gsp_phys_rmcall_alloc_gr_object_class(bar0, GSP_PHYS_RMCALL_CLASS_COMPUTE, GSP_PHYS_RMCALL_HANDLE_USER_LANE_GR_OBJ, -- cgit v1.2.3