Re: [PATCH v4 0/3] drm/tyr: allow mismatched buffers for dev_query

From: Miguel Ojeda

Date: Sun Nov 22 2026 - 06:21:36 EST


On Sat, Nov 21, 2026 at 3:18 PM Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
>
> Miguel, are you ok with me taking these uaccess changes through drm-rust-next?

Sure:

Acked-by: Miguel Ojeda <ojeda@xxxxxxxxxx>

A couple notes:

- rust: uaccess: add UserSliceWriter::clear(): Newline before `//
SAFETY` comment? I am actually not sure why the newlines are placed
like that -- if one wants to compress the code, then I would place the
early exit `if`s adjacent to the variables they check, saving 2 lines:

let len = self.length;
if len == 0 {
return Ok(());
}

// SAFETY: `clear_user` checks the userspace address and range and handles
// faults when accessing userspace memory
let res = unsafe { bindings::clear_user(self.ptr.as_mut_ptr(), len) };
if res != 0 {
return Err(EFAULT);
}

- rust: uaccess: add method to get UserPtr from u64: Intra-doc link
on `UserPtr`, and span and intra-doc link on `u64`.

- drm/tyr: allow userspace buffers to be mismatched: `set_uobj` has
a bunch of comments, should they be documentation even if private?

Thanks!

Cheers,
Miguel