From 9d1c2a6a912bebde1139157b950e39ffa7192c9d Mon Sep 17 00:00:00 2001 From: Nikhil Rao Date: Fri, 30 Sep 2016 02:54:53 +0530 Subject: [PATCH] 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 --- lib/librte_eal/common/include/arch/x86/rte_atomic_32.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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];" -- 2.20.1