DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nikhil Rao <nikhil.rao@intel.com>
To: dev@dpdk.org
Cc: Nikhil Rao <nikhil.rao@intel.com>
Subject: [dpdk-dev] [PATCH] eal: fix bug in x86 cmpset
Date: Fri, 30 Sep 2016 02:54:53 +0530	[thread overview]
Message-ID: <1475184293-18298-1-git-send-email-nikhil.rao@intel.com> (raw)

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

             reply	other threads:[~2016-09-29 12:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-29 21:24 Nikhil Rao [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1475184293-18298-1-git-send-email-nikhil.rao@intel.com \
    --to=nikhil.rao@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).