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]
Date:	Sat, 23 Nov 2013 09:17:19 -0800
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	linux-kernel@...r.kernel.org, mingo@...nel.org,
	laijs@...fujitsu.com, dipankar@...ibm.com,
	akpm@...ux-foundation.org, mathieu.desnoyers@...icios.com,
	josh@...htriplett.org, niv@...ibm.com, tglx@...utronix.de,
	rostedt@...dmis.org, dhowells@...hat.com, edumazet@...gle.com,
	darren@...art.com, fweisbec@...il.com, sbw@....edu
Subject: Re: [PATCH v2 RFC 1/3] documentation: Add needed ACCESS_ONCE() calls
 to memory-barriers.txt

On Sat, Nov 23, 2013 at 10:04:06AM +0100, Peter Zijlstra wrote:
> On Fri, Nov 22, 2013 at 10:13:13AM -0800, Paul E. McKenney wrote:
> > How about the following?
> > 
> > 							Thanx, Paul
> > 
> > ------------------------------------------------------------------------
> > 
> > COMPILER BARRIER
> > ----------------
> > 
> > The Linux kernel has an explicit compiler barrier function that prevents the
> > compiler from moving the memory accesses either side of it to the other side:
> > 
> >         barrier();
> > 
> > This is a general barrier -- there are no read-read or write-write variants
> > of barrier().  Howevever, ACCESS_ONCE() can be thought of as a weak form
> > for barrier() that affects only the specific accesses flagged by the
> > ACCESS_ONCE().
> > 
> > The compiler barrier has no direct effect on the CPU, which may then reorder
> > things however it wishes.
> > 
> 
> Seems ok, however this also seems like the natural spot to put that
> chunk about how a compiler can mis-transform stuff without either
> barrier or ACCESS_ONC(); that currently seems spread out over the
> document in some notes.
> 
> The biggest of which seems to have ended up in the GUARANTEES chapter.

Good point!  I believe that the spread-out stuff is still needed, so I
will add a summary of that information here, perhaps based in part on
Jon Corbet's ACCESS_ONCE() article (http://lwn.net/Articles/508991/).

Seem reasonable?

							Thanx, Paul

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ