* [Qemu-devel] [RFC PATCH] target/arm: Fix int128_make128 lo, hi order in paired_cmpxchg64_be
@ 2019-02-01 1:40 Catherine Ho
2019-02-11 16:11 ` Richard Henderson
0 siblings, 1 reply; 5+ messages in thread
From: Catherine Ho @ 2019-02-01 1:40 UTC (permalink / raw)
To: Richard Henderson, Emilio G. Cota, Peter Maydell
Cc: qemu-devel, qemu-arm, Catherine Ho
The lo,hi order is different from the comments. And in commit
1ec182c33379 ("target/arm: Convert to HAVE_CMPXCHG128"), it changes
the original code logic. So just restore the old code logic before this
commit:
do_paired_cmpxchg64_be():
cmpv = int128_make128(env->exclusive_high, env->exclusive_val);
newv = int128_make128(new_hi, new_lo);
Fixes: 1ec182c33379 ("target/arm: Convert to HAVE_CMPXCHG128")
Signed-off-by: Catherine Ho <catherine.hecx@gmail.com>
---
I didn't see any obvious real error case here, so set it as RFC
target/arm/helper-a64.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/arm/helper-a64.c b/target/arm/helper-a64.c
index 101fa6d3ea..70850e564d 100644
--- a/target/arm/helper-a64.c
+++ b/target/arm/helper-a64.c
@@ -583,8 +583,8 @@ uint64_t HELPER(paired_cmpxchg64_be)(CPUARMState *env, uint64_t addr,
* High and low need to be switched here because this is not actually a
* 128bit store but two doublewords stored consecutively
*/
- Int128 cmpv = int128_make128(env->exclusive_val, env->exclusive_high);
- Int128 newv = int128_make128(new_lo, new_hi);
+ Int128 cmpv = int128_make128(env->exclusive_high, env->exclusive_val);
+ Int128 newv = int128_make128(new_hi, new_lo);
Int128 oldv;
uintptr_t ra = GETPC();
uint64_t o0, o1;
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [RFC PATCH] target/arm: Fix int128_make128 lo, hi order in paired_cmpxchg64_be
2019-02-01 1:40 [Qemu-devel] [RFC PATCH] target/arm: Fix int128_make128 lo, hi order in paired_cmpxchg64_be Catherine Ho
@ 2019-02-11 16:11 ` Richard Henderson
2019-02-11 16:19 ` Peter Maydell
0 siblings, 1 reply; 5+ messages in thread
From: Richard Henderson @ 2019-02-11 16:11 UTC (permalink / raw)
To: Catherine Ho, Emilio G. Cota, Peter Maydell; +Cc: qemu-devel, qemu-arm
On 1/31/19 5:40 PM, Catherine Ho wrote:
> The lo,hi order is different from the comments. And in commit
> 1ec182c33379 ("target/arm: Convert to HAVE_CMPXCHG128"), it changes
> the original code logic. So just restore the old code logic before this
> commit:
> do_paired_cmpxchg64_be():
> cmpv = int128_make128(env->exclusive_high, env->exclusive_val);
> newv = int128_make128(new_hi, new_lo);
>
> Fixes: 1ec182c33379 ("target/arm: Convert to HAVE_CMPXCHG128")
>
> Signed-off-by: Catherine Ho <catherine.hecx@gmail.com>
> ---
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [RFC PATCH] target/arm: Fix int128_make128 lo, hi order in paired_cmpxchg64_be
2019-02-11 16:11 ` Richard Henderson
@ 2019-02-11 16:19 ` Peter Maydell
2019-02-11 16:49 ` Richard Henderson
0 siblings, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2019-02-11 16:19 UTC (permalink / raw)
To: Richard Henderson; +Cc: Catherine Ho, Emilio G. Cota, QEMU Developers, qemu-arm
On Mon, 11 Feb 2019 at 16:11, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> On 1/31/19 5:40 PM, Catherine Ho wrote:
> > The lo,hi order is different from the comments. And in commit
> > 1ec182c33379 ("target/arm: Convert to HAVE_CMPXCHG128"), it changes
> > the original code logic. So just restore the old code logic before this
> > commit:
> > do_paired_cmpxchg64_be():
> > cmpv = int128_make128(env->exclusive_high, env->exclusive_val);
> > newv = int128_make128(new_hi, new_lo);
> >
> > Fixes: 1ec182c33379 ("target/arm: Convert to HAVE_CMPXCHG128")
> >
> > Signed-off-by: Catherine Ho <catherine.hecx@gmail.com>
> > ---
>
>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Thanks. Richard: is this effectively a bugfix for big-endian guest code ?
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [RFC PATCH] target/arm: Fix int128_make128 lo, hi order in paired_cmpxchg64_be
2019-02-11 16:19 ` Peter Maydell
@ 2019-02-11 16:49 ` Richard Henderson
2019-02-14 13:04 ` Peter Maydell
0 siblings, 1 reply; 5+ messages in thread
From: Richard Henderson @ 2019-02-11 16:49 UTC (permalink / raw)
To: Peter Maydell; +Cc: Catherine Ho, Emilio G. Cota, QEMU Developers, qemu-arm
On 2/11/19 8:19 AM, Peter Maydell wrote:
> Thanks. Richard: is this effectively a bugfix for big-endian guest code ?
Yes.
r~
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [RFC PATCH] target/arm: Fix int128_make128 lo, hi order in paired_cmpxchg64_be
2019-02-11 16:49 ` Richard Henderson
@ 2019-02-14 13:04 ` Peter Maydell
0 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2019-02-14 13:04 UTC (permalink / raw)
To: Richard Henderson; +Cc: Catherine Ho, Emilio G. Cota, QEMU Developers, qemu-arm
On Mon, 11 Feb 2019 at 16:49, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> On 2/11/19 8:19 AM, Peter Maydell wrote:
> > Thanks. Richard: is this effectively a bugfix for big-endian guest code ?
>
> Yes.
Thanks, applied to target-arm.next; I've added a line to the commit
message to note that it only affects BE guests.
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-02-14 13:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-01 1:40 [Qemu-devel] [RFC PATCH] target/arm: Fix int128_make128 lo, hi order in paired_cmpxchg64_be Catherine Ho
2019-02-11 16:11 ` Richard Henderson
2019-02-11 16:19 ` Peter Maydell
2019-02-11 16:49 ` Richard Henderson
2019-02-14 13:04 ` Peter Maydell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.