Skip to content

Commit 25cf4fb

Browse files
ubizjakPeter Zijlstra
authored andcommitted
locking/atomic/x86: Use ALT_OUTPUT_SP() for __arch_{,try_}cmpxchg64_emu()
x86_32 __arch_{,try_}cmpxchg64_emu()() macros use CALL instruction inside asm statement. Use ALT_OUTPUT_SP() macro to add required dependence on %esp register. Fixes: 79e1dd0 ("x86: Provide an alternative() based cmpxchg64()") Signed-off-by: Uros Bizjak <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 8b64db9 commit 25cf4fb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/x86/include/asm/cmpxchg_32.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static __always_inline bool __try_cmpxchg64_local(volatile u64 *ptr, u64 *oldp,
9494
asm volatile(ALTERNATIVE(_lock_loc \
9595
"call cmpxchg8b_emu", \
9696
_lock "cmpxchg8b %a[ptr]", X86_FEATURE_CX8) \
97-
: "+a" (o.low), "+d" (o.high) \
97+
: ALT_OUTPUT_SP("+a" (o.low), "+d" (o.high)) \
9898
: "b" (n.low), "c" (n.high), [ptr] "S" (_ptr) \
9999
: "memory"); \
100100
\
@@ -123,8 +123,8 @@ static __always_inline u64 arch_cmpxchg64_local(volatile u64 *ptr, u64 old, u64
123123
"call cmpxchg8b_emu", \
124124
_lock "cmpxchg8b %a[ptr]", X86_FEATURE_CX8) \
125125
CC_SET(e) \
126-
: CC_OUT(e) (ret), \
127-
"+a" (o.low), "+d" (o.high) \
126+
: ALT_OUTPUT_SP(CC_OUT(e) (ret), \
127+
"+a" (o.low), "+d" (o.high)) \
128128
: "b" (n.low), "c" (n.high), [ptr] "S" (_ptr) \
129129
: "memory"); \
130130
\

0 commit comments

Comments
 (0)