Re: [PATCH 2/2] rust: page: add method to copy data between safe pages
From: Miguel Ojeda
Date: Wed Feb 18 2026 - 06:41:41 EST
On Wed, Feb 18, 2026 at 10:37 AM Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
>
> If we picked a style for documenting argument lists, perhaps we should
> add it to Documentation/rust/coding-guidelines.rst?
Sure, I will. (In general, I recommend following the overall style,
i.e. only 3 places in the kernel use such an argument list, vs. all
the others we have.)
> I disagree that the bullets should be swapped. The second bullet at the
> call site:
>
> // - By type invariant and existence of shared reference, there are no other writes to
> // `src` during this call.
>
> Maps to the second bullet in the callee safety requirements:
>
> /// * Callers must ensure that there are no concurrent writes to the source memory region.
Ah, I see what happens now -- that second bullet is not in mainline,
but I see you are referring to this one you introduce here:
https://lore.kernel.org/rust-for-linux/20260213-page-volatile-io-v3-1-d60487b04d40@xxxxxxxxxx/
Is that new bullet needed though? Don't we already exclude data races
when we state "valid for reads"?
https://doc.rust-lang.org/std/ptr/index.html#safety
I asked Benno about this -- let me put him in the To: so that he is in the loop.
If "extra clarifications" are needed, then we could put them in the
safety standard (Benno already has a table there with the shorthands
etc.), rather than introducing redundancy in `# Safety` sections which
can be quite confusing.
Cheers,
Miguel