diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-11-16 23:55:13 -0500 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-11-16 23:55:13 -0500 |
| commit | 1db3831e8f1c40f8e65e86dc38d457aa494c9172 (patch) | |
| tree | 0c0e972896c885f321f407c00d9bf733beeba6cb /kernel/gsp_phys_booter.c | |
| parent | 10e03cd7571e905c17092e234a74eed217f1c83d (diff) | |
| download | open-iov-1db3831e8f1c40f8e65e86dc38d457aa494c9172.tar.gz open-iov-1db3831e8f1c40f8e65e86dc38d457aa494c9172.zip | |
MME-CALL-RESOLVE names the target served for CALL_MME_MACRO(0):
imm-as-IR-address when the captured upload covers it, else the client
SA[0] (present bit; entry 0 is a valid IR address), else golden SA[0].
On the live 570.144 capture the CALL imm (0xd48) is a macro
length/argument, not an address: the client's SA[0] is IR 0 and the
59580-byte prelude holds only 12 x 0x114 uploads / 573 code words.
The c1025 wedge came from releasing CALL(0) on a launch whose packed
program was not re-emitted after the per-fire channel re-register
(MME-PRELUDE part words=0/647 -> badf1201 pc=513 mac=0xf1). With
sema_gl_call0_unmapped_drop=1 (default) an op-4 CALL(0) whose resolved
body is not resident for THIS launch (no prelude words here and no
IRAM-gate live generation) is elided to a NOP and logged as
MME-CALL-UNMAPPED; the ladder continues instead of trapping.
Diffstat (limited to 'kernel/gsp_phys_booter.c')
| -rw-r--r-- | kernel/gsp_phys_booter.c | 167 |
1 files changed, 149 insertions, 18 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c index 5f1b99f..6d6e27a 100644 --- a/kernel/gsp_phys_booter.c +++ b/kernel/gsp_phys_booter.c @@ -19437,6 +19437,57 @@ static u32 gsp_phys_gr_mme_release_due_ms(void) } /* + * eng89t: CALL_MME_MACRO(0) target resolution. + * + * The 570.144 direct-GL draw encodes CALL(0) as an IMMD (op 4) write to + * method 0x3800. The live capture (c1022/c1025) carries imm=0xd48=3400; + * that immediate is NOT an instruction address: the client's own + * START-ADDRESS RAM entry for slot 0 is IR 0 ("sema-mme-sa: slot[0] + * entry=0x0" from the 0x114 prelude capture) and no captured 0x114 + * upload names 0xd48 (the whole 14895-word prelude holds 12 uploads / + * 573 code words, pc 0..0x98). The resolver honours, in order: + * + * 1. the immediate as an IR instruction address when the captured + * upload actually covers it (a client that passes an address + * instead of a length/argument), + * 2. the client's captured SA[0] - the present bit governs, entry 0 + * is a valid IR address (SETUP_FIXED_CONST; the pre-r1448 `!entry` + * test wrongly treated it as absent), + * 3. the golden SA[0] when the capture never supplied the slot. + * + * Returns false only when nothing can serve the call. The final-window + * walk turns that (and a non-resident program) into a MME-CALL-UNMAPPED + * elision instead of letting the FE trap on a macro that is not there. + */ +static bool gsp_phys_gr_mme_call_resolve0(u32 imm, u32 *addr, + const char **src) +{ + u32 sa_ent[64]; + u64 sa_mask = gsp_sema_mme_sa_get(sa_ent, 64); + const u32 *gw; + u32 gent, gn; + + if (imm && gsp_sema_mme_ir_covered(imm)) { + *addr = imm; + *src = "imm-ir"; + return true; + } + if (sa_mask & 1ull) { + *addr = sa_ent[0]; + *src = "sa-client"; + return true; + } + if (gsp_phys_gr_golden_slot(0u, &gent, &gw, &gn)) { + *addr = gent; + *src = "sa-golden"; + return true; + } + *addr = 0; + *src = "none"; + return false; +} + +/* * Held-CALL target census (release-carrier diagnostic): decode every * CALL_MME_MACRO(j) run of the held window with the same run grammar the * hold/drop walk uses (op 1/3 carry 1+cnt words and walk method+4k, op 5 @@ -19533,13 +19584,17 @@ static void gsp_phys_gr_mme_call_census(const struct gsp_phys_gr_submit *req, data = (h >> 16) & 0x1fffu; else if (k + 1u < span) data = req->stream[r + k + 1u]; + u32 raddr = 0; + const char *rsrc = "none"; + bool rmap; + + rmap = gsp_phys_gr_mme_call_resolve0( + data, &raddr, &rsrc); pr_info("vgsp-gr: MME-CALL-ARGS slot=0 data=0x%x at=%u\n", data, r + k); - pr_info("vgsp-gr: MME-CALL-TARGET slot=0 method=0x%x client=0x%x golden=0x%x used=0x%x win=%u held=%u\n", - m, have_cli ? sa_ent[0] : 0u, - have_gold ? gent : 0u, - have_cli ? sa_ent[0] : - (have_gold ? gent : 0u), + pr_info("vgsp-gr: MME-CALL-RESOLVE slot=0 imm=0x%x -> addr=0x%x src=%s%s win=%u held=%u\n", + data, raddr, rsrc, + rmap ? "" : " (unmapped)", win_n, held); } } @@ -21100,6 +21155,27 @@ MODULE_PARM_DESC(sema_gl_mme_hold_fe_idle, "Also hold the real CALL runs while the front-end is not settled (0x400504 != 1; default 1)"); /* + * eng89t: CALL(0) no-wedge fallback. The real 570.144 draw's CALL(0) is an + * IMMD (op 4) whose immediate (0xd48) is a macro program length/argument, + * not an IR address; its target is the client's SA[0] (IR 0 in the + * captured prelude). The c1025 wedge: the per-fire channel re-register + * kept the completion record, MME-PACK-REARM released the CALL on a + * launch whose packed program was not re-emitted (words=0/647) and the FE + * ran a body against an unloaded program (badf1201 pc=513 mac=0xf1 -> + * poison -> GR LAUNCH FAILED). Resolution receipts alone do not stop + * that. This knob drops the one-word op-4 CALL(0) from the FINAL emitted + * window when the resolved body is not provably resident for THIS launch + * (no prelude words emitted here and no IRAM-gate live generation), logs + * MME-CALL-UNMAPPED, and lets the ladder continue instead of trapping. + * Default 1; A/B with 0 reproduces the c1025 trap. + */ +static bool gsp_phys_rmcall_gr_call0_unmapped_drop = true; +module_param_named(sema_gl_call0_unmapped_drop, + gsp_phys_rmcall_gr_call0_unmapped_drop, bool, 0644); +MODULE_PARM_DESC(sema_gl_call0_unmapped_drop, + "Elide an op-4 CALL_MME_MACRO(0) whose resolved macro body is not resident in this launch and log MME-CALL-UNMAPPED (default 1; 0 = legacy, the FE may trap)"); + +/* * SESSION 153-CONTINUED-84: emit NVC597_SET_MME_VERSION=1 (0x234) with the * prelude step. The channel-init defaults the client pushes once per channel * (Turing+) are never replayed, so the replayed context's MME stays in its @@ -26053,16 +26129,30 @@ if (gsp_phys_gr_slot_kept(j, sa_mask, } } /* - * eng89s: op=4 CALL_MME_MACRO(0) execution receipt. There is - * no kernel-side CALL interpreter: the FINAL emitted window is - * walked by the physical GR front-end, and CALL(0) resolves to - * the START-ADDRESS RAM entry the prelude pack uploaded. A - * call that survived the hold/elision passes above is in the - * emitted bytes, so name its resolved target; a held call has - * no receipt (MME-CALL-HOLD names the hold instead). + * eng89s/eng89t: op=4 CALL_MME_MACRO(0) execution receipt. + * There is no kernel-side CALL interpreter: the FINAL emitted + * window is walked by the physical GR front-end, and CALL(0) + * resolves to the START-ADDRESS RAM entry the prelude pack + * uploaded. A call that survived the hold/elision passes + * above is in the emitted bytes, so name its resolved target + * (MME-CALL-RESOLVE). The immediate is not an address on the + * live 570.144 capture - it is a macro length/argument - so + * the resolver's source names what actually served the slot. + * + * eng89t no-wedge fallback: the c1025 release launch carried + * no prelude words (MME-PRELUDE part words=0/647) yet + * MME-PACK-REARM released the CALL against the engine's + * unloaded program (FE ran badf1201 pc=513 mac=0xf1 -> + * poison). A CALL(0) is only allowed to reach the FE when + * its resolved body is provably resident for THIS launch: + * either the pack was loaded earlier and the IRAM gate + * promoted this generation (live_gen), or this very block + * emitted the prelude words. Otherwise elide the one-word + * op=4 run and log MME-CALL-UNMAPPED; the ladder continues. */ if ((u32)(p - pb) > win_emit_off) { static u32 mme_exec_log; + static u32 mme_unmap_log; u32 ew = win_emit_off, en = (u32)(p - pb); while (ew < en && mme_exec_log < 32u) { @@ -26078,17 +26168,58 @@ if (gsp_phys_gr_slot_kept(j, sa_mask, if (m0 == 0x3800u && (op == 4u || op == 0u || op == 1u || op == 3u || op == 5u)) { - u32 sa_ent[64] = { 0 }; - u64 sa_mask = gsp_sema_mme_sa_get( - sa_ent, 64); - u32 addr = (sa_mask & 1ull) ? - sa_ent[0] : 0u; + u32 imm = (op == 4u) ? cnt : 0u; + u32 addr = 0; + const char *src = "none"; + bool mapped = + gsp_phys_gr_mme_call_resolve0( + imm, &addr, &src); + /* + * A same-launch prelude+call block is + * the r1222 ILLEGAL_OPCODE shape, so + * resident means: nothing emitted in + * this block AND the IRAM gate + * promoted this generation (the + * program was loaded and verified by + * an earlier launch). + */ + bool resident = + pre_words_out == 0u && + pl_gen && + READ_ONCE( + gsp_phys_gr_mme_live_gen) == + pl_gen; mme_exec_log++; + pr_info("vgsp-gr: MME-CALL-RESOLVE slot=0 imm=0x%x -> addr=0x%x src=%s h=0x%x rel=%u op=%u\n", + imm, addr, src, + req->h_object, + req->stream_rel, op); + if (op == 4u && + READ_ONCE( + gsp_phys_rmcall_gr_call0_unmapped_drop) && + (!mapped || !resident)) { + if (mme_unmap_log < 32u) { + mme_unmap_log++; + pr_info("vgsp-gr: MME-CALL-UNMAPPED slot=0 imm=0x%x addr=0x%x src=%s reason=%s (run elided; ladder continues) h=0x%x push=0x%llx rel=%u\n", + imm, addr, + src, + !mapped ? + "no-entry" : + "not-resident", + req->h_object, + req->push_va, + req->stream_rel); + } + /* NOP: op 0, count 0 */ + pb[ew] = 0u; + ew += span; + continue; + } pr_info("vgsp-gr: MME-EXEC-CALL slot=0 addr=0x%x h=0x%x push=0x%llx rel=%u op=%u imm=0x%x\n", addr, req->h_object, req->push_va, req->stream_rel, - op, op == 4u ? cnt : 0u); + op, imm); } ew += span; } |
