From 0630028527ae401e15a99cf1145829e9725a13ad Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Mon, 21 Sep 2026 19:53:12 -0400 Subject: kernel: msgq writePtr wrap semantics + retry backoff + CE fault buffer size CRITICAL protocol fix (msgq.c): writePtr/readPtr are slot indices that WRAP at msgCount ('writePtr += n; if (>= msgCount) -= msgCount'), NOT monotonic counters. '62 -> 0' is a legitimate wrap, not queue death. - gsp_rm_poll_commands: consume while (cmd_read != writePtr), advance cmd_read = (cmd_read + elem_count) % msgcount. Death detection now only: writePtr >= msgCount (garbage header) / bad element signature / insane elemCount. Removes false deaths on healthy wraps that killed the emulator mid-session (fn 10 FREE timeouts). - gsp_rm_send: published status writePtr now wraps too (driver's free-space/slot math breaks on unbounded values >= 2*msgCount). - gsp_rm_emu_poll: back off on_booter_done retries to 250ms (was every 100us poll -> thousands of 'will retry' lines/sec, dmesg unusable); retry log now pr_warn_ratelimited. - CE_GET_FAULT_METHOD_BUFFER_SIZE(0x20802a08) = 12288 (GV100 formula inherited by Turing: 135*(13*5+2) page-aligned, 5 PCEs). Zero reply failed fault method buffer allocation (NV_ERR_NO_MEMORY) killing channel-group creation. --- kernel/gsp_rm_emulation.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'kernel/gsp_rm_emulation.h') diff --git a/kernel/gsp_rm_emulation.h b/kernel/gsp_rm_emulation.h index b1a7259..b4e84ef 100644 --- a/kernel/gsp_rm_emulation.h +++ b/kernel/gsp_rm_emulation.h @@ -110,6 +110,8 @@ struct gsp_rm_emu { bool parsed; /* queue chain parsed + status queue linked */ bool active; + unsigned long last_parse_retry; /* jiffies of last on_booter_done retry */ + u64 libos_args_gpa; /* from GSP MAILBOX0/1 */ u64 gsp_args_gpa; /* RMARGS region pa */ -- cgit v1.2.3