Skip to content

Commit 8b64db9

Browse files
ubizjakPeter Zijlstra
authored andcommitted
locking/atomic/x86: Use ALT_OUTPUT_SP() for __alternative_atomic64()
CONFIG_X86_CMPXCHG64 variant of x86_32 __alternative_atomic64() macro uses CALL instruction inside asm statement. Use ALT_OUTPUT_SP() macro to add required dependence on %esp register. Fixes: 819165f ("x86: Adjust asm constraints in atomic64 wrappers") 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 36c2cf8 commit 8b64db9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/x86/include/asm/atomic64_32.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ static __always_inline s64 arch_atomic64_read_nonatomic(const atomic64_t *v)
5151
#ifdef CONFIG_X86_CMPXCHG64
5252
#define __alternative_atomic64(f, g, out, in...) \
5353
asm volatile("call %c[func]" \
54-
: out : [func] "i" (atomic64_##g##_cx8), ## in)
54+
: ALT_OUTPUT_SP(out) \
55+
: [func] "i" (atomic64_##g##_cx8), ## in)
5556

5657
#define ATOMIC64_DECL(sym) ATOMIC64_DECL_ONE(sym##_cx8)
5758
#else

0 commit comments

Comments
 (0)