summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-06 12:26:15 -0500
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-06 12:26:15 -0500
commit81bde9b725bc6bcd6b12e0898867e56ad2e93360 (patch)
tree6dd953b80d9aabc63bcf6c1dfb341b611cb3d428 /kernel
parentdac10b66798694de675852c94bc26c6e90d39705 (diff)
downloadopen-iov-81bde9b725bc6bcd6b12e0898867e56ad2e93360.tar.gz
open-iov-81bde9b725bc6bcd6b12e0898867e56ad2e93360.zip
vgsp-gl: close a BEGIN/END pair carried into the draw window
r1526's first calls-kept draw window faulted with a GR class error at SET_FRONT_FACE (0x191c <- 0x901) EC 0x0d ILLEGAL_METHOD_IN_BEGIN_END: the window entered with a BEGIN..END pair still open from the previous emitted window, so the first client state method ran inside it. With the prelude CALL runs kept (iram_gate=0, hold_settle=0), r1529 then executed the draw macro (mac=0x22) with zero class errors and engine-side page writes. Add sema_gl_pair_close_entry (default 0, A/B): when the pair tracker carries an open pair into the window, emit the driver's own END form (0x1614 + event word, event 1 for split chains 1/2) before the first window run, then let the normal walk rebase the model. Receipt: PAIR-CLOSE-ENTRY split/ev/window. r1532 showed the close can misfire after refused launches (the injected END itself faulted at 0x1614), so the parameter stays off by default until the model is committed only on retire.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/gsp_phys_booter.c43
1 files changed, 40 insertions, 3 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index 0ea6076..e417d71 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -18550,6 +18550,21 @@ module_param_named(sema_gl_pair_orphan_drop,
gsp_phys_rmcall_gr_pair_orphan_drop, bool, 0644);
MODULE_PARM_DESC(sema_gl_pair_orphan_drop,
"Pair-state sync: roll pair_open/open_split back on dropped/held/LOAD-ONLY windows and elide orphan END runs when no pair is open (default 1; 0 = legacy bytes)");
+/*
+ * SESSION 155-2: r1526's first calls-kept draw window faulted with a GR
+ * class error at SET_FRONT_FACE (0x191c <- 0x901) EC 0x0d
+ * ILLEGAL_METHOD_IN_BEGIN_END: the window entered with a BEGIN..END pair
+ * still open from the previous emitted window, so the first client state
+ * method ran inside it. Close the carried pair with the driver's own END
+ * form (0x1614 + event word, event 1 for split chains 1/2) before the
+ * window, then let the normal walk rebase the model. Gated: default 0
+ * (legacy bytes).
+ */
+static bool gsp_phys_rmcall_gr_pair_close_entry;
+module_param_named(sema_gl_pair_close_entry,
+ gsp_phys_rmcall_gr_pair_close_entry, bool, 0644);
+MODULE_PARM_DESC(sema_gl_pair_close_entry,
+ "Emit an END (0x1614) for a BEGIN..END pair carried open into the window before its first run (default 0; A/B)");
static bool gsp_phys_gr_mme_pairs_emitted; /* launch emitted a pair run */
static u32 gsp_phys_gr_mme_pairs_gen; /* gen whose pairs retired OK */
static u32 gsp_phys_gr_mme_launch_gen; /* last built launch's gen */
@@ -18677,6 +18692,7 @@ static u32 gsp_phys_gr_pair_chain_fix(u32 *w, u32 *np, u32 cap)
{
u32 n = *np, r = 0, begins = 0, ends = 0, drains = 0;
u32 chains = 0, orphans = 0, orphan_dropped = 0, nested = 0, badv = 0;
+ u32 entry_closes = 0;
bool open = READ_ONCE(gsp_phys_gr_mme_pair_open);
bool seen = false, begin_logged = false;
u32 open_split = READ_ONCE(gsp_phys_gr_mme_pair_open_split);
@@ -18684,6 +18700,27 @@ static u32 gsp_phys_gr_pair_chain_fix(u32 *w, u32 *np, u32 cap)
WRITE_ONCE(gsp_phys_gr_mme_pair_open_entry, open);
WRITE_ONCE(gsp_phys_gr_mme_pair_open_entry_split, open_split);
+ if (READ_ONCE(gsp_phys_rmcall_gr_pair_close_entry) && open) {
+ u32 expect = ((open_split == 1u || open_split == 2u) ? 1u : 0u);
+
+ if (n + 2u <= cap) {
+ memmove(&w[2], &w[0], (size_t)n * 4u);
+ w[0] = ((u32)GSP_PHYS_RMCALL_METHOD_IMM << 29) |
+ (1u << 16) | (0x1614u >> 2);
+ w[1] = expect;
+ n += 2u;
+ r = 2u;
+ open = false;
+ seen = true;
+ entry_closes++;
+ pr_info_ratelimited("vgsp-gr: PAIR-CLOSE-ENTRY split=%u ev=%u window=%u (carried pair closed before the window)\n",
+ open_split, expect, n);
+ } else {
+ pr_warn_ratelimited("vgsp-gr: PAIR-CLOSE-ENTRY skipped (window=%u cap=%u)\n",
+ n, cap);
+ }
+ }
+
while (r < n) {
u32 h = w[r];
u32 op = (h >> 29) & 7u;
@@ -18796,12 +18833,12 @@ static u32 gsp_phys_gr_pair_chain_fix(u32 *w, u32 *np, u32 cap)
r += span;
}
if (begins > 1u || drains || chains || orphans || orphan_dropped ||
- nested || badv || open)
- pr_info_ratelimited("vgsp-gr: PAIR-CHAIN begin=%u end=%u drains=%u chain=%u orphan_end=%u orphan_drop=%u nested=%u endv_mismatch=%u open_at_end=%u entry=%u window=%u\n",
+ nested || badv || open || entry_closes)
+ pr_info_ratelimited("vgsp-gr: PAIR-CHAIN begin=%u end=%u drains=%u chain=%u orphan_end=%u orphan_drop=%u nested=%u endv_mismatch=%u open_at_end=%u entry=%u close=%u window=%u\n",
begins, ends, drains, chains, orphans, orphan_dropped,
nested, badv, open ? 1u : 0u,
READ_ONCE(gsp_phys_gr_mme_pair_open_entry) ? 1u : 0u,
- n);
+ entry_closes, n);
*np = n;
WRITE_ONCE(gsp_phys_gr_mme_pair_open, open);
WRITE_ONCE(gsp_phys_gr_mme_pair_open_split, open_split);