Skip to content

Commit 1f49a2c

Browse files
Mathieu DesnoyersH. Peter Anvin
authored andcommitted
x86: revert replace LOCK_PREFIX in futex.h
Since we now use DS prefixes instead of NOP to remove LOCK prefixes, there are no longer any issues with instruction boundaries moving around. Depends on : x86 alternatives : fix LOCK_PREFIX race with preemptible kernel and CPU hotplug On Thu, 14 Aug 2008, Mathieu Desnoyers wrote: > > Changing the 0x90 (single-byte nop) currently used into a 0x3E DS segment > override prefix should fix this issue. Since the default of the atomic > instructions is to use the DS segment anyway, it should not affect the > behavior. Ok, so I think this is an _excellent_ patch, but I'd like to also then use LOCK_PREFIX in include/asm-x86/futex.h. See commit 9d55b99. Linus Applies to 2.6.27-rc2 (and -rc3 unless hell broke loose in futex.h between rc2 and rc3). Signed-off-by: Mathieu Desnoyers <[email protected]> CC: Linus Torvalds <[email protected]> CC: H. Peter Anvin <[email protected]> CC: Jeremy Fitzhardinge <[email protected]> CC: Roland McGrath <[email protected]> CC: Ingo Molnar <[email protected]> Cc: Steven Rostedt <[email protected]> CC: Steven Rostedt <[email protected]> CC: Thomas Gleixner <[email protected]> CC: Peter Zijlstra <[email protected]> CC: Andrew Morton <[email protected]> CC: David Miller <[email protected]> CC: Ulrich Drepper <[email protected]> CC: Rusty Russell <[email protected]> CC: Gregory Haskins <[email protected]> CC: Arnaldo Carvalho de Melo <[email protected]> CC: "Luis Claudio R. Goncalves" <[email protected]> CC: Clark Williams <[email protected]> CC: Christoph Lameter <[email protected]> CC: Andi Kleen <[email protected]> CC: Harvey Harrison <[email protected]> Signed-off-by: H. Peter Anvin <[email protected]>
1 parent f88f07e commit 1f49a2c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/asm-x86/futex.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
asm volatile("1:\tmovl %2, %0\n" \
2626
"\tmovl\t%0, %3\n" \
2727
"\t" insn "\n" \
28-
"2:\tlock; cmpxchgl %3, %2\n" \
28+
"2:\t" LOCK_PREFIX "cmpxchgl %3, %2\n" \
2929
"\tjnz\t1b\n" \
3030
"3:\t.section .fixup,\"ax\"\n" \
3131
"4:\tmov\t%5, %1\n" \
@@ -64,7 +64,7 @@ static inline int futex_atomic_op_inuser(int encoded_op, int __user *uaddr)
6464
__futex_atomic_op1("xchgl %0, %2", ret, oldval, uaddr, oparg);
6565
break;
6666
case FUTEX_OP_ADD:
67-
__futex_atomic_op1("lock; xaddl %0, %2", ret, oldval,
67+
__futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret, oldval,
6868
uaddr, oparg);
6969
break;
7070
case FUTEX_OP_OR:
@@ -122,7 +122,7 @@ static inline int futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval,
122122
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
123123
return -EFAULT;
124124

125-
asm volatile("1:\tlock; cmpxchgl %3, %1\n"
125+
asm volatile("1:\t" LOCK_PREFIX "cmpxchgl %3, %1\n"
126126
"2:\t.section .fixup, \"ax\"\n"
127127
"3:\tmov %2, %0\n"
128128
"\tjmp 2b\n"

0 commit comments

Comments
 (0)