From f6184ac3fa8e4a8546bf2d7807be27d23751cc01 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Wed, 11 Nov 2026 04:59:29 -0500 Subject: vgsp: ring-ledger scrub release + gated flip-event fixes (CONT.418-419) - gsp_sema_service: never fabricate scrub completions. The guest decrements its scrub-list size by the reported finish delta without a guard, so a fabricated delta larger than the pending list underflows it and the guest spins (~2^64) under the scrubber mutex (r1766-r1768 X soft-locks and guest panics; root-caused by static analysis + gdbstub decode of lastSeen/lastSubmitted/scrubListSize). The release now mirrors the registered channel's own ring: count new valid pushes (wrap-safe snapshot delta) and set the finish word forward-only to the cumulative count - exactly the work the guest submitted, never more. False ring-page registrations are detected and skipped (a mis-registered ring page had its first GPFIFO entry clobbered by an all-ones write). sema_scrub_ramp=0 keeps the legacy all-ones release for A/B; the finish word is never all-ones with the ledger enabled. - gsp_rm_emulation/gsp_display_engine: gate the hSrcResource==0 -> alloc parent event association behind ev_assoc (default 0) and keep strict display-event posting behind disp_events_strict (default 0) - both remain A/B knobs for the flip-event delivery fix. - Live validation (r1769): 4/4 green boots, 0 panics, 0 wedges; glprobe pixel=ff0000ff; gl_frames 500/500 non-black frames captured to a 45 s 640x480 mp4 via pbuffer -> sysmem -> ivshmem. --- kernel/gsp_rm_emulation.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'kernel/gsp_rm_emulation.h') diff --git a/kernel/gsp_rm_emulation.h b/kernel/gsp_rm_emulation.h index 1f7b767..82ae493 100644 --- a/kernel/gsp_rm_emulation.h +++ b/kernel/gsp_rm_emulation.h @@ -236,6 +236,14 @@ int gsp_rm_emu_init(struct nv_vgpu_device *vgpu, struct gsp_emu_context *ctx); void gsp_rm_emu_fini(struct gsp_emu_context *ctx); int gsp_rm_post_channel_event(struct nv_vgpu_device *vgpu, u32 h_src); int gsp_rm_post_channel_event_force(struct nv_vgpu_device *vgpu, u32 h_src); +/* + * r1765 strict variants: post only to events registered on h_src; a miss + * returns -ENOENT instead of running the all-events fallback (the display + * engine's retry pump re-posts a refused completion). + */ +int gsp_rm_post_channel_event_strict(struct nv_vgpu_device *vgpu, u32 h_src); +int gsp_rm_post_channel_event_force_strict(struct nv_vgpu_device *vgpu, + u32 h_src); int gsp_rm_force_post(struct nv_vgpu_device *vgpu, u32 idx); /* * r623: deliver a synthetic OS_ERROR_LOG (0x1006) record to the guest's RM -- cgit v1.2.3