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:	Fri, 12 Sep 2014 09:30:55 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Andreea-Cristina Bernat <bernat.ada@...il.com>, paulus@...ba.org,
	mingo@...hat.com, acme@...nel.org, linux-kernel@...r.kernel.org,
	stephen@...workplumber.org, eric.dumazet@...il.com
Subject: Re: [PATCH] kernel: events: core: Replace rcu_assign_pointer() with
 RCU_INIT_POINTER()

On Wed, Sep 10, 2014 at 03:12:51PM +0200, Peter Zijlstra wrote:
> On Tue, Sep 09, 2014 at 09:16:48AM -0700, Paul E. McKenney wrote:
> > On Tue, Sep 09, 2014 at 11:42:35AM +0200, Peter Zijlstra wrote:
> 
> > > Paul, why not do something like the below and do away with all this
> > > nonsense?
> > 
> > We used to do that, but the compilers became uncooperative, despite
> > Stephen Hemminger's best efforts.
> 
> Happen to have a link handy to that thread so I can educate myself?

After a bit of software archeology, here you go...

Commit d322f45ceed52 (rcu: Make rcu_assign_pointer() unconditionally
insert a memory barrier) made this change.  According to the commit
log:

    Recent changes to gcc give warning messages on rcu_assign_pointers()'s
    checks that allow it to determine when it is OK to omit the memory
    barrier.  Stephen Hemminger tried a number of gcc tricks to silence
    this warning, but #pragmas and CPP macros do not work together in the
    way that would be required to make this work.

This was applied in 2011, and searching LKML during that time gives
the following:  https://lkml.org/lkml/2011/7/29/305

And in this LKML post, Stephen Hemminger wrote:

	Gcc now generates warnings from rcu_assign_pointer when passed the
	address of something for example:
		rcu_assign_pointer(dev_queue->qdisc, &noop_qdisc);
	This warning is harmless and should be surpressed but there maybe
	other cases where we want that Gcc warning.

	I tried various combinations of in rcu_assign_pointer macro
	  #pragma GCC diagnostic push
	  #pragma GCC diagnostic ignored "-Wlogical-op"
	  ...
	  #pragma GCC diagnostic pop
	but macro's and pragma's don't nest with the correct scope for
	this.

	Maybe some one with more Gcc foo and time to waste could take
	a crack at it.

Adding Stephen on CC in case he remembers more.

							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