summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_phys_booter.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-12 01:38:02 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-12 01:46:11 -0400
commit8d7409a93ad883a55dbafe057da408f4e334749e (patch)
tree772786a67d4274d5a4a7f5288e3fd4e5288fd2a2 /kernel/gsp_phys_booter.c
parent5857587697d358206775b3dea532b2d47ef51e8c (diff)
downloadopen-iov-8d7409a93ad883a55dbafe057da408f4e334749e.tar.gz
open-iov-8d7409a93ad883a55dbafe057da408f4e334749e.zip
vgsp-sema: discover GR data candidates from the fresh inline param block (second-client fix)
Second-client launches scanned a stale/reused guest param page that still held the FIRST client's device VAs: zero new candidates resolved, nothing was relocated, and the engine executed with unrelocated guest pointers (r97 evidence: client#1 '15 candidate ptrs, 100 pages resolved' and win0 param 160=110400; client#2 '12 candidates, 1 page' with 160=75552ec00000 unrelocated). The driver-authored inline param block is captured from the pushbuffer at request time, so scanning it makes pointer discovery independent of guest-page reuse timing. Adds svc_gr_scan_cand()/ svc_gr_scan_inline() and the DIAG win0/guest-param proof line. Client #1 stays green (4 cycles); the remaining second-client stall is the pool semaphore residue (see next commit).
Diffstat (limited to 'kernel/gsp_phys_booter.c')
-rw-r--r--kernel/gsp_phys_booter.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index 47e3bd0..f083c99 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -17432,6 +17432,46 @@ gr_page_unmapped:
}
if (gsp_phys_rmcall_gr_gpc_mmu_init_value())
gsp_phys_rmcall_gr_gpc_mmu_init(bar0);
+ /*
+ * m143 DIAGNOSTIC (second-client launch-state divergence): dump the
+ * exact param page the FE/SM will read (win0 slot 0, the QMD bank-0
+ * target) and the guest param page at the three JIT parameter slots,
+ * right before the doorbell. The JIT reads a@0x160/b@0x168/c@0x170
+ * and n@0x178 (verified with ptxas -arch=sm_75). If the win0 copy is
+ * correct here but the engine still stores to the wrong relocated
+ * window, the divergence is engine-side (a stale mapping), not the
+ * relaunched page content.
+ */
+ if (boot_stage.rmcall_gr_shadow_win0.pages) {
+ const u8 *wp = gsp_phys_chunk_page_va(
+ &boot_stage.rmcall_gr_shadow_win0, 0);
+
+ if (wp)
+ pr_info("vgsp-gr: DIAG win0[0] 160=%llx 168=%llx 170=%llx 178=%llx\n",
+ (u64)get_unaligned_le64(wp + 0x160),
+ (u64)get_unaligned_le64(wp + 0x168),
+ (u64)get_unaligned_le64(wp + 0x170),
+ (u64)get_unaligned_le64(wp + 0x178));
+ }
+ {
+ u32 pi;
+
+ for (pi = 0; pi < req->n_pages; pi++) {
+ const u8 *gp;
+
+ if (req->pages[pi].qmd_word != 32u ||
+ !req->pages[pi].hpa)
+ continue;
+ gp = (const u8 *)__va(req->pages[pi].hpa);
+ pr_info("vgsp-gr: DIAG guest-param pa=0x%llx 160=%llx 168=%llx 170=%llx 178=%llx\n",
+ req->pages[pi].hpa,
+ (u64)get_unaligned_le64(gp + 0x160),
+ (u64)get_unaligned_le64(gp + 0x168),
+ (u64)get_unaligned_le64(gp + 0x170),
+ (u64)get_unaligned_le64(gp + 0x178));
+ break;
+ }
+ }
pr_info("vgsp-gr: GR LAUNCH submitted h=0x%x push=0x%llx len=%u pages=%u shadow=%u qmd_va=0x%llx slot=%u words=%u prelude=%d qmdvirt=%d token=0x%x; polling qmd_rel=%u ch_rel=0x%08x (<=%u ms)%s\n",
req->h_object, req->push_va, req->push_len, req->n_pages,
n_shadow, req->qmd_va, sub.slot, words,