From dece666732a95bafd349cac2fb2fbcd3aa3afa53 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Thu, 22 Oct 2026 18:28:19 -0400 Subject: r496h do not pin a linear window for content-scanned rings; the VAS walk resolves the rest The registered COPY_SERVER_PDES directory walks the ring VA correctly (trace: L0 -> L1 -> L2 idx 9 -> PD0), but the linear window pin installed around the ring shadows it in svc_lookup_trusted (pin_lookup_any returns the win-flagged entry first), so the pushbuffer/tracker reads kept using the wrong noncontiguous guess. Pin only the content-validated ring page; every other VA of the client now resolves through the walk. --- kernel/gsp_sema_service.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'kernel/gsp_sema_service.c') diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c index 52e921c..b7ce1df 100644 --- a/kernel/gsp_sema_service.c +++ b/kernel/gsp_sema_service.c @@ -14617,21 +14617,22 @@ static void svc_gr_ring_autopin(struct nv_vgpu_device *vgpu, u64 hit_pa = 0; if (svc_gr_ram_ring_scan(vgpu, ch, &hit_pa)) { - u64 win_va = ch->gpfifo_va - SVC_GR_RAM_WIN / 2; - u64 win_pa = hit_pa - SVC_GR_RAM_WIN / 2; - u64 off; - + /* + * Pin ONLY the content-validated ring page (validated, + * not a window guess). The pushbuffer pages and the + * tracker push of this client resolve through the VAS + * page directory registered from COPY_SERVER_PDES + * (r496g) - the surface is NONCONTIGUOUS, so a linear + * window guess is wrong for them and, being a + * pin_lookup_any hit, would shadow the correct walk in + * svc_lookup_trusted (observed r502: the tracker push + * read zeros through the wrong window page and the + * driver's DMA poll never completed). + */ svc_pin_store(ch->gpfifo_va, hit_pa, SVC_APERTURE_SYS); svc_lat_store(ch->gpfifo_va, hit_pa, SVC_APERTURE_SYS); - for (off = 0; off < SVC_GR_RAM_WIN; - off += SEMA_PAGE_SIZE) { - svc_pin_store_win(win_va + off, win_pa + off, - SVC_APERTURE_SYS); - svc_lat_store(win_va + off, win_pa + off, - SVC_APERTURE_SYS); - } ch->gr_ram_logged = true; ch->gr_ram_ring = true; set_bit(ch->gr_index, &svc_gr_ring_done); -- cgit v1.2.3