On Wed, Jun 19, 2024 at 01:47:13AM +0900, Masahiro Yamada wrote: > On Tue, Jun 18, 2024 at 2:58 AM Sami Tolvanen <samitolvanen@xxxxxxxxxx> wrote: > > > > +#define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory") > > > > > I know this is a copy-paste of the kernel space code, > but is barrier_data() also necessary for host programs? I tested this with Clang and it worked fine without the barrier, but with gcc, the code no longer produces correct values. Presumably this is a load bearing data barrier. Sami