Re: [PATCH v2] rust: page: add byte-wise atomic memory copy methods

From: Andreas Hindborg

Date: Thu Feb 12 2026 - 12:24:18 EST


Andreas Hindborg <a.hindborg@xxxxxxxxxx> writes:

> "Boqun Feng" <boqun@xxxxxxxxxx> writes:
>
>> On Thu, Feb 12, 2026 at 03:51:24PM +0100, Andreas Hindborg wrote:
>>> When copying data from buffers that are mapped to user space, it is
>>> impossible to guarantee absence of concurrent memory operations on those
>>> buffers. Copying data to/from `Page` from/to these buffers would be
>>> undefined behavior if no special considerations are made.
>>>
>>> Add methods on `Page` to read and write the contents using byte-wise atomic
>>> operations.
>>>
>>
>> Thank you, but in this patch we still have "the given IO memory" and use
>> memcpy_{from,to}io() as the implementation, is that intended?
>
> No that is a mistake. Please pretend it is regular `memcpy`. I'll send
> v3 soon.

Sorry, pretend it is `kernel::sync::atomic_per_byte_memcpy` ofc.


Best regards,
Andreas Hindborg