From 25e85704c122b1231dbf21a51a1145a1af043282 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Fri, 9 Oct 2026 02:46:42 -0400 Subject: vgsp-sema: log release writes into the UVM sysmem semaphore range (ISSUE-0002 diagnosis) Bounded instrumentation: every svc_sem_write into 0x7924_xxxx_xxxx..0x7926 records (h, va, pa, aperture, resolver provenance, value, write rc, read-back ok/value, pool) so the second session's translations for the same VAs can be compared against the first session's. The second client spins in uvm_gpu_retain_by_uuid -> uvm_page_tree_init -> uvm_push_end_and_wait -> wait_for_entry_with_spin (guest kernel stack, sysrq-l) waiting on the channel tracking semaphore; these lines will name the PA the release landed at. --- kernel/gsp_sema_service.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'kernel') diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c index e6459f3..e127a4a 100644 --- a/kernel/gsp_sema_service.c +++ b/kernel/gsp_sema_service.c @@ -538,6 +538,7 @@ struct sema_svc { u64 copy_pat_log; /* sema_copy_pat log budget */ u64 copy_dst_log; /* sema_copy_dst log budget */ u32 op_tr_src; /* provenance of last svc_op_translate */ + u32 sem_sw_log; /* sema-sw release-write log budget */ u64 push_pat_log; /* push-content pattern budget */ u64 dma_skip_log; /* unrecognized-DMA budget */ u64 xfer_raw_log; /* operandless transfer raw-dump budget */ @@ -2610,6 +2611,7 @@ static int svc_sem_write(struct nv_vgpu_device *vgpu, u32 h, u64 va, u32 val) bool is_pool = svc_pool_sem_va(va); int wap, rc; bool verified = false; + bool rb_ok = false; /* * Pool semaphores resolve pin -> verified cache -> targeted rm_mem @@ -2663,8 +2665,20 @@ static int svc_sem_write(struct nv_vgpu_device *vgpu, u32 h, u64 va, u32 val) if (is_pool) (void)svc_read_ap(vgpu, addr, wap, &cur, sizeof(cur)); rc = svc_write_ap(vgpu, addr, wap, &val, sizeof(val)); - if (!rc && !svc_read_ap(vgpu, addr, wap, &back, sizeof(back)) && - back == val) { + rb_ok = !rc && !svc_read_ap(vgpu, addr, wap, &back, sizeof(back)); + /* + * ISSUE-0002 diagnosis: record every release write into UVM's + * sysmem semaphore range (0x792..), with the resolver provenance and + * the read-back, so the second session's translations can be + * compared with the first session's for the same VA. Bounded. + */ + if (va >= 0x79240000000ULL && va < 0x79260000000ULL && + svc.sem_sw_log < 8192) { + svc.sem_sw_log++; + pr_info("sema-sw: h=0x%x va=0x%llx pa=0x%llx ap=%d src=%s val=0x%x rc=%d rb_ok=%d back=0x%x pool=%d\n", + h, va, addr, wap, src, val, rc, rb_ok, back, is_pool); + } + if (rb_ok && back == val) { if (is_pool) svc_pool_wr_note(h, va, addr, src, cur, val, "ok"); return 0; -- cgit v1.2.3