summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_phys_booter.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-16 04:15:26 -0500
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-16 04:15:26 -0500
commit1ae11a19a3bc1dae2f33479416c0df0628f1c381 (patch)
tree18dc59fac05d21b27a995c3734f8300c22b05189 /kernel/gsp_phys_booter.c
parentc9466885f8da0905d87e6c2191258d5f609c09a4 (diff)
downloadopen-iov-1ae11a19a3bc1dae2f33479416c0df0628f1c381.tar.gz
open-iov-1ae11a19a3bc1dae2f33479416c0df0628f1c381.zip
vgsp: eng83 - decode the 0x3810 payload shape: base is d[4], end is d[2]
c836 proved the client's VERTEX_STREAM CALL(2) payload is [stream, end_hi, end_lo, base_hi, base_lo] (MME-VSTREAM: end=0x1e02100 base=0x1e001f4, MME-VSTREAM-LINE base=0x450c1f4 end=0x450e100 pages=3 first8=...3f800000 3e4ccccd...). eng79 wrongly took d[2] (the END 0x450e100, a zero page) as the stream base; the base d[4]=0x450c1f4 carries the float2 vertices. The Doris slot-2 sim with the full 5-word payload emits LOCATION 0x1c08<-base and SIZE 0x604<-end-base. - service: svc_gl_vs_call[5] (getter out[5]) - capture v0..v4, log 5 words; eng82 page-set collection adds the end (v2) and base (v4). - booter eng79: slot-2 base = vcall[4] (require vcall[1]==0, vcall[3]==0, aligned), end = vcall[2]; size pair = end-base; receipt base=.. end=..; VS-BLOB2 dumps at the base. - booter eng77: emit the FULL 5-word 0x3810 call (op=5 cnt=5) even when the window carries its own call (the slot-34 reorder moves the draw ahead of it); the 0x3810 MME-VSTREAM patch maps [base,end] into one contiguous shadow line.
Diffstat (limited to 'kernel/gsp_phys_booter.c')
-rw-r--r--kernel/gsp_phys_booter.c78
1 files changed, 57 insertions, 21 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index 54716e7..a102e04 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -19527,9 +19527,10 @@ static void gsp_phys_gr_mme_release_save(const struct gsp_phys_gr_submit *req,
{
static u32 vs_scan_n;
- u64 scan_va = 0, slot2_va = 0;
- u32 scan_off = 0, vcall[3];
+ u64 scan_va = 0, slot2_va = 0, slot2_end = 0;
+ u32 scan_off = 0, vcall[5];
bool scan_ok = false, have_call = false;
+ bool vs_size_added = false;
if (READ_ONCE(gsp_phys_rmcall_gr_vs_autobind) &&
vs_scan_n < 4u) {
@@ -19546,9 +19547,17 @@ static void gsp_phys_gr_mme_release_save(const struct gsp_phys_gr_submit *req,
* as the base (the patch relocates it like any
* 0x1c00 pair).
*/
- if (gsp_sema_gl_vs_call(vcall) && vcall[2] &&
- !(vcall[2] & 3u) && vcall[2] >= 0x1000u) {
- slot2_va = (u64)vcall[2];
+ /*
+ * Payload = [stream, end_hi, end_lo, base_hi, base_lo]
+ * (the existing 0x3810 MME-VSTREAM patch knows this
+ * shape). The BASE is vcall[4]; the END is vcall[2].
+ */
+ if (gsp_sema_gl_vs_call(vcall) && !vcall[1] &&
+ !vcall[3] && vcall[4] && !(vcall[4] & 3u) &&
+ vcall[4] >= 0x1000u) {
+ slot2_va = (u64)vcall[4];
+ slot2_end = (u64)vcall[2] > slot2_va ?
+ (u64)vcall[2] : 0;
have_call = true;
}
for (vj = 0; vj < 8u; vj++) {
@@ -19579,8 +19588,12 @@ static void gsp_phys_gr_mme_release_save(const struct gsp_phys_gr_submit *req,
vs_pre[vs_n++] = vfmt;
vs_pre[vs_n++] = (u32)(vva >> 32) & 0xffu;
vs_pre[vs_n++] = (u32)vva & 0xfffffffcULL;
- pr_info("vgsp-gr: MME-VS-BIND synth j=%u base=0x%llx fmt=0x%x src=%s h=0x%x push=0x%llx\n",
- vj, (unsigned long long)vva, vfmt,
+ pr_info("vgsp-gr: MME-VS-BIND synth j=%u base=0x%llx end=0x%llx fmt=0x%x src=%s h=0x%x push=0x%llx\n",
+ vj, (unsigned long long)vva,
+ (vj == 0u && have_call &&
+ vva == slot2_va) ?
+ (unsigned long long)slot2_end : 0ULL,
+ vfmt,
(vj == 0u && have_call &&
vva == slot2_va) ? "slot2" :
(vj == 0u && scan_ok &&
@@ -19639,14 +19652,20 @@ static void gsp_phys_gr_mme_release_save(const struct gsp_phys_gr_submit *req,
if (vj == 0u &&
READ_ONCE(gsp_phys_rmcall_gr_vs_autobind) >=
2u && vs_n + 3u <= ARRAY_SIZE(vs_pre)) {
+ u32 sz = (have_call && slot2_end &&
+ slot2_end > slot2_va) ?
+ (u32)(slot2_end - slot2_va) :
+ 0x00100000u;
+
vs_pre[vs_n++] = (1u << 29) |
(2u << 16) |
((0x600u >> 2) &
0xfffu);
vs_pre[vs_n++] = 0u;
- vs_pre[vs_n++] = 0x00100000u;
- pr_info("vgsp-gr: MME-VS-SIZE synth j=0 size=0x100000 h=0x%x push=0x%llx\n",
- req->h_object, req->push_va);
+ vs_pre[vs_n++] = sz;
+ vs_size_added = true;
+ pr_info("vgsp-gr: MME-VS-SIZE synth j=0 size=0x%x h=0x%x push=0x%llx\n",
+ sz, req->h_object, req->push_va);
}
}
/*
@@ -19655,16 +19674,22 @@ static void gsp_phys_gr_mme_release_save(const struct gsp_phys_gr_submit *req,
* stream size; bind it here so the fetch is not
* clamped to zero.
*/
- if (READ_ONCE(gsp_phys_rmcall_gr_vs_autobind) >= 2u &&
+ if (!vs_size_added &&
+ READ_ONCE(gsp_phys_rmcall_gr_vs_autobind) >= 2u &&
!gsp_phys_gr_mme_window_has_vs_size(req->stream,
req->stream_n) &&
vs_n + 3u <= ARRAY_SIZE(vs_pre)) {
+ u32 sz2 = (have_call && slot2_end &&
+ slot2_end > slot2_va) ?
+ (u32)(slot2_end - slot2_va) :
+ 0x00100000u;
+
vs_pre[vs_n++] = (1u << 29) | (2u << 16) |
((0x600u >> 2) & 0xfffu);
vs_pre[vs_n++] = 0u;
- vs_pre[vs_n++] = 0x00100000u;
- pr_info("vgsp-gr: MME-VS-SIZE synth j=0 size=0x100000 (window has VS) h=0x%x push=0x%llx\n",
- req->h_object, req->push_va);
+ vs_pre[vs_n++] = sz2;
+ pr_info("vgsp-gr: MME-VS-SIZE synth j=0 size=0x%x (window has VS) h=0x%x push=0x%llx\n",
+ sz2, req->h_object, req->push_va);
}
/*
* eng77: the client's VERTEX_STREAM_TURING macro
@@ -19674,21 +19699,32 @@ static void gsp_phys_gr_mme_release_save(const struct gsp_phys_gr_submit *req,
* captured call before the DRAW_IAB.
*/
{
- u32 vcall[3];
+ u32 vcall[5];
- if (!gsp_phys_gr_mme_window_has_call2(
- req->stream, req->stream_n) &&
- gsp_sema_gl_vs_call(vcall) &&
- vs_n + 4u <= ARRAY_SIZE(vs_pre)) {
+ /*
+ * eng83: replay the FULL 5-word
+ * [stream, end_hi, end_lo, base_hi, base_lo]
+ * even when the window carries its own
+ * 0x3810 call - the slot-34 reorder moves
+ * the DRAW_IAB ahead of it. The 0x3810
+ * MME-VSTREAM patch maps [base,end] into
+ * one contiguous shadow line.
+ */
+ if (gsp_sema_gl_vs_call(vcall) &&
+ !vcall[1] && !vcall[3] &&
+ vs_n + 6u <= ARRAY_SIZE(vs_pre)) {
vs_pre[vs_n++] = (5u << 29) |
- (3u << 16) |
+ (5u << 16) |
((0x3810u >> 2) &
0xfffu);
vs_pre[vs_n++] = vcall[0];
vs_pre[vs_n++] = vcall[1];
vs_pre[vs_n++] = vcall[2];
- pr_info("vgsp-gr: MME-VS-CALL synth 0x3810 payload=%08x,%08x,%08x h=0x%x push=0x%llx\n",
+ vs_pre[vs_n++] = vcall[3];
+ vs_pre[vs_n++] = vcall[4];
+ pr_info("vgsp-gr: MME-VS-CALL synth 0x3810 payload=%08x,%08x,%08x,%08x,%08x h=0x%x push=0x%llx\n",
vcall[0], vcall[1], vcall[2],
+ vcall[3], vcall[4],
req->h_object, req->push_va);
}
}