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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180222200237.GK2855@linux.vnet.ibm.com>
Date:   Thu, 22 Feb 2018 12:02:37 -0800
From:   "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Daniel Lustig <dlustig@...dia.com>,
        Andrea Parri <parri.andrea@...il.com>,
        linux-kernel@...r.kernel.org, Palmer Dabbelt <palmer@...ive.com>,
        Albert Ou <albert@...ive.com>,
        Alan Stern <stern@...land.harvard.edu>,
        Will Deacon <will.deacon@....com>,
        Boqun Feng <boqun.feng@...il.com>,
        Nicholas Piggin <npiggin@...il.com>,
        David Howells <dhowells@...hat.com>,
        Jade Alglave <j.alglave@....ac.uk>,
        Luc Maranget <luc.maranget@...ia.fr>,
        Akira Yokosawa <akiyks@...il.com>,
        Ingo Molnar <mingo@...nel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        linux-riscv@...ts.infradead.org
Subject: Re: [RFC PATCH] riscv/locking: Strengthen spin_lock() and
 spin_unlock()

On Thu, Feb 22, 2018 at 07:27:17PM +0100, Peter Zijlstra wrote:
> On Thu, Feb 22, 2018 at 10:13:17AM -0800, Paul E. McKenney wrote:
> > So we have something that is not all that rare in the Linux kernel
> > community, namely two conflicting more-or-less concurrent changes.
> > This clearly needs to be resolved, either by us not strengthening the
> > Linux-kernel memory model in the way we were planning to or by you
> > strengthening RISC-V to be no weaker than PowerPC for these sorts of
> > externally viewed release-acquire situations.
> > 
> > Other thoughts?
> 
> Like said in the other email, I would _much_ prefer to not go weaker
> than PPC, I find that PPC is already painfully weak at times.

And here are the four PowerPC litmus tests.  As expected, a
release-acquire pair within a given process orders everything except
for prior stores against later loads, from the viewpoint of some other
process.

And yes, a few of the filenames are unfortunate.

							Thanx, Paul

------------------------------------------------------------------------

PPC MP+o-r-a-o+o-rmb-o
""
(* 22-Feb-2018: ppcmem says "Never" *)
{
0:r1=1; 0:r4=x; 0:r5=y; 0:r6=z;
1:r1=1; 1:r4=x; 1:r5=y; 1:r6=z;
}
 P0           | P1           ;
 stw r1,0(r4) | lwz r7,0(r6) ;
 lwsync       | lwsync       ;
 stw r1,0(r5) | lwz r8,0(r4) ;
 lwz r7,0(r5) |              ;
 lwsync       |              ;
 stw r1,0(r6) |              ;


exists
(1:r7=1 /\ 1:r8=0)

------------------------------------------------------------------------

PPC SB+o-r-a-o+o-rmb-o
""
(* 22-Feb-2018: ppcmem says "Sometimes" *)
{
0:r1=1; 0:r4=x; 0:r5=y; 0:r6=z;
1:r1=1; 1:r4=x; 1:r5=y; 1:r6=z;
}
 P0           | P1           ;
 stw r1,0(r4) | stw r1,0(r6) ;
 lwsync       | lwsync       ;
 stw r1,0(r5) | lwz r7,0(r4) ;
 lwz r8,0(r5) |              ;
 lwsync       |              ;
 lwz r7,0(r6) |              ;


exists
(0:r7=0 /\ 1:r7=0)

------------------------------------------------------------------------

PPC LB+o-r-a-o+o-rmb-o
""
(* 22-Feb-2018: ppcmem says "Never" *)
{
0:r1=1; 0:r4=x; 0:r5=y; 0:r6=z;
1:r1=1; 1:r4=x; 1:r5=y; 1:r6=z;
}
 P0           | P1           ;
 lwz r7,0(r4) | lwz r7,0(r6) ;
 lwsync       | lwsync       ;
 stw r1,0(r5) | stw r1,0(r4) ;
 lwz r8,0(r5) |              ;
 lwsync       |              ;
 stw r1,0(r6) |              ;


exists
(0:r7=1 /\ 1:r7=1)

------------------------------------------------------------------------

PPC MP+o-rmb-o+o-r-a-o.litmus
""
(* 22-Feb-2018: ppcmem says "Never" *)
{
0:r1=1; 0:r4=x; 0:r5=y; 0:r6=z;
1:r1=1; 1:r4=x; 1:r5=y; 1:r6=z;
}
 P0           | P1           ;
 lwz r7,0(r4) | stw r1,0(r6) ;
 lwsync       | lwsync       ;
 stw r1,0(r5) | stw r1,0(r4) ;
 lwz r8,0(r5) |              ;
 lwsync       |              ;
 lwz r9,0(r6) |              ;


exists
(0:r7=1 /\ 0:r9=0)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ