lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 21 Jan 2021 15:05:59 +0800
From:   Guo Ren <guoren@...nel.org>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Arnd Bergmann <arnd@...db.de>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-csky@...r.kernel.org,
        linux-arch <linux-arch@...r.kernel.org>,
        Guo Ren <guoren@...ux.alibaba.com>,
        "Paul E . McKenney" <paulmck@...nel.org>
Subject: Re: [PATCH v2 4/5] csky: Fixup asm/cmpxchg.h with correct ordering barrier

Hi Peter,

On Thu, Jan 7, 2021 at 8:41 PM Peter Zijlstra <peterz@...radead.org> wrote:
>
> On Sun, Dec 20, 2020 at 03:39:22PM +0000, guoren@...nel.org wrote:
>
>
> > +#define cmpxchg(ptr, o, n)                                   \
> > +({                                                           \
> > +     __typeof__(*(ptr)) __ret;                               \
> > +     __smp_release_fence();                                  \
> > +     __ret = cmpxchg_relaxed(ptr, o, n);                     \
> > +     __smp_acquire_fence();                                  \
> > +     __ret;                                                  \
> > +})
>
> So you failed to Cc me on patch #2 that introduces these barriers. I've
> dug it out, but I'm still terribly confused on all that.
>
> On first reading the above looks wrong.
>
> Could you also clarify the difference (if any) between your bar.brwarw
> and sync instruction?
>
> Specifically, about transitiviry, or whatever we seem to be calling that
> today.

bar.brwarw just like riscv fence.rwrw
bar means barrier
brw means before read and write would happen before the instruction.
arw means after read and write would happen after the instruction
So it also could be bar.brarw / bar.arw / bar.brw / bar.braw

sync means we need to wait until all instructions complete in the CPU
pipeline and then issue the next instructions.

-- 
Best Regards
 Guo Ren

ML: https://lore.kernel.org/linux-csky/

Powered by blists - more mailing lists