summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_sema_service.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-26 09:36:36 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-26 09:36:36 -0400
commita8a6eaf230c29ef130290e660fac31bf1d3d1d53 (patch)
tree328d5d9cbb08fd5791262583af7141e5273cdaf9 /kernel/gsp_sema_service.c
parent6903b7e82856fd2c2ec8d79a5864df6ffd7a3026 (diff)
downloadopen-iov-a8a6eaf230c29ef130290e660fac31bf1d3d1d53.tar.gz
open-iov-a8a6eaf230c29ef130290e660fac31bf1d3d1d53.zip
vgsp-sema: SESSION 130 zero-payload application + tail-arbitration witness - a zero-headed tail-served payload is now applied under a variant once-key (h | 1) instead of being refused forever (the destination is empty, so authoring zeros is idempotent and correct for the driver's internal zero buffer, whose 256 B i2m equals GF100_ZERO_BUFFER_SIZE exactly), while a later non-zero payload for the same entry still matches its own (h) key and lands; the utildec witness now carries alt=success/tries so a walk-read that fails is distinguishable from one that returns zero
Diffstat (limited to 'kernel/gsp_sema_service.c')
-rw-r--r--kernel/gsp_sema_service.c38
1 files changed, 36 insertions, 2 deletions
diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c
index 4984a8c..1a844cb 100644
--- a/kernel/gsp_sema_service.c
+++ b/kernel/gsp_sema_service.c
@@ -24455,7 +24455,37 @@ static u32 svc_gr_ahead_push(struct nv_vgpu_device *vgpu, struct svc_channel *ch
svc_util_wit.zero = true;
}
if (refuse_zero) {
+ /*
+ * SESSION 130: a zero-headed tail-served
+ * payload is applied under a VARIANT once-key
+ * (h | 1) instead of being refused forever:
+ * the destination is currently empty, so
+ * authoring zeros is idempotent and correct
+ * for the driver's internal zero buffer (the
+ * observed 256 B utility i2m = exactly
+ * GF100_ZERO_BUFFER_SIZE), while a later
+ * non-zero payload for the same entry still
+ * matches its own (h) key and lands - the
+ * refusal can no longer stall the arm
+ * (r737/r739: `writes=0` with the payload
+ * page stably zero).
+ */
svc_util_pending_zero++;
+ if (bytes && !svc_inline_once_seen(push_va,
+ h | 1,
+ off_out,
+ bytes)) {
+ svc_inline_once_store(push_va, h | 1,
+ off_out, bytes);
+ svc_gr_ahead_inline_writes++;
+ if (inline_only)
+ svc_util_wit.fired = true;
+ (void)svc_grce_inline_write(vgpu,
+ off_out,
+ svc_ahead_inline_buf,
+ bytes,
+ ch->h_object);
+ }
} else if (bytes && !svc_inline_once_seen(push_va, h,
off_out,
bytes)) {
@@ -24872,6 +24902,8 @@ static void svc_gr_util_sweep(struct nv_vgpu_device *vgpu,
static u64 svc_util_tail_alt; /* SESSION 130: tails re-read through
* the direct walk because the
* channel read was zero-headed */
+ static u64 svc_util_tail_try; /* ... and the walk attempts (alt is
+ * the subset that yielded non-zero) */
u32 i, maxent = min_t(u32, gsp_sema_gr_util_scan, 64);
u32 swept = 0, nmade = 0;
@@ -24994,6 +25026,7 @@ static void svc_gr_util_sweep(struct nv_vgpu_device *vgpu,
!memchr_inv(nbuf, 0, min_t(u32, tl_a, 16))) {
u32 want = tl_a;
+ svc_util_tail_try++;
if (!svc_util_walk_read(vgpu, nva, tbuf,
want) &&
memchr_inv(tbuf, 0,
@@ -25035,11 +25068,12 @@ static void svc_gr_util_sweep(struct nv_vgpu_device *vgpu,
svc_util_dec_keys[slot].va = va;
svc_util_dec_keys[slot].h = hkey;
svc_util_dec_log++;
- pr_info("sema-utildec: h=0x%x i=%u va=0x%llx len=0x%x p_src=%u pa=%u pb=%u tail_va=0x%llx tail=0x%x t8=%08x %08x alt=%llu lidn=%u subch=%u saw=%d fired=%d zero=%d dst=0x%x ll=%u lc=%u f8=%08x %08x\n",
+ pr_info("sema-utildec: h=0x%x i=%u va=0x%llx len=0x%x p_src=%u pa=%u pb=%u tail_va=0x%llx tail=0x%x t8=%08x %08x alt=%llu/%llu lidn=%u subch=%u saw=%d fired=%d zero=%d dst=0x%x ll=%u lc=%u f8=%08x %08x\n",
ch->h_object, i, va, rlen,
pbuf == bbuf ? 1u : 0u, parse_a, parse_b,
nva, tl_a, svc_util_wit.t0, svc_util_wit.t1,
- svc_util_tail_alt, lidn, lidsc,
+ svc_util_tail_alt, svc_util_tail_try,
+ lidn, lidsc,
svc_util_wit.saw_lid ? 1 : 0,
svc_util_wit.fired ? 1 : 0,
svc_util_wit.zero ? 1 : 0,