summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_sema_service.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-12 01:39:17 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-12 01:46:11 -0400
commit9cb378918e2f11eab134ba60ba8d7f562b7ff289 (patch)
treeb867192f7bf29a0e750ab1285d5b5a60f56fd6f9 /kernel/gsp_sema_service.c
parenta5e57a960dfb11abf50e28487f8b11d6b88aadaf (diff)
downloadopen-iov-master.tar.gz
open-iov-master.zip
vgsp-sema: a stale-dropped pool read must not consume the residue rule (second-client fix)HEADmaster
r99/r100: the fresh session's reused pool page reads the previous session's residue (cur=2) before the first genuine release (pay=1) is translated; the translated read set ch->pool_rel_seen, so every later residue release (payload <= cur) was silently dropped by the final else and the client spun at DEVICE forever. A read that applied or deferred nothing now leaves the flag clear so the r63/r64 residue re-seed still fires for the first genuine release of the session.
Diffstat (limited to 'kernel/gsp_sema_service.c')
-rw-r--r--kernel/gsp_sema_service.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c
index 7d690ab..3c47ed3 100644
--- a/kernel/gsp_sema_service.c
+++ b/kernel/gsp_sema_service.c
@@ -6499,6 +6499,7 @@ static void svc_decode_stream(struct nv_vgpu_device *vgpu, const u8 *buf,
u32 cur = 0;
int pending = 0;
bool have_cur = false;
+ bool pool_stale_drop = false;
bool inc, inc_apply = false;
if (page_pa)
@@ -6646,6 +6647,8 @@ static void svc_decode_stream(struct nv_vgpu_device *vgpu, const u8 *buf,
have_cur = true;
if (st.sem_payload > cur)
pending = 1;
+ else
+ pool_stale_drop = true;
}
/*
* ISSUE-0002 r70: the residue rule
@@ -6657,8 +6660,22 @@ static void svc_decode_stream(struct nv_vgpu_device *vgpu, const u8 *buf,
* so a submissions-based freshness
* test misses the re-decode; this
* flag does not.
+ *
+ * r101: a read the stale-drop path
+ * discarded (payload <= cur, nothing
+ * applied or deferred) must NOT set
+ * the flag. The reused pool page of
+ * a fresh session reads the previous
+ * session's residue (cur > payload)
+ * BEFORE the first genuine release is
+ * translated; that read used to set
+ * the flag and every later residue
+ * release was then silently dropped
+ * (r99/r100: pay=1 cur=2 dropped, the
+ * client spins at DEVICE).
*/
- if (!rrc2 && svc_pool_sem_va(sem_va) && ch)
+ if (!rrc2 && svc_pool_sem_va(sem_va) && ch &&
+ !pool_stale_drop)
ch->pool_rel_seen = true;
}