From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>, qemu-arm <qemu-arm@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 8/9] target/arm: Implement CAS and CASP
Date: Thu, 3 May 2018 10:32:32 -0700 [thread overview]
Message-ID: <9cf54353-2e76-dcb0-04d7-b64c65d39b5f@linaro.org> (raw)
In-Reply-To: <CAFEAcA_ZaP8Wxe3P+5SKpmQxzJqOEQxnKcdh7StGytOi9iR0yg@mail.gmail.com>
On 05/03/2018 07:55 AM, Peter Maydell wrote:
>> + /* If compare equal, write back new data, else write back old data. */
>> + tcg_gen_movcond_i64(TCG_COND_NE, c1, c2, zero, t1, d1);
>> + tcg_gen_movcond_i64(TCG_COND_NE, c2, c2, zero, t2, d2);
>> + tcg_gen_qemu_st_i64(c1, addr, memidx, MO_64 | s->be_data);
>> + tcg_gen_qemu_st_i64(c2, a2, memidx, MO_64 | s->be_data);
>
> I think this has the wrong behaviour if you do a CASP-with-mismatched-value
> to read-only memory -- architecturally this should fail the comparison
> and return the memory value in registers, it's not allowed to do a
> memory write and take a data abort because the memory isn't writable.
If this is true, then we cannot use the x86 cmpxchg insn in the parallel case
either. We will also have already raised an exception for a non-writable page;
that happens generically within ATOMIC_MMU_LOOKUP. It is also how we implement
non-parallel cmpxchg in tcg-op.c.
I guess I was trying to read in some wiggle room in the clearing of exclusive
monitors and such.
I really don't see another way. What do you want to do?
r~
next prev parent reply other threads:[~2018-05-03 17:32 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-27 0:26 [Qemu-devel] [PATCH 0/9] target/arm: Implement v8.1-Atomics Richard Henderson
2018-04-27 0:26 ` [Qemu-devel] [PATCH 1/9] tcg: Introduce helpers for integer min/max Richard Henderson
2018-05-03 13:10 ` [Qemu-devel] [Qemu-arm] " Peter Maydell
2018-04-27 0:26 ` [Qemu-devel] [PATCH 2/9] target/arm: Use new min/max expanders Richard Henderson
2018-05-03 13:14 ` [Qemu-devel] [Qemu-arm] " Peter Maydell
2018-04-27 0:26 ` [Qemu-devel] [PATCH 3/9] target/xtensa: " Richard Henderson
2018-04-27 15:06 ` Max Filippov
2018-04-27 0:26 ` [Qemu-devel] [PATCH 4/9] tcg: Introduce atomic helpers for integer min/max Richard Henderson
2018-05-03 13:26 ` [Qemu-devel] [Qemu-arm] " Peter Maydell
2018-05-03 17:13 ` Richard Henderson
2018-05-03 17:26 ` Peter Maydell
2018-05-03 17:39 ` Richard Henderson
2018-05-03 18:19 ` Peter Maydell
2018-04-27 0:26 ` [Qemu-devel] [PATCH 5/9] target/riscv: Use new atomic min/max expanders Richard Henderson
2018-04-27 7:24 ` Michael Clark
2018-04-27 17:53 ` Richard Henderson
2018-04-29 23:03 ` Michael Clark
2018-04-27 0:26 ` [Qemu-devel] [PATCH 6/9] target/arm: Introduce ARM_FEATURE_V8_ATOMICS and initial decode Richard Henderson
2018-05-03 13:59 ` Peter Maydell
2018-05-03 14:26 ` Peter Maydell
2018-04-27 0:26 ` [Qemu-devel] [PATCH 7/9] target/arm: Fill in disas_ldst_atomic Richard Henderson
2018-05-03 14:14 ` [Qemu-devel] [Qemu-arm] " Peter Maydell
2018-05-03 17:18 ` Richard Henderson
2018-04-27 0:26 ` [Qemu-devel] [PATCH 8/9] target/arm: Implement CAS and CASP Richard Henderson
2018-05-03 14:55 ` Peter Maydell
2018-05-03 17:32 ` Richard Henderson [this message]
2018-05-04 16:06 ` Peter Maydell
2018-04-27 0:26 ` [Qemu-devel] [PATCH 9/9] target/arm: Enable ARM_FEATURE_V8_ATOMICS for user-only Richard Henderson
2018-05-03 14:26 ` [Qemu-devel] [Qemu-arm] " Peter Maydell
2018-04-27 0:53 ` [Qemu-devel] [PATCH 0/9] target/arm: Implement v8.1-Atomics no-reply
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=9cf54353-2e76-dcb0-04d7-b64c65d39b5f@linaro.org \
--to=richard.henderson@linaro.org \
--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).