From: Nikhil Rao Date: Thu, 29 Sep 2016 21:24:53 +0000 (+0530) Subject: eal/x86: fix atomic cmpset X-Git-Tag: spdx-start~1051 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9d1c2a6a912bebde1139157b950e39ffa7192c9d;p=dpdk.git eal/x86: fix atomic cmpset The original code used movl instead of xchgl, this caused rte_atomic64_cmpset to use ebx as the lower dword of the source to cmpxchg8b instead of the lower dword of function argument "src". Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Reported-by: Job Abraham Signed-off-by: Nikhil Rao Tested-by: Job Abraham Acked-by: Bruce Richardson --- diff --git a/lib/librte_eal/common/include/arch/x86/rte_atomic_32.h b/lib/librte_eal/common/include/arch/x86/rte_atomic_32.h index 2e04c7595f..fb3abf1879 100644 --- a/lib/librte_eal/common/include/arch/x86/rte_atomic_32.h +++ b/lib/librte_eal/common/include/arch/x86/rte_atomic_32.h @@ -81,7 +81,7 @@ rte_atomic64_cmpset(volatile uint64_t *dst, uint64_t exp, uint64_t src) : "memory" ); /* no-clobber list */ #else asm volatile ( - "mov %%ebx, %%edi\n" + "xchgl %%ebx, %%edi;\n" MPLOCKED "cmpxchg8b (%[dst]);" "setz %[res];"