From: Richard Henderson <richard.henderson@linaro.org>
To: Alistair Francis <alistair.francis@xilinx.com>,
qemu-devel@nongnu.org, peter.maydell@linaro.org
Cc: edgar.iglesias@xilinx.com, alistair23@gmail.com,
qemu-arm@nongnu.org, edgar.iglesias@gmail.com
Subject: Re: [Qemu-devel] [RFC v1 3/3] target/arm: Correct exclusive store return value
Date: Fri, 11 Aug 2017 12:46:24 -0700 [thread overview]
Message-ID: <de3609ba-241a-6df8-b5c3-30eb4535735e@linaro.org> (raw)
In-Reply-To: <2fbcf76e4ff63d8527edd3662342948276e2cd37.1502474835.git.alistair.francis@xilinx.com>
On 08/11/2017 11:19 AM, Alistair Francis wrote:
> The exclusive store operation should return 0 if the operation updates
> memory and 1 if it doesn't. This means that storing tmp in the rd
> register is incorrect.
I'm confused as to what you believe is wrong.
> tcg_gen_atomic_cmpxchg_i64(tmp, addr, val, tmp,
> get_mem_index(s),
> - size | MO_ALIGN | s->be_data);
> - tcg_gen_setcond_i64(TCG_COND_NE, tmp, tmp, val);
Yes, we load the result of the cmpxchg into tmp, but then we immediately
overwrite tmp with 0/1 depending on whether the operation succeeded.
>
> This patch updates the succesful opertion to store 0 into the rd
> register instead of tmp. It also adds a branch to fail if the memory
> isn't updated.
Since we use setcond, a branch is not required.
> + tcg_gen_ext_i64(val, val, memop);
What is this addition intended to accomplish? Because of the position within
the code, you know that memop contains MO_64, so that this is a no-op.
r~
next prev parent reply other threads:[~2017-08-11 19:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-11 18:19 [Qemu-devel] [RFC v1 0/3] Fixup exclusive store logic Alistair Francis
2017-08-11 18:19 ` [Qemu-devel] [RFC v1 1/3] target/arm: Update the memops for exclusive load Alistair Francis
2017-08-11 19:59 ` Richard Henderson
2017-08-11 18:19 ` [Qemu-devel] [RFC v1 2/3] tcg/tcg-op: Expose the tcg_gen_ext_i* functions Alistair Francis
2017-08-11 20:00 ` Richard Henderson
2017-08-11 18:19 ` [Qemu-devel] [RFC v1 3/3] target/arm: Correct exclusive store return value Alistair Francis
2017-08-11 19:46 ` Richard Henderson [this message]
2017-08-11 20:13 ` Alistair Francis
2017-08-11 20:24 ` Richard Henderson
2017-08-11 20:29 ` Alistair Francis
2017-08-11 20:38 ` Richard Henderson
2017-08-11 20:39 ` Alistair Francis
2017-08-11 20:53 ` Alistair Francis
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=de3609ba-241a-6df8-b5c3-30eb4535735e@linaro.org \
--to=richard.henderson@linaro.org \
--cc=alistair.francis@xilinx.com \
--cc=alistair23@gmail.com \
--cc=edgar.iglesias@gmail.com \
--cc=edgar.iglesias@xilinx.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.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).