Hi Alvin, thanks for working on this! :) For v8:
Please rebase on drm-rust-next and list these two series as dependencies: https://lore.kernel.org/all/20261124-rust-drm-gem-shmem-imported-sgt-v2-0-000f7a9cc...@jannau.net/ https://lore.kernel.org/all/[email protected]/ Please switch the ops array to KVVec, as Deborah suggested: https://lore.kernel.org/all/awYgh-A8JtN899eB@um790/ Please do not add new "as” casts unless absolutely needed. from_safe_cast(), UserPtr::from_u64() and cv!() for the uAPI constants cover all but VM_BIND_OP_TYPE_MASK. For this last one, please use a //CAST: comment > On 22 Nov 2026, at 09:50, Alvin Sun <[email protected]> wrote: > > Implement VM_CREATE, VM_DESTROY, VM_BIND and VM_GET_STATE. VM_CREATE > hands the new VM to the per-file pool and, on insertion failure, the > caller tears it down, so an aborted creation never leaks a VM. > VM_DESTROY removes the VM from the pool and kills it, even if in-flight > jobs still hold references (matching panthor: such jobs are expected There is no way to have in-flight jobs or any jobs running at the moment, so I would drop this part. > to fault). VM_BIND runs synchronously for now. > > Signed-off-by: Alvin Sun <[email protected]> Same comment as previously regarding the commit message. Here is what I would write, as a mere example: --- drm/tyr: add VM-related ioctls Currently, the only VM in Tyr is the one the MCU runs in, and userspace has no way to create one. Add the four VM ioctls of the panthor uAPI: - VM_CREATE creates a user VM and adds it to the VM pool of the file. - VM_DESTROY removes a VM from the pool and kills it. - VM_BIND maps/unmaps BO ranges into a VM. - VM_GET_STATE reports whether a VM is usable. VM_BIND is synchronous only. DRM_PANTHOR_VM_BIND_ASYNC fails with EOPNOTSUPP. — Note how this says _why_ the change is needed, not only what the change does: Currently, the only VM in Tyr is the one the MCU runs in, and userspace has no way to create one. — Daniel
