Re: [PATCH v5 0/4] rust: byte-wise atomic copies between `Page` and shared memory

From: Peter Zijlstra

Date: Wed Nov 11 2026 - 04:31:26 EST


On Tue, Nov 10, 2026 at 03:44:18PM +0100, Andreas Hindborg wrote:
> This series adds a way to copy data between a `Page` and memory that is
> shared with actors outside the kernel, such as user space threads or
> hardware, without introducing a data race.
>
> The copy is built on `SysMem` from `kernel::io`, which already accesses
> system memory with volatile or byte-wise atomic operations. The series
> first makes the requirements of `SysMem` explicit by requiring freedom
> from plain accesses for the lifetime of a view. It then adds
> `atomic_per_byte_memcpy()`, a wrapper around the kernel's `memcpy()`
> with explicit safety requirements, and routes the `SysMem` copies
> through it. Finally, it adds `Page::{read,write}_bytewise_atomic`, which
> take a `SysMem<'_, [u8]>` view of the shared buffer.

I am still completely confused by this. In what universe is your magical
atomic_per_byte_memcpy() not memcpy() ?