summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-14 18:16:30 -0500
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-14 18:16:30 -0500
commitad1a6bea0c991e429bb2e5b659000ded21cd39f0 (patch)
treeac4aa787e24dc3d9d107748216db61c0cc387393
parentdfc76004dcc680941c8634fce0d7d56d7ae3ad2b (diff)
downloadopen-iov-ad1a6bea0c991e429bb2e5b659000ded21cd39f0.tar.gz
open-iov-ad1a6bea0c991e429bb2e5b659000ded21cd39f0.zip
vgsp: eng43 - keep the MME pack completion record and packed cursor across an owner channel re-register (sema_gl_mme_keep_done_across_recycle, default 0)
c579: the first eng42-module completion (2799/2799) was followed 1.09 s later by the beef owner re-register; the eng40 chan_ctx_reset treated the recycle as a context loss, rewound the pack cursor and wiped pack_done_gen/ch, so every later prelude launch re-emitted (pre_words_out > 0 -> the r1222 clause correctly withheld the release) and MME-PACK-REARM could never fire. The knob keeps pack_done_h/gen/ch and the cursor (pack_off/pack_sa/load accounting) across the re-register so the first prelude launch on the re-incarnated channel is non-emitting and the REARM clause releases the held calls against the engine-resident program. The per-incarnation latch/live/release state is still cleared, and every genuine context wipe (WEDGE-RECOVER/CWD-CLEAR, park recovery, iram-gate failure, non-keep_gen generation rewind, FLR via reload) clears the record on its own path. Default 0 = legacy invalidate (validation pending).
-rw-r--r--kernel/gsp_phys_booter.c59
1 files changed, 52 insertions, 7 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index 9f1efdd..7a7af61 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -19452,6 +19452,30 @@ MODULE_PARM_DESC(sema_gl_mme_pack_keep_gen,
"Keep the packed-part cursor across prelude-generation changes when the golden overlay is forced (deterministic image; lets a multi-part beef program complete across interleaved state captures; default 0)");
/*
+ * eng43: keep the completion record + packed cursor across an owner channel
+ * RE-REGISTRATION. The client recycles its beef channel family per fire: the
+ * engine context (and the MME IRAM program loaded into it) is not wiped by a
+ * mere channel-handle recycle, but the eng40 chan_ctx_reset treated the
+ * re-register as a context loss. c579: the first eng42-module completion
+ * (2799/2799) was followed 1.09 s later by `beef chan register #12`, the
+ * reset rewound the pack cursor, every later prelude launch re-emitted
+ * (pre_words_out > 0 -> the r1222 clause correctly withheld the release) and
+ * the post-completion REARM could never fire. With this knob on, the
+ * re-register keeps pack_done_h/gen/ch and the cursor (pack_off/pack_sa/
+ * load accounting) so the first prelude launch on the re-incarnated channel
+ * is non-emitting and MME-PACK-REARM releases the held calls against the
+ * engine-resident program. Genuine context wipes (WEDGE-RECOVER/CWD-CLEAR,
+ * park recovery, iram-gate failure, the non-keep_gen generation rewind, FLR
+ * via module reload) still clear the record on their own paths. Default 0 =
+ * legacy (the re-register invalidates). A/B knob.
+ */
+static bool gsp_phys_rmcall_gr_mme_keep_done_across_recycle;
+module_param_named(sema_gl_mme_keep_done_across_recycle,
+ gsp_phys_rmcall_gr_mme_keep_done_across_recycle, bool, 0644);
+MODULE_PARM_DESC(sema_gl_mme_keep_done_across_recycle,
+ "Keep the MME pack completion record (pack_done_h/gen/ch) and the packed cursor across an owner channel re-register (the client recycles beef channels per fire without wiping the GR context); genuine wipes still clear. Default 0 = legacy invalidate");
+
+/*
* SESSION 153-CONTINUED-107: separate knob for the per-launch chronology
* probe lines. They write the MME debug port DURING a live launch, and the
* first three probe-bearing cycles (r1369..r1371) all parked the engine on
@@ -20874,6 +20898,12 @@ static void gsp_phys_gr_ctx_wipe_latches(void)
* the post-completion call release cannot fire against a non-resident
* program. Gated by the same A/B knobs as the release itself; with the
* knobs off this is a no-op (legacy).
+ *
+ * eng43: the "fresh context" premise is what c579 falsified - the client
+ * recycles its channel family per fire while the GR context (and the MME
+ * IRAM program in it) survives. sema_gl_mme_keep_done_across_recycle=1
+ * keeps the completion record + packed cursor across the re-register and
+ * still clears the per-incarnation latch/release state (see below).
*/
void gsp_phys_gr_mme_chan_ctx_reset(u32 h)
{
@@ -20889,13 +20919,28 @@ void gsp_phys_gr_mme_chan_ctx_reset(u32 h)
if (h != READ_ONCE(gsp_phys_gr_mme_pack_load_h) &&
h != READ_ONCE(gsp_phys_gr_mme_pack_done_h))
return;
- WRITE_ONCE(gsp_phys_gr_mme_pack_off, 0);
- WRITE_ONCE(gsp_phys_gr_mme_pack_sa, false);
- WRITE_ONCE(gsp_phys_gr_mme_pack_load_h, 0);
- WRITE_ONCE(gsp_phys_gr_mme_pack_load_words, 0);
- WRITE_ONCE(gsp_phys_gr_mme_pack_done_h, 0);
- WRITE_ONCE(gsp_phys_gr_mme_pack_done_gen, 0);
- WRITE_ONCE(gsp_phys_gr_mme_pack_done_ch, 0);
+ /*
+ * eng43: sema_gl_mme_keep_done_across_recycle=1 - the re-register
+ * recycles the client handle but leaves the GR engine context (and
+ * the MME IRAM program loaded into it) untouched; c579 showed the
+ * legacy wipe turned every later launch into a re-emission, so the
+ * post-completion REARM could never fire. Keep the completion
+ * record and the packed cursor; a genuine context wipe clears them
+ * on its own path (WEDGE-RECOVER/CWD-CLEAR, park recovery, the
+ * iram-gate failure, the non-keep_gen generation rewind). The
+ * per-incarnation latch/release state below is always cleared - the
+ * new incarnation must re-earn residency through the REARM clause.
+ * Default 0 = legacy (identical to the pre-knob behaviour).
+ */
+ if (!READ_ONCE(gsp_phys_rmcall_gr_mme_keep_done_across_recycle)) {
+ WRITE_ONCE(gsp_phys_gr_mme_pack_off, 0);
+ WRITE_ONCE(gsp_phys_gr_mme_pack_sa, false);
+ WRITE_ONCE(gsp_phys_gr_mme_pack_load_h, 0);
+ WRITE_ONCE(gsp_phys_gr_mme_pack_load_words, 0);
+ WRITE_ONCE(gsp_phys_gr_mme_pack_done_h, 0);
+ WRITE_ONCE(gsp_phys_gr_mme_pack_done_gen, 0);
+ WRITE_ONCE(gsp_phys_gr_mme_pack_done_ch, 0);
+ }
WRITE_ONCE(gsp_phys_gr_mme_prelude_gen, 0);
WRITE_ONCE(gsp_phys_gr_mme_pre_emit_off, 0);
WRITE_ONCE(gsp_phys_gr_mme_pending_gen, 0);