DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal: fix bug in x86 cmpset
@ 2016-09-29 21:24 Nikhil Rao
  2016-09-29 13:05 ` Christian Ehrhardt
  2016-09-29 16:34 ` Thomas Monjalon
  0 siblings, 2 replies; 15+ messages in thread
From: Nikhil Rao @ 2016-09-29 21:24 UTC (permalink / raw)
  To: dev; +Cc: Nikhil Rao

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".

Reported-by: Job Abraham <job.abraham@intel.com>
Tested-by: Job Abraham <job.abraham@intel.com>
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
---
 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 2e04c75..fb3abf1 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.7.4

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-10-26 22:03 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-29 21:24 [dpdk-dev] [PATCH] eal: fix bug in x86 cmpset Nikhil Rao
2016-09-29 13:05 ` Christian Ehrhardt
2016-09-29 13:16   ` Rao, Nikhil
2016-09-29 14:21     ` Thomas Monjalon
2016-09-29 16:34 ` Thomas Monjalon
2016-11-06 21:09   ` Thomas Monjalon
2017-02-09 16:53     ` Thomas Monjalon
2017-02-10 10:39       ` Hunt, David
2017-02-10 10:53         ` Thomas Monjalon
2017-02-10 11:56           ` Hunt, David
2017-02-10 16:46           ` Stephen Hemminger
2017-03-09 15:39             ` Thomas Monjalon
2017-09-04 13:02           ` Bruce Richardson
2017-09-04 13:06             ` Bruce Richardson
2017-10-26 22:03             ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).