]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Enable v8.1 atomics and fix SWP and LDUMAX instructions.
authorAssad Hashmi <assad.hashmi@linaro.org>
Fri, 15 May 2020 14:44:14 +0000 (16:44 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 15 May 2020 14:49:14 +0000 (16:49 +0200)
The atomics test drd/tests/std_mutex hangs on Arm v8.1 when built
with GCC10. Add HWCAP_ATOMICS to ARM64_SUPPORTED_HWCAP and fix the
ldumax and swp instructions to make it work.

https://bugs.kde.org/show_bug.cgi?id=421570

NEWS
VEX/priv/guest_arm64_toIR.c
coregrind/m_initimg/initimg-linux.c

diff --git a/NEWS b/NEWS
index 53908689a6fa321662d315c965abd0d4c564d4c6..3a2680550b9d276323c3f50da3fe592aa8037b2a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -161,6 +161,8 @@ where XXXXXX is the bug number as listed below.
 418435  s390x: spurious "Conditional jump or move depends on uninitialised [..]"
 418997  s390x: Support Iex_ITE for float and vector types
 419503  s390x: Avoid modifying registers returned from isel functions
+421321  gcc10 arm64 build needs __getauxval for linking with libgcc
+421570  std_mutex fails on Arm v8.1 h/w
 n-i-bz  Fix minor one time leaks in dhat.
 n-i-bz  Add --run-cxx-freeres=no in outer args to avoid inner crashes.
 n-i-bz  Add support for the Linux io_uring system calls
index ab68da13ddcbd6279ac29d7637ff632009b72193..c65bbbad218720a047027bd00b22d8e5d4869349 100644 (file)
@@ -6821,7 +6821,7 @@ Bool dis_ARM64_load_store(/*MB_OUT*/DisResult* dres, UInt insn,
             break;
          case 6:
             nm = "ldumax";
-            res = IRExpr_ITE(binop(Iop_CmpLT64U, lhs, rhs), rhs, rhs);
+            res = IRExpr_ITE(binop(Iop_CmpLT64U, lhs, rhs), rhs, lhs);
             break;
          case 7:
             nm = "ldumin";
@@ -6829,7 +6829,7 @@ Bool dis_ARM64_load_store(/*MB_OUT*/DisResult* dres, UInt insn,
             break;
          case 8:
             nm = "swp";
-            res = lhs;
+            res = rhs;
             break;
          default:
             vassert(0);
index 0b44f825d87247a636f3a6d993db43d873cec6af..bab8aeca0f9f3c3ec1328b410363964b5f33b12d 100644 (file)
@@ -705,7 +705,8 @@ Addr setup_client_stack( void*  init_sp,
             {
                /* Limit the AT_HWCAP to just those features we explicitly
                  support in VEX.  */
-#define ARM64_SUPPORTED_HWCAP (VKI_HWCAP_AES           \
+#define ARM64_SUPPORTED_HWCAP (VKI_HWCAP_ATOMICS        \
+                               | VKI_HWCAP_AES          \
                                | VKI_HWCAP_PMULL        \
                                | VKI_HWCAP_SHA1         \
                                | VKI_HWCAP_SHA2         \