diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-08 14:35:35 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-08 14:35:35 -0400 |
| commit | d246c02500a6eb41f88e7aae1febb6e800668d73 (patch) | |
| tree | 37d125ede131bf38d50b2dcb4bcdca7c2724ea3d /kernel | |
| parent | 0ced423a01e85b98fe0d6db7bf7c75300c900316 (diff) | |
| download | open-iov-d246c02500a6eb41f88e7aae1febb6e800668d73.tar.gz open-iov-d246c02500a6eb41f88e7aae1febb6e800668d73.zip | |
vgsp-sema: walk-authoritative GR ring pin when content not yet readable; walk-verdict telemetry (FORENSICS-grv6-ring fix A)
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/gsp_sema_service.c | 55 |
1 files changed, 53 insertions, 2 deletions
diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c index 800b256..4ba37d9 100644 --- a/kernel/gsp_sema_service.c +++ b/kernel/gsp_sema_service.c @@ -7995,6 +7995,7 @@ unsigned gsp_sema_ce_grace_ms = 25000; unsigned gsp_sema_push_hold_ms = 2500; static unsigned long svc_gr_ring_tried; /* ranks that got a diagnostic line */ +static unsigned long svc_gr_walk_dbg; /* ranks that got a walk-verdict line */ static void svc_gr_ring_autopin(struct nv_vgpu_device *vgpu, struct svc_channel *ch) @@ -8199,9 +8200,11 @@ static void svc_gr_ring_autopin(struct nv_vgpu_device *vgpu, { u64 wpa = 0; int wap = SVC_APERTURE_SYS; + int wrc; + u8 wprobe[8]; - if (!svc_lookup_trusted(vgpu, ch->gpfifo_va, &wpa, &wap) && - svc_gr_ring_candidate(vgpu, ch, wpa, wap, &va, &len, &put, + wrc = svc_lookup_trusted(vgpu, ch->gpfifo_va, &wpa, &wap); + if (!wrc && svc_gr_ring_candidate(vgpu, ch, wpa, wap, &va, &len, &put, &get)) { svc_pin_store(ch->gpfifo_va, wpa, wap); svc_lat_store(ch->gpfifo_va, wpa, wap); @@ -8216,6 +8219,54 @@ static void svc_gr_ring_autopin(struct nv_vgpu_device *vgpu, wpa, wap, va, len, put, get); return; } + /* + * FORENSICS-grv6-ring (SA-RING fix A): the trusted walk is + * driver-published truth, but the candidate gate rejects it + * while the ring page is still empty (grv6: entry0 e0/e1=0 + * and the USERD probe rc=-11, so the ring NEVER resolved and + * no GR push was ever decoded). Latch the walked translation + * when the page is at least READABLE, without marking the + * ring done: the pump then has a real target, svc_chan_userd + * can latch the USERD as soon as it shows activity, and the + * next autopin pass upgrades to the full pin once entry0 + * lands. A bad aperture cannot be latched (readability gate); + * ring_done stays unset so the content paths still run. + */ + if (!wrc && + !svc_read_ap(vgpu, wpa, wap, wprobe, sizeof(wprobe))) { + svc_pin_store(ch->gpfifo_va, wpa, wap); + svc_lat_store(ch->gpfifo_va, wpa, wap); + ch->userd_pa = wpa + SVC_GR_USERD_OFF; + ch->userd_as = wap; + if (gsp_sema_dbg && + !test_and_set_bit(ch->gr_index, &svc_gr_walk_dbg)) + pr_info("sema-chan: GR walk-pinned (await content) h=0x%x rank=%u va=0x%llx -> pa=0x%llx ap=%d\n", + ch->h_object, ch->gr_index, + ch->gpfifo_va, wpa, wap); + } + /* + * FORENSICS-grv6 (SA-FORENSICS-2): the H1 branch used to log + * only successes, so a walk miss and a candidate reject were + * indistinguishable. One verdict line per rank (dbg-gated). + */ + if (gsp_sema_dbg && + !test_and_set_bit(ch->gr_index, &svc_gr_walk_dbg)) { + if (wrc) { + pr_info("sema-chan: GR walk miss h=0x%x rank=%u va=0x%llx rc=%d\n", + ch->h_object, ch->gr_index, + ch->gpfifo_va, wrc); + } else { + u64 r0 = 0, r1 = 0; + + (void)svc_read_ap(vgpu, wpa, wap, &r0, + sizeof(r0)); + (void)svc_read_ap(vgpu, wpa + 8, wap, &r1, + sizeof(r1)); + pr_info("sema-chan: GR walk hit/reject h=0x%x rank=%u va=0x%llx pa=0x%llx ap=%d w0=0x%llx w1=0x%llx\n", + ch->h_object, ch->gr_index, + ch->gpfifo_va, wpa, wap, r0, r1); + } + } } if (!test_and_set_bit(ch->gr_index, &svc_gr_ring_tried)) { |
