From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: gpu: nova-core: gsp: fix undefined behavior in command queue code Date: Wed, 25 Mar 2026 08:06:34 +1000 Message-ID: In-Reply-To: <20260323-cmdq-ub-fix-v2-1-77d1213c3f7f@nvidia.com> References: <20260323-cmdq-ub-fix-v2-1-77d1213c3f7f@nvidia.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Overall Series Review Subject: gpu: nova-core: gsp: fix undefined behavior in command queue code Author: Alexandre Courbot Patches: 5 Reviewed: 2026-03-25T08:06:34.022273 --- This is a single-patch fix for undefined behavior in the nova-core GSP comm= and queue code. The old code called `as_slice_mut()`/`as_slice()` on the `C= oherentAllocation`, which temporarily creates a Rust reference spanning the= entire `GspMem` =E2=80=94 including regions owned by the GSP that can chan= ge concurrently. Creating a `&`/`&mut` reference to memory that may be conc= urrently modified is UB in Rust's aliasing model, even if the returned sub-= slices only cover driver-owned regions. The fix replaces this with raw pointer arithmetic via `&raw mut`/`&raw cons= t` and `core::slice::from_raw_parts[_mut]`, constructing slices that cover = only the driver-owned portions. The approach is correct and the circular bu= ffer logic is preserved exactly. The safety comments are thorough and refer= ence the relevant invariants. **Verdict: The patch looks correct and ready to merge.** One minor observat= ion below, but nothing blocking. --- Generated by Claude Code Patch Reviewer