summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/gsp_phys_booter.c201
-rw-r--r--kernel/gsp_phys_gpu.c6
2 files changed, 193 insertions, 14 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index b1f4b68..0bafced 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -683,6 +683,27 @@ bool gsp_phys_boot_requested(void)
*/
#define GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_EXEC 33u
/*
+ * Mode 34 (2026-10-06, experiment): the context-share golden lane. A
+ * FERMI_CONTEXT_SHARE_A (0x9067, flags SYNC -> VEID 0, VAS = the ladder
+ * SHARED_MANAGEMENT VAS) is allocated on the ladder TSG before the replay.
+ * The golden replay's channel A (0xcaf00054) is parented to the ladder TSG,
+ * passes hVASpace=0 and hContextShare (mutually exclusive) and keeps the
+ * captured unwired shape; its 9-entry promote (first init) runs on A,
+ * followed by A's TURING_A (0xc597) and a TURING_COMPUTE_A (0xc5c0,
+ * 0xcaf00090) class object. V6 (0xcaf00034) is allocated afterwards with
+ * the same share and constructs no class object of its own (a later V6
+ * construct would re-commit the shared VEID's subcontext header over A's
+ * state); its FWCLIENT promote is suppressed. Stage 4 BIND/SCHEDULE/token/
+ * GR-sem and every forwarded launch run on V6, which restores exactly the
+ * VEID/subcontext A's class state was written into.
+ *
+ * NOTE on naming: the requested macro name GSP_PHYS_RMCALL_GR_PROMOTE_CTXSHARE
+ * is already taken by mode 18 (the mode-8-shape context-share mode), so this
+ * mode is defined as GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_CTXSHARE to disambiguate
+ * on the wire (gsp_phys_rmcall_gr_promote=34) and in logs.
+ */
+#define GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_CTXSHARE 34u
+/*
* Mode-28 golden execution channel shape bits (gsp_phys_rmcall_golden_exec_shape,
* default 7). Every combination keeps the captured flags 0x00200320 and the
* FBMEM instance/RAMFC/mthd slices; the bits only choose the client-visible
@@ -796,7 +817,7 @@ bool gsp_phys_boot_requested(void)
*/
#define GSP_PHYS_RMCALL_FWCLIENT_MASK_FECS_SYSMEM (1u << 16)
#define GSP_PHYS_RMCALL_GR_PROMOTE_MAX \
- (GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_EXEC)
+ (GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_CTXSHARE)
/*
* Work-submit token notifier slot. The default index is
@@ -1076,6 +1097,15 @@ bool gsp_phys_boot_requested(void)
* SET_OBJECT binds this class in A's execution context.
*/
#define GSP_PHYS_RMCALL_HANDLE_GOLDEN_SIBLING_GR_OBJ 0xcaf0008cu
+/*
+ * Mode 34: the TURING_COMPUTE_A (0xc5c0) class object constructed on the
+ * context-share golden channel A (0xcaf00054) after its 9-entry promote.
+ * V6 executes in A's shared VEID and constructs no object of its own, so
+ * this handle (not HANDLE_GR_OBJ) is the ladder's rmcall_gr_object for
+ * mode 34. 0xcaf00090 is free between the sibling handles and the
+ * 0xcaf01000 registered-buffer base.
+ */
+#define GSP_PHYS_RMCALL_HANDLE_GOLDEN_CTXSHARE_GR_OBJ 0xcaf00090u
/*
* Golden-image replay sizes (kernel_graphics.c:2058-2060, 2273-2276): the
@@ -7706,6 +7736,8 @@ static const char *gsp_phys_rmcall_gr_promote_name(void)
return "mode 31: mode-25 D first-init + TSG sibling A 9-entry promote after V6 (explicit TSG commit) + V6 execution";
case GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_EXEC:
return "mode 33: mode 31 with the TSG sibling A wired as the object-carrying execution channel (ring/sysmem USERD/TSG parent, TURING_COMPUTE_A on A, execution swap to A)";
+ case GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_CTXSHARE:
+ return "mode 34: golden channel A (0xcaf00054) TSG-parented through FERMI_CONTEXT_SHARE_A (0x9067, VEID 0, ladder VAS), captured unwired shape + 9-entry promote + TURING_A + TURING_COMPUTE_A; V6 (0xcaf00034) executes on the same share with no object of its own and its promote suppressed";
default:
return "off (PROMOTE_CTX never sent)";
}
@@ -7898,7 +7930,9 @@ static int gsp_phys_rmcall_alloc_channel(void __iomem *bar0)
boot_stage.rmcall_gr_promote ==
GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_COMMIT ||
boot_stage.rmcall_gr_promote ==
- GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_EXEC)) {
+ GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_EXEC ||
+ boot_stage.rmcall_gr_promote ==
+ GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_CTXSHARE)) {
vars = &gsp_phys_rmcall_channel_variant_skipctx;
attempts = 1;
}
@@ -8096,6 +8130,20 @@ static void gsp_phys_rmcall_golden_3d_on_ladder(void __iomem *bar0)
boot_stage.rmcall_gr_promote ==
GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_EXEC_LAST)
return;
+ /*
+ * Mode 34: the context-share golden channel A already carries the
+ * class state (TURING_A + TURING_COMPUTE_A) that V6's shared VEID
+ * restores. V6 must not construct: a V6 GR object construct would
+ * re-commit the same subcontext header A wrote and overwrite that
+ * state (the context-share design: construct on A only, after the
+ * promote; B must not construct).
+ */
+ if (boot_stage.rmcall_gr_promote ==
+ GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_CTXSHARE) {
+ pr_info("vgsp-boot: rm-call: mode 34: no GOLDEN TURING_A on V6; the shared golden channel A 0x%x carries the class state V6 executes against\n",
+ GSP_PHYS_RMCALL_HANDLE_GOLDEN_CHANNEL);
+ return;
+ }
ret = gsp_phys_rmcall_alloc_gr_object_class(bar0,
GSP_PHYS_RMCALL_CLASS_GR_3D,
GSP_PHYS_RMCALL_HANDLE_GOLDEN_GR3D_LADDER,
@@ -8363,7 +8411,9 @@ static int gsp_phys_rmcall_golden_replay(void __iomem *bar0)
boot_stage.rmcall_gr_promote ==
GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_COMMIT ||
boot_stage.rmcall_gr_promote ==
- GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_EXEC) &&
+ GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_EXEC ||
+ boot_stage.rmcall_gr_promote ==
+ GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_CTXSHARE) &&
gsp_phys_rmcall_engine_is_gr()) {
if (gsp_phys_rmcall_fwclient_mask_value() &
GSP_PHYS_RMCALL_GOLDEN9_MASK_LADDER_VAS) {
@@ -8477,7 +8527,9 @@ static int gsp_phys_rmcall_golden_replay(void __iomem *bar0)
boot_stage.rmcall_gr_promote ==
GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_COMMIT ||
boot_stage.rmcall_gr_promote ==
- GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_EXEC) &&
+ GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_EXEC ||
+ boot_stage.rmcall_gr_promote ==
+ GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_CTXSHARE) &&
gsp_phys_rmcall_engine_is_gr()) {
ch.flags = cpu_to_le32(GSP_PHYS_RMCALL_CHANNEL_FLAG_GOLDEN9);
ch.internal_flags = cpu_to_le32(
@@ -8591,6 +8643,27 @@ static int gsp_phys_rmcall_golden_replay(void __iomem *bar0)
ch.h_va_space = cpu_to_le32(0);
pr_info("vgsp-boot: rm-call: mode 30 GOLDEN SIBLING A: TSG-parented unwired captured shape (TURING_A will construct here for the first GR init + commit)\n");
}
+ /*
+ * Mode 34: the golden channel itself becomes the share carrier
+ * A. Per the hContextShare contract the channel must be a
+ * TSG child, must pass hVASpace=0 and takes its VAS from the
+ * share (the ladder's SHARED_MANAGEMENT VAS). The submission
+ * wiring stays deliberately absent: gpFifoOffset 0, hUserd
+ * handle 0 and hObjectBuffer 0 with the captured FBMEM
+ * instance/ramfc/mthd slices. The share must already exist
+ * (stage 3 allocates it before this replay).
+ */
+ if (boot_stage.rmcall_gr_promote ==
+ GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_CTXSHARE) {
+ ch_parent = boot_stage.rmcall_tsg;
+ ch.h_va_space = cpu_to_le32(0);
+ ch.h_context_share =
+ cpu_to_le32(boot_stage.rmcall_ctxshare);
+ pr_info("vgsp-boot: rm-call: mode 34 GOLDEN CHANNEL A (context-share carrier): hParent=ladder-TSG 0x%x hVASpace=0 hContextShare=0x%x (VEID 0, VAS 0x%x) captured unwired shape (gpFifoOffset=0 hUserdMemory[0]=0 hObjectBuffer=0, FBMEM instance/ramfc/mthd)\n",
+ boot_stage.rmcall_tsg,
+ boot_stage.rmcall_ctxshare,
+ boot_stage.rmcall_vas);
+ }
pr_info("vgsp-boot: rm-call: GOLDEN9 channel shape: flags=0x%x (PRIVILEGED|USERD_INDEX_VALUE=3|USERD_INDEX_PAGE_FIXED, no SKIP_SCRUBBER/SKIP_CTXBUFFER_ALLOC) hObjectBuffer=0 gpFifoEntries=0x%x instance/userd/ramfc/mthd=FBMEM memdescs block=0x%llx (capture-matched apertures)\n",
GSP_PHYS_RMCALL_CHANNEL_FLAG_GOLDEN9,
GSP_PHYS_RMCALL_GOLDEN_GPFIFO_ENTRIES, golden_fb);
@@ -8685,7 +8758,9 @@ static int gsp_phys_rmcall_golden_replay(void __iomem *bar0)
boot_stage.rmcall_gr_promote ==
GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_COMMIT ||
boot_stage.rmcall_gr_promote ==
- GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_EXEC) &&
+ GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_EXEC ||
+ boot_stage.rmcall_gr_promote ==
+ GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_CTXSHARE) &&
gsp_phys_rmcall_engine_is_gr()) {
ret = gsp_phys_rmcall_golden9_promote(bar0);
if (ret)
@@ -8734,6 +8809,44 @@ static int gsp_phys_rmcall_golden_replay(void __iomem *bar0)
return ret;
}
+ /*
+ * Mode 34: the TURING_COMPUTE_A (0xc5c0) class object on the same
+ * golden channel A, after the promote and after TURING_A (the
+ * promote-then-construct ordering with the working precedent on an
+ * unwired golden channel, mode 25; the wired sibling's post-promote
+ * construct was refused 0x57 in m43). This object is the class state
+ * the shared VEID carries for V6's forwarded methods; V6 constructs
+ * nothing of its own, so this construct is the last writer of the
+ * shared subcontext header.
+ */
+ if (boot_stage.rmcall_gr_promote ==
+ GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_CTXSHARE) {
+ ret = gsp_phys_rmcall_alloc_gr_object_class(bar0,
+ GSP_PHYS_RMCALL_CLASS_COMPUTE,
+ GSP_PHYS_RMCALL_HANDLE_GOLDEN_CTXSHARE_GR_OBJ,
+ GSP_PHYS_RMCALL_HANDLE_GOLDEN_CHANNEL,
+ "mode 34 TURING_COMPUTE_A on golden channel A",
+ &rpc, &status);
+ gsp_phys_rmcall_golden_log("TURING_COMPUTE_A on A",
+ GSP_PHYS_RMCALL_HANDLE_GOLDEN_CTXSHARE_GR_OBJ,
+ GSP_PHYS_RMCALL_CLASS_COMPUTE,
+ status, rpc, ret);
+ if (ret) {
+ gsp_phys_rmcall_golden_fail("TURING_COMPUTE_A on A",
+ GSP_PHYS_RMCALL_HANDLE_GOLDEN_CTXSHARE_GR_OBJ,
+ GSP_PHYS_RMCALL_CLASS_COMPUTE,
+ status, rpc, ret);
+ return ret;
+ }
+ boot_stage.rmcall_gr_object =
+ GSP_PHYS_RMCALL_HANDLE_GOLDEN_CTXSHARE_GR_OBJ;
+ pr_info("vgsp-boot: rm-call: mode 34: golden channel A 0x%x now carries TURING_A 0x%x + TURING_COMPUTE_A 0x%x; rmcall_gr_object=0x%x, V6 executes and constructs nothing\n",
+ GSP_PHYS_RMCALL_HANDLE_GOLDEN_CHANNEL,
+ GSP_PHYS_RMCALL_HANDLE_GOLDEN_GR_OBJ,
+ GSP_PHYS_RMCALL_HANDLE_GOLDEN_CTXSHARE_GR_OBJ,
+ boot_stage.rmcall_gr_object);
+ }
+
pr_info("vgsp-boot: rm-call: GOLDEN replay complete: 6 objects (VAS=0x%x PBphys=0x%x PBvirt=0x%x USERD=0x%x channel=0x%x GR=0x%x)\n",
GSP_PHYS_RMCALL_HANDLE_GOLDEN_VAS,
GSP_PHYS_RMCALL_HANDLE_GOLDEN_PB_PHYS,
@@ -10410,27 +10523,39 @@ static int gsp_phys_rmcall_gr_ctx_promote(void __iomem *bar0)
mode == GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_EXEC_LAST ||
mode == GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING ||
mode == GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_COMMIT ||
- mode == GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_EXEC) &&
+ mode == GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_EXEC ||
+ mode == GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_CTXSHARE) &&
(!gsp_phys_rmcall_golden_enabled() || !gsp_phys_gpu_enabled())) {
pr_err("vgsp-boot: rm-call: mode %u requires gsp_phys_rmcall_golden=1 and gsp_phys_gpu=1 (the golden replay did not run); no PROMOTE_CTX is sent and the ladder aborts with no retry\n",
mode);
return -EINVAL;
}
/*
- * Mode 30/31/33: the sibling A's 9-entry promote carries the group
+ * Mode 30/31/33/34: the sibling A's 9-entry promote carries the group
* context commit; nothing is sent on the V6 channel. A multi-entry
* promote containing MAIN is refused for a SKIP-ctx channel
* (graphics_context.c: bKMDVirtualContext -> NV_ERR_INVALID_ARGUMENT)
* and the single-MAIN exemption needs the pCtxPhysMemDesc the FWCLIENT
* shapes never establish, so a V6 promote would abort stage 3 on 0x1f.
+ * Mode 34's promote ran on the context-share golden channel A inside
+ * the replay (skip_fecs=false), before V6 existed.
*/
if (mode == GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING ||
mode == GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_COMMIT ||
- mode == GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_EXEC) {
+ mode == GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_EXEC ||
+ mode == GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_CTXSHARE) {
if (mode == GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING)
pr_info("vgsp-boot: rm-call: mode 30: no PROMOTE_CTX on V6; the sibling A carries the group context commit (config_group ppEngCtxDesc), V6 inherits via the TSG commit/channel setup\n");
else if (mode == GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_COMMIT)
pr_info("vgsp-boot: rm-call: mode 31: no PROMOTE_CTX on V6; sibling A's 9-entry promote ran after V6's alloc and the TSG loop (fifo_gv100.c:1480-1494) already committed V6\n");
+ else if (mode == GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_CTXSHARE)
+ pr_info("vgsp-boot: rm-call: mode 34: no PROMOTE_CTX on V6; golden channel A 0x%x (hContextShare=0x%x, TSG 0x%x) ran the 9-entry promote and carries TURING_A 0x%x + TURING_COMPUTE_A 0x%x; V6 0x%x executes in the shared VEID\n",
+ GSP_PHYS_RMCALL_HANDLE_GOLDEN_CHANNEL,
+ boot_stage.rmcall_ctxshare,
+ boot_stage.rmcall_tsg,
+ GSP_PHYS_RMCALL_HANDLE_GOLDEN_GR_OBJ,
+ GSP_PHYS_RMCALL_HANDLE_GOLDEN_CTXSHARE_GR_OBJ,
+ boot_stage.rmcall_channel);
else
pr_info("vgsp-boot: rm-call: mode 33: no PROMOTE_CTX on V6; wired sibling A's 9-entry promote ran (TSG commit) and A carries both the class object and the execution (hChannel=0x%x, hGr=0x%x)\n",
GSP_PHYS_RMCALL_HANDLE_GOLDEN_SIBLING,
@@ -12105,8 +12230,9 @@ static int gsp_phys_rmcall_alloc_ctxshare(void __iomem *bar0)
&cs, sizeof(cs), false, NULL,
"FERMI_CONTEXT_SHARE_A", true,
NULL, &status);
- pr_info("vgsp-boot: rm-call: FERMI_CONTEXT_SHARE_A alloc: hClass=0x%x status=0x%x subctxId=0x%x (hParent=hTsg=0x%x hVASpace=0x%x flags=SYNC)%s\n",
- GSP_PHYS_RMCALL_CLASS_CTXSHARE, status,
+ pr_info("vgsp-boot: rm-call: FERMI_CONTEXT_SHARE_A alloc: hClass=0x%x hObject=0x%x status=0x%x subctxId=0x%x (hParent=hTsg=0x%x hVASpace=0x%x flags=SYNC)%s\n",
+ GSP_PHYS_RMCALL_CLASS_CTXSHARE,
+ ret ? 0 : GSP_PHYS_RMCALL_HANDLE_CTXSHARE, status,
le32_to_cpu(cs.subctx_id), boot_stage.rmcall_tsg,
boot_stage.rmcall_vas, ret ? " (rejected)" : "");
if (ret)
@@ -12250,6 +12376,31 @@ static int gsp_phys_rmcall_stage3(void __iomem *bar0)
boot_stage.rmcall_tsg = GSP_PHYS_RMCALL_HANDLE_TSG;
/*
+ * Mode 34: allocate FERMI_CONTEXT_SHARE_A before the golden replay, so
+ * the replay's golden channel A can attach to it (hContextShare) and
+ * the ladder's V6 channel can attach to the same share later. The share
+ * is parented to the ladder TSG and uses the ladder SHARED_MANAGEMENT
+ * VAS (its construct allocates the VEID 0 GraphicsSubcontext in the
+ * TSG's GraphicsContext, and every channel of the TSG must pass it or
+ * the TSG flips to legacy mode). A missing shared-management VAS or a
+ * rejected share aborts stage 3 with no retry.
+ */
+ if (gsp_phys_rmcall_engine_is_gr() &&
+ boot_stage.rmcall_gr_promote ==
+ GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_CTXSHARE) {
+ if (!gsp_phys_rmcall_vas_shared_value()) {
+ pr_err("vgsp-boot: rm-call: mode 34 needs the ladder SHARED_MANAGEMENT VAS (gsp_phys_rmcall_vas_shared=1): the context share's VAS is the ladder VAS and rides its page tables; aborting with no retry\n");
+ return -EINVAL;
+ }
+ ret = gsp_phys_rmcall_alloc_ctxshare(bar0);
+ if (ret) {
+ pr_err("vgsp-boot: rm-call: stage 3 aborted: FERMI_CONTEXT_SHARE_A alloc failed (%d); mode 34 has no share for the golden channel A and V6, and the ladder is not retried\n",
+ ret);
+ return ret;
+ }
+ }
+
+ /*
* Golden-image replay (gsp_phys_rmcall_golden=1 + gsp_phys_gpu=1):
* replay the stock client's post-load golden channel allocations after
* the ladder's VAS/TSG exist and before the ladder's own channel/GR
@@ -12274,7 +12425,9 @@ static int gsp_phys_rmcall_stage3(void __iomem *bar0)
boot_stage.rmcall_gr_promote ==
GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_COMMIT ||
boot_stage.rmcall_gr_promote ==
- GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_EXEC) &&
+ GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_SIBLING_EXEC ||
+ boot_stage.rmcall_gr_promote ==
+ GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_CTXSHARE) &&
gsp_phys_rmcall_engine_is_gr()) {
pr_err("vgsp-boot: rm-call: stage 3 aborted: mode-%u golden replay failed (%d); the golden construct is atomic and is not retried\n",
boot_stage.rmcall_gr_promote, ret);
@@ -12342,6 +12495,24 @@ static int gsp_phys_rmcall_stage3(void __iomem *bar0)
&boot_stage.rmcall_chunks[GSP_PHYS_RMCALL_BUF_RAMFC]);
gsp_phys_rmcall_ctx_diag_decode("post-V6-alloc pre-A-commit");
}
+ /*
+ * Mode 34 readback point: A's 9-entry promote ran inside the replay
+ * before V6's alloc, so this is the first point where V6's
+ * instance/RAMFC can be checked against the already-committed TSG
+ * context; the decode is the same decisive fields (instance WFI pointer
+ * pair + both ENG_CTX_VALID target words).
+ */
+ if (gsp_phys_rmcall_engine_is_gr() &&
+ boot_stage.rmcall_gr_promote ==
+ GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_CTXSHARE) {
+ gsp_phys_rmcall_ctx_diag_dump(
+ "INSTANCE (post-A-commit post-V6-alloc)",
+ &boot_stage.rmcall_chunks[GSP_PHYS_RMCALL_BUF_INSTANCE]);
+ gsp_phys_rmcall_ctx_diag_dump(
+ "RAMFC (post-A-commit post-V6-alloc)",
+ &boot_stage.rmcall_chunks[GSP_PHYS_RMCALL_BUF_RAMFC]);
+ gsp_phys_rmcall_ctx_diag_decode("post-A-commit post-V6-alloc");
+ }
/*
* Mode 28: the golden execution lane. The golden replay allocated the
@@ -12386,6 +12557,14 @@ static int gsp_phys_rmcall_stage3(void __iomem *bar0)
GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_EXEC_LAST) {
pr_info("vgsp-boot: rm-call: mode 29: skipping the TURING_COMPUTE_A (0xc5c0) object alloc: every GR object construct on the client-wired golden channel deadlocked the server (m3a-m3g); the golden execution lane runs object-less (the SET_OBJECT 0xc5c0 binding is the live experiment)\n");
boot_stage.rmcall_gr_object = 0;
+ } else if (boot_stage.rmcall_gr_promote ==
+ GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_CTXSHARE) {
+ pr_info("vgsp-boot: rm-call: mode 34: V6 0x%x constructs no GR object; the shared golden channel A 0x%x already carries TURING_A 0x%x + TURING_COMPUTE_A 0x%x (rmcall_gr_object=0x%x) and a V6 construct would overwrite the shared subcontext header\n",
+ boot_stage.rmcall_channel,
+ GSP_PHYS_RMCALL_HANDLE_GOLDEN_CHANNEL,
+ GSP_PHYS_RMCALL_HANDLE_GOLDEN_GR_OBJ,
+ GSP_PHYS_RMCALL_HANDLE_GOLDEN_CTXSHARE_GR_OBJ,
+ boot_stage.rmcall_gr_object);
} else {
ret = gsp_phys_rmcall_alloc_gr_object(bar0);
if (ret) {
diff --git a/kernel/gsp_phys_gpu.c b/kernel/gsp_phys_gpu.c
index 528caeb..339aa06 100644
--- a/kernel/gsp_phys_gpu.c
+++ b/kernel/gsp_phys_gpu.c
@@ -551,8 +551,8 @@ static int gsp_phys_rmcall_gr_promote_set(const char *val,
return ret;
if (gsp_phys_rmcall_gr_promote_param < 0 ||
- gsp_phys_rmcall_gr_promote_param > 33) {
- pr_warn("vgsp: gsp_phys_rmcall_gr_promote=%d is outside 0..33; clamping to 0 (no PROMOTE_CTX)\n",
+ gsp_phys_rmcall_gr_promote_param > 34) {
+ pr_warn("vgsp: gsp_phys_rmcall_gr_promote=%d is outside 0..34; clamping to 0 (no PROMOTE_CTX)\n",
gsp_phys_rmcall_gr_promote_param);
gsp_phys_rmcall_gr_promote_param = 0;
}
@@ -571,7 +571,7 @@ module_param_cb(gsp_phys_rmcall_gr_promote,
&gsp_phys_rmcall_gr_promote_ops,
&gsp_phys_rmcall_gr_promote_param, 0644);
MODULE_PARM_DESC(gsp_phys_rmcall_gr_promote,
- "GR context-promote bisection (default 0: never send PROMOTE_CTX; 1: single entry init+nonmapped=0 size=raw+subctx, the p6h1b shape; 2: two-phase PA-only nonmapped then VA-only with the same fields; 3: single entry size=raw; 4: two-phase with a zero-field VA-only step; 5: batched entryCount=2 PA-only init + zero-field VA-only; 6: no-entry hVirtMemory, NV01_MEMORY_VIRTUAL (class 0x70) on the VAS at the context window + PROMOTE_CTX entryCount=0; 7: no-entry bare virtAddress+size, entryCount=0; 8: single MAIN entry like 1 on the KMD-managed channel (V6 SKIP_CTXBUFFER_ALLOC), server creates the virtual context memdesc itself; 9: same V6 channel with the stock client's zero-field VA-only MAIN entry, bInitialize=0; 10: same V6 channel, GPU_INITIALIZE_CTX (0x2080012d) installs the physical context memdesc then PROMOTE_CTX entryCount=0 bare virtAddress+size; 11: mode 10 with a server FBMEM context buffer, VIDMEM physAttr 0x4; 12: V5 UVM/vGPU-faithful PA-only MAIN entry (bInitialize=1 bNonmapped=1, no VA) and continue to BIND/SCHEDULE/submit; 13: mode 12 plus a PATCH PA-only promote first, sized from GET_ENGINE_CONTEXT_PROPERTIES engineId 0x10; 14: KMD channel (V6) + PATCH PA-only then the single-entry MAIN init+VA (the flow that books the context VA and commits ENG_CTX_VALID); 15: mode 14 with a server FBMEM MAIN context buffer and VIDMEM physAttr 0x4; 16: mode 14 plus a PM ctxsw PA-only promote first; 17: no client PROMOTE_CTX, paired with gsp_phys_srv_ctxbuf=1 so the GSP-RM server-manages and commits the context; 18: mode 8 shape plus a client FERMI_CONTEXT_SHARE_A on the TSG (hContextShare) whose construct allocates the GraphicsSubcontext; 19: the stock guest's exact 9-entry promote set (MAIN 2 MB PA+VA, PATCH, global buffers, FECS event, private access maps) on V5; 20: mode 6's no-entry hVirtMemory promote on the KMD-managed V6 channel (SKIP_CTXBUFFER_ALLOC), untested - the combination the V5 refusal (0x1f) points at; 21: mode 7's no-entry bare (virtAddress, size) promote on the V6 KMD-managed channel; 22: GPU_INITIALIZE_CTX then mode 20's no-entry hVirtMemory promote; 23: the hVirtMemory no-entry promote backed by the server-owned FBMEM context object (GSP_RM_ALLOC class 0x40) on the server-managed shared V5 channel - a physical memdesc reaches the per-buffer commit without the ADDR_VIRTUAL vaList gate; 24: the reference FWCLIENT non-3D set {MAIN, PM, PATCH, FECS_EVENT, PRIV_ACCESS_MAP, UNRESTRICTED_PRIV_ACCESS_MAP} as one control on the V6 KMD-managed channel, combined PA+VA entries where the ladder has a VA (MAIN PDB-mapped; PATCH/FECS/UNRESTRICTED booking-only), PM and PRIV_ACCESS_MAP init-only (no VA source), unsourceable buffers omitted and logged); 25: the real golden-client construct on the golden replay handles (captured channel flags 0x00200320 + single atomic 9-entry PROMOTE_CTX on the golden channel), then the V6 FWCLIENT follow-on promote on the golden-initialized GR-instance state; requires gsp_phys_rmcall_golden=1 and gsp_phys_rmcall_engine=1; 26/27: golden9 promote on the V6 execution channel (dead ends); 28: the golden execution lane - the golden channel gets a client GPFIFO ring (VA_GPFIFO), a sysmem host-writable USERD and the ladder TSG as parent, keeps the 9-entry promote, and the ladder switches execution to it (V6 stays unscheduled); 29: mode 28 minus the TURING_COMPUTE_A (0xc5c0) object construct on the client-wired golden channel (every GR object construct there deadlocks RM), i.e. the construct-last golden execution lane; 30: the TSG-sibling split: a clean unwired golden sibling A (captured shape, TSG-parented) runs the 9-entry promote and its own TURING_A first-init while V6 stays the execution channel (no swap) with its FWCLIENT promote suppressed; 31: mode-25's device-parented golden first-init (9-entry promote + TURING_A) followed by a clean TSG-parented sibling A whose 9-entry promote runs after V6's own constructs, so the TSG-wide server commit sets V6's instance pointer + RAMFC while V6 stays the execution channel and its own promote is suppressed; 33: mode 31 with the TSG sibling A wired as the object-carrying execution channel (mode-29 golden_exec_shape wiring: ring at VA_GPFIFO, 8 GPFIFO entries, ladder sysmem USERD, TSG parent, host USERD control offset 0 via shape bit7), A's 9-entry promote (skip_fecs), a TURING_COMPUTE_A (0xc5c0) object constructed on A after the accepted promote, and boot_stage.rmcall_channel swapped to A for stage 4 and all forwarded launches; requires gsp_phys_rmcall_golden=1, gsp_phys_gpu=1 and gsp_phys_rmcall_golden_exec_shape=0xE7; values outside 0..33 clamp to 0 with a warning");
+ "GR context-promote bisection (default 0: never send PROMOTE_CTX; 1: single entry init+nonmapped=0 size=raw+subctx, the p6h1b shape; 2: two-phase PA-only nonmapped then VA-only with the same fields; 3: single entry size=raw; 4: two-phase with a zero-field VA-only step; 5: batched entryCount=2 PA-only init + zero-field VA-only; 6: no-entry hVirtMemory, NV01_MEMORY_VIRTUAL (class 0x70) on the VAS at the context window + PROMOTE_CTX entryCount=0; 7: no-entry bare virtAddress+size, entryCount=0; 8: single MAIN entry like 1 on the KMD-managed channel (V6 SKIP_CTXBUFFER_ALLOC), server creates the virtual context memdesc itself; 9: same V6 channel with the stock client's zero-field VA-only MAIN entry, bInitialize=0; 10: same V6 channel, GPU_INITIALIZE_CTX (0x2080012d) installs the physical context memdesc then PROMOTE_CTX entryCount=0 bare virtAddress+size; 11: mode 10 with a server FBMEM context buffer, VIDMEM physAttr 0x4; 12: V5 UVM/vGPU-faithful PA-only MAIN entry (bInitialize=1 bNonmapped=1, no VA) and continue to BIND/SCHEDULE/submit; 13: mode 12 plus a PATCH PA-only promote first, sized from GET_ENGINE_CONTEXT_PROPERTIES engineId 0x10; 14: KMD channel (V6) + PATCH PA-only then the single-entry MAIN init+VA (the flow that books the context VA and commits ENG_CTX_VALID); 15: mode 14 with a server FBMEM MAIN context buffer and VIDMEM physAttr 0x4; 16: mode 14 plus a PM ctxsw PA-only promote first; 17: no client PROMOTE_CTX, paired with gsp_phys_srv_ctxbuf=1 so the GSP-RM server-manages and commits the context; 18: mode 8 shape plus a client FERMI_CONTEXT_SHARE_A on the TSG (hContextShare) whose construct allocates the GraphicsSubcontext; 19: the stock guest's exact 9-entry promote set (MAIN 2 MB PA+VA, PATCH, global buffers, FECS event, private access maps) on V5; 20: mode 6's no-entry hVirtMemory promote on the KMD-managed V6 channel (SKIP_CTXBUFFER_ALLOC), untested - the combination the V5 refusal (0x1f) points at; 21: mode 7's no-entry bare (virtAddress, size) promote on the V6 KMD-managed channel; 22: GPU_INITIALIZE_CTX then mode 20's no-entry hVirtMemory promote; 23: the hVirtMemory no-entry promote backed by the server-owned FBMEM context object (GSP_RM_ALLOC class 0x40) on the server-managed shared V5 channel - a physical memdesc reaches the per-buffer commit without the ADDR_VIRTUAL vaList gate; 24: the reference FWCLIENT non-3D set {MAIN, PM, PATCH, FECS_EVENT, PRIV_ACCESS_MAP, UNRESTRICTED_PRIV_ACCESS_MAP} as one control on the V6 KMD-managed channel, combined PA+VA entries where the ladder has a VA (MAIN PDB-mapped; PATCH/FECS/UNRESTRICTED booking-only), PM and PRIV_ACCESS_MAP init-only (no VA source), unsourceable buffers omitted and logged); 25: the real golden-client construct on the golden replay handles (captured channel flags 0x00200320 + single atomic 9-entry PROMOTE_CTX on the golden channel), then the V6 FWCLIENT follow-on promote on the golden-initialized GR-instance state; requires gsp_phys_rmcall_golden=1 and gsp_phys_rmcall_engine=1; 26/27: golden9 promote on the V6 execution channel (dead ends); 28: the golden execution lane - the golden channel gets a client GPFIFO ring (VA_GPFIFO), a sysmem host-writable USERD and the ladder TSG as parent, keeps the 9-entry promote, and the ladder switches execution to it (V6 stays unscheduled); 29: mode 28 minus the TURING_COMPUTE_A (0xc5c0) object construct on the client-wired golden channel (every GR object construct there deadlocks RM), i.e. the construct-last golden execution lane; 30: the TSG-sibling split: a clean unwired golden sibling A (captured shape, TSG-parented) runs the 9-entry promote and its own TURING_A first-init while V6 stays the execution channel (no swap) with its FWCLIENT promote suppressed; 31: mode-25's device-parented golden first-init (9-entry promote + TURING_A) followed by a clean TSG-parented sibling A whose 9-entry promote runs after V6's own constructs, so the TSG-wide server commit sets V6's instance pointer + RAMFC while V6 stays the execution channel and its own promote is suppressed; 33: mode 31 with the TSG sibling A wired as the object-carrying execution channel (mode-29 golden_exec_shape wiring: ring at VA_GPFIFO, 8 GPFIFO entries, ladder sysmem USERD, TSG parent, host USERD control offset 0 via shape bit7), A's 9-entry promote (skip_fecs), a TURING_COMPUTE_A (0xc5c0) object constructed on A after the accepted promote, and boot_stage.rmcall_channel swapped to A for stage 4 and all forwarded launches; requires gsp_phys_rmcall_golden=1, gsp_phys_gpu=1 and gsp_phys_rmcall_golden_exec_shape=0xE7; 34: the context-share golden lane - a FERMI_CONTEXT_SHARE_A (0x9067, TSG-parented, ladder SHARED_MANAGEMENT VAS, flags SYNC -> VEID 0) is allocated before the replay; the golden replay's channel A (0xcaf00054) joins the ladder TSG through hContextShare with hVASpace=0 while keeping the captured unwired shape, runs the 9-entry promote and carries TURING_A (0xc597) + TURING_COMPUTE_A (0xc5c0, handle 0xcaf00090); V6 (0xcaf00034) attaches to the same share, constructs nothing (a later construct would overwrite the shared VEID's subcontext header) and its promote is suppressed, so stage 4 BIND/SCHEDULE/token/GR-sem and every forwarded launch run on V6 inside A's shared VEID/subcontext; requires gsp_phys_rmcall_golden=1, gsp_phys_gpu=1 and gsp_phys_rmcall_vas_shared=1; values outside 0..34 clamp to 0 with a warning");
int gsp_phys_rmcall_gr_promote_value(void)
{