summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_phys_booter.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-14 12:44:32 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-14 12:44:32 -0400
commit074f493c8bf51e487f5cdff30adbcbc65ad7b79b (patch)
treeebd9b78e51c1d3b17d22cfb15b05ab4e06285b8d /kernel/gsp_phys_booter.c
parent80af379d26334970462f7f14713ab2ca39747280 (diff)
downloadopen-iov-074f493c8bf51e487f5cdff30adbcbc65ad7b79b.tar.gz
open-iov-074f493c8bf51e487f5cdff30adbcbc65ad7b79b.zip
vgsp: user-lane GPFIFO depth must match the host ring modulus (8)
The host publishes every forwarded launch into the one-page ladder ring modulo GSP_PHYS_RMCALL_GPFIFO_ENTRIES (8). Commit 3b82047c declared the mode-35 user-lane channel with 1024 entries for capture fidelity; the engine's GET/PUT then wrap at 1024 while the host wraps at 8, so at the host's first wrap (GP_PUT 7 -> 0) the engine desyncs and never fetches another entry: launches 1..7 green, the 8th and all later ones silent (qmd_rel=5, ch_rel=0), which is the 'launch lottery'. Live proof (r138): the failure fires exactly at slot=7 (first wrap) and every launch after it fails; vecadd_loop (100 launches) dies at the wrap. M1's two-launch acceptance never wrapped, so the regression was latent. Set the declared count back to the host ring constant; the wrap-only fidelity difference against the captured real-client ring is documented at the define.
Diffstat (limited to 'kernel/gsp_phys_booter.c')
-rw-r--r--kernel/gsp_phys_booter.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index 72cda10..879fca4 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -1253,8 +1253,21 @@ bool gsp_phys_boot_requested(void)
#define GSP_PHYS_RMCALL_CHANNEL_FLAG_USER_LANE \
(u32)(GSP_PHYS_RMCALL_CHANNEL_FLAG_PRIVILEGED | (4u << 8) | \
(1u << 21))
-/* Captured user-lane GPFIFO depth (#825: 1024 entries). */
-#define GSP_PHYS_RMCALL_USER_LANE_GPFIFO_ENTRIES 1024u
+/*
+ * User-lane GPFIFO depth. MUST equal the host ring's push modulus
+ * (GSP_PHYS_RMCALL_GPFIFO_ENTRIES, 8): the host publishes into the
+ * one-page ladder ring modulo 8, so if the channel declares a different
+ * count the engine's GET/PUT wrap desyncs at the host's first wrap
+ * (GP_PUT 7 -> 0 while the engine's GET keeps counting to 8) and every
+ * later launch on the boot is never fetched (r138: launches 1..7 green,
+ * the 8th and all after it silent with `qmd_rel=5 ch_rel=0`). The captured
+ * #825 value (1024) describes the real client's own much larger ring, not
+ * this emulated one; the campaign's 2026-10-06 "fidelity" change to 1024
+ * was a wrap-only difference that broke exactly here (M1's two-launch
+ * acceptance never wrapped). Keep the two ends equal.
+ */
+#define GSP_PHYS_RMCALL_USER_LANE_GPFIFO_ENTRIES \
+ GSP_PHYS_RMCALL_GPFIFO_ENTRIES
#define GSP_PHYS_RMCALL_CHANNEL_INTERNALFLAGS_USER_LANE 0x1du
#define GSP_PHYS_RMCALL_TSG_FAULT_BUF_SIZE 0x2000u
#define GSP_PHYS_RMCALL_USER_LANE_PM_RAW_SIZE 0xd100u