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:	Fri, 14 Jul 2006 10:28:26 -0700 (PDT)
From:	Linus Torvalds <torvalds@...l.org>
To:	Steven Rostedt <rostedt@...dmis.org>
cc:	Andrew Morton <akpm@...l.org>, Ingo Molnar <mingo@...e.hu>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] remove volatile from nmi.c



On Fri, 14 Jul 2006, Linus Torvalds wrote:
> 
> Now, there is a "reason" we'd want "endflag" to either be volatile, or 
> have the "set_wmb()", and that is that the code is incorrect in the first 
> place. 

Btw, and this may just be me, but I personally don't much like the 
"set_wmb()" macro. I think it should be removed.

I don't think we actually use it anywhere, and the thing is, it's not 
really useful. It is basically _always_ equivalent to

	var = value;
	smp_wmb();

except I think some architectures could _in_theory_ make the assignment be 
a "store with release consistency". The only architecture where that might 
make sense that I can think of is Itanium, and even there the ia64 
set_wmb() macro doesn't actually do that.

Yeah, the

	endflag = 1;
	smp_wmb();

is a bit longer, but is actually easier to understand, I think.

I suspect "set_wmb()" was added just from an incorrect sense of 
consistency with "set_mb()" (which I don't particularly like either, but 
at least that one makes a difference on a real platform, ie on x86 that 
"set_mb()" ends up being implemented as a single "xchg" instruction).

			Linus
-
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