Re: [PATCH v5 6/8] string: introduce memcpy_nt() helpers

"Li Zhe" <[email protected]>
Newsgroups org.kernel.vger.linux-arch,org.kernel.vger.linux-hardening,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Wed, 1 Jul 2026 19:16:19 -0700, [email protected] wrote:

> On Wed, Jul 01, 2026 at 05:05:51PM +0800, Li Zhe wrote:
> > +static __always_inline void memcpy_nt_drain(void)
> > +{
> > +	asm volatile("sfence" : : : "memory");
> 
> Doing a simple grep around the tree will give you the hint to use wmb() and
> not reinvent the wheel here. Not to mention that this is bypassing KCSAN
> instrumentation.
> 
> And then you don't need to go define this drain thing but simply use wmb()
> because, oh, look, other architectures already define a write memory barrier
> too.

Thanks for the review.

Yes, a separate memcpy_nt_drain() wrapper is unnecessary. I'll drop
memcpy_nt_drain() in v6 and use wmb() at the ordering points in patch
8 instead.

Thanks,
Zhe
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.