]> Git Repo - qemu.git/commitdiff
target/arm: Fix int128_make128 lo, hi order in paired_cmpxchg64_be
authorCatherine Ho <[email protected]>
Fri, 15 Feb 2019 09:56:38 +0000 (09:56 +0000)
committerPeter Maydell <[email protected]>
Fri, 15 Feb 2019 09:56:38 +0000 (09:56 +0000)
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);

This fixes a bug that would only be visible for big-endian
AArch64 guest code.

Fixes: 1ec182c33379 ("target/arm: Convert to HAVE_CMPXCHG128")
Signed-off-by: Catherine Ho <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-id: 1548985244[email protected]
[PMM: added note that bug only affects BE guests]
Signed-off-by: Peter Maydell <[email protected]>
target/arm/helper-a64.c

index 101fa6d3eaaef393b22ecbe2c6cac03e81a013ca..70850e564d38e8f769f7fd62bdbaa6fc95b7c069 100644 (file)
@@ -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;
This page took 0.026957 seconds and 4 git commands to generate.