x86, asm: Clean up and simplify set_64bit()
commite77b85cec17e2fb07a362f7e189690f427b2ba8a
authorH. Peter Anvin <hpa@zytor.com>
Wed, 28 Jul 2010 06:29:52 +0000 (27 23:29 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 26 Aug 2010 23:43:39 +0000 (26 16:43 -0700)
treec3aecf454b9796051b7e3d99a92046f1759b525a
parent7ddb5ec3fdd06d769f58a4d68fa4c3f7de26f2fb
x86, asm: Clean up and simplify set_64bit()

commit 69309a05907546fb686b251d4ab041c26afe1e1d upstream.

Clean up and simplify set_64bit().  This code is quite old (1.3.11)
and contains a fair bit of auxilliary machinery that current versions
of gcc handle just fine automatically.  Worse, the auxilliary
machinery can actually cause an unnecessary spill to memory.

Furthermore, the loading of the old value inside the loop in the
32-bit case is unnecessary: if the value doesn't match, the CMPXCHG8B
instruction will already have loaded the "new previous" value for us.

Clean up the comment, too, and remove page references to obsolete
versions of the Intel SDM.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
LKML-Reference: <tip-*@vger.kernel.org>
Tested-by: Mark Stanovich <mrktimber@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/include/asm/cmpxchg_32.h
arch/x86/include/asm/cmpxchg_64.h