x86: Adjust asm constraints in atomic64 wrappers
authorJan Beulich <JBeulich@suse.com>
Fri, 20 Jan 2012 16:21:41 +0000 (16:21 +0000)
committerH. Peter Anvin <hpa@linux.intel.com>
Sat, 21 Jan 2012 01:29:31 +0000 (17:29 -0800)
commit819165fb34b9777f852429f2c6d6f79fbb71b9eb
tree0ac1aca39cbec9777e902b4393f09e5b0255d42f
parentdcd6c92267155e70a94b3927bce681ce74b80d1f
x86: Adjust asm constraints in atomic64 wrappers

Eric pointed out overly restrictive constraints in atomic64_set(), but
there are issues throughout the file. In the cited case, %ebx and %ecx
are inputs only (don't get changed by either of the two low level
implementations). This was also the case elsewhere.

Further in many cases early-clobber indicators were missing.

Finally, the previous implementation rolled a custom alternative
instruction macro from scratch, rather than using alternative_call()
(which was introduced with the commit that the description of the
change in question actually refers to). Adjusting has the benefit of
not hiding referenced symbols from the compiler, which however requires
them to be declared not just in the exporting source file (which, as a
desirable side effect, in turn allows that exporting file to become a
real 5-line stub).

This patch does not eliminate the overly restrictive memory clobbers,
however: Doing so would occasionally make the compiler set up a second
register for accessing the memory object (to satisfy the added "m"
constraint), and it's not clear which of the two non-optimal
alternatives is better.

v2: Re-do the declaration and exporting of the internal symbols.

Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Link: http://lkml.kernel.org/r/4F19A2A5020000780006E0D9@nat28.tlf.novell.com
Cc: Luca Barbieri <luca@luca-barbieri.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
arch/x86/include/asm/alternative.h
arch/x86/include/asm/atomic64_32.h
arch/x86/lib/atomic64_32.c
This page took 0.025263 seconds and 5 git commands to generate.