Skip to content

Commit

Permalink
x86: Fix atomic64_xxx_cx8() functions
Browse files Browse the repository at this point in the history
It appears about all functions in arch/x86/lib/atomic64_cx8_32.S
are wrong in case cmpxchg8b must be restarted, because
LOCK_PREFIX macro defines a label "1" clashing with other local
labels :

1:
	some_instructions
	LOCK_PREFIX
	cmpxchg8b (%ebp)
	jne 1b  / jumps to beginning of LOCK_PREFIX !

A possible fix is to use a magic label "672" in LOCK_PREFIX asm
definition, similar to the "671" one we defined in
LOCK_PREFIX_HERE.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Jan Beulich <JBeulich@suse.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/1325608540.2320.103.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Eric Dumazet authored and Ingo Molnar committed Jan 4, 2012
1 parent cdcd629 commit ceb7b40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/include/asm/alternative-asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

#ifdef CONFIG_SMP
.macro LOCK_PREFIX
1: lock
672: lock
.section .smp_locks,"a"
.balign 4
.long 1b - .
.long 672b - .
.previous
.endm
#else
Expand Down

0 comments on commit ceb7b40

Please sign in to comment.