From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: Rust bindings for gem shmem Date: Sun, 12 Apr 2026 12:01:17 +1000 Message-ID: In-Reply-To: <20260409001559.622026-1-lyude@redhat.com> References: <20260409001559.622026-1-lyude@redhat.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: Rust bindings for gem shmem Author: Lyude Paul Patches: 12 Reviewed: 2026-04-12T12:01:17.613682 --- This is v10 of the Rust bindings for DRM GEM shmem objects, from Lyude Paul= . The series adds two C-side helper exports (`__drm_gem_shmem_free_sgt_lock= ed` and `drm_gem_shmem_get_pages_sgt_locked`), then builds Rust abstraction= s for SGTable and VMap on top of them. The overall design =E2=80=94 using `= Devres` to revoke SGTable mappings on driver unbind and lifetime-bounded `V= MapRef` vs. owned `VMap` =E2=80=94 is sound and well-motivated. However, there is one significant concern around **object destruction order= ing**: when a GEM object with a mapped SGTable is freed while the driver is= still bound (the normal case for userspace-driven buffer teardown), `drm_g= em_shmem_release` frees the sgt and destroys the `dma_resv`, and then the R= ust `Object` field drops run, potentially triggering `SGTableMap::drop` = which tries to re-lock the destroyed `dma_resv` and operate on the already-= NULL `sgt`. This needs clarification or a fix. The C patches (2/5, 3/5) are straightforward. The Rust patches (4/5, 5/5) a= re ambitious and mostly well-structured, with good kunit test coverage in p= atch 5. A few doc/comment typos and a couple of safety-comment inaccuracies= should be cleaned up. --- Generated by Claude Code Patch Reviewer