x86/atomic: Improvements and simplifications to assembly constraints
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 21 Nov 2018 13:50:21 +0000 (13:50 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 12 Aug 2019 14:50:10 +0000 (15:50 +0100)
commit3214c0220f39d3615dd7e0d4d4336e778c0c0780
tree865055ffab84fab29b6fb11c180d75d79a96f83a
parent3fda2214f1a7ff972427812e50dc6f1f61cf594f
x86/atomic: Improvements and simplifications to assembly constraints

 * Constraints in the form "=r" (x) : "0" (x) can be folded to just "+r" (x)
 * Switch to using named parameters (mostly for legibility) which in
   particular helps with...
 * __xchg(), __cmpxchg() and __cmpxchg_user() modify their memory operand, so
   must list it as an output operand.  This only works because they each have
   a memory clobber to give the construct full compiler-barrier properties.
 * Every memory operand has an explicit known size.  Letting the compiler see
   the real size rather than obscuring it with __xg() allows for the removal
   of the instruction size suffixes without introducing ambiguity.
 * Drop semicolons after lock prefixes.
 * Other misc style changes.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/include/asm-x86/system.h
xen/include/asm-x86/x86_64/system.h