]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
On a zEC12 or z13, a glibc with lock elision enabled infers from HWCAP
authorFlorian Krohm <florian@eich-krohm.de>
Mon, 12 Oct 2015 20:35:56 +0000 (20:35 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Mon, 12 Oct 2015 20:35:56 +0000 (20:35 +0000)
that the prerequisites for lock elision are met.  Then it may use TBEGIN
and other transactional-execution instructions which are not implemented
by Valgrind.  Likewise, the upcoming glibc 2.23 will exploit vector
instructions if they are advertised by HWCAP; and those are currently
not implemented by Valgrind either.  In general, the increased use of
ifunc may lead to more such cases in the future.

This patch suppresses the advertising of those hardware features via
HWCAP which are either not known to Valgrind or currently unsupported.

Patch by Andreas Arnez (arnez@linux.vnet.ibm.com).
Fixes BZ #353680.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15702

NEWS
README.s390
coregrind/m_initimg/initimg-linux.c
include/vki/vki-s390x-linux.h

diff --git a/NEWS b/NEWS
index 394d3227185f083e6ceaeec3ea8c29d05278d42d..b48a1b73ef1b491cc159f98670acafe9ab82798b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -35,6 +35,7 @@ where XXXXXX is the bug number as listed below.
 353084  arm64 doesn't support sigpending system call
 353370  don't advertise RDRAND in cpuid for Core-i7-4910-like avx2 machine
 353398  WARNING: unhandled amd64-solaris syscall: 207
+353680  s390x: Crash with certain glibc versions due to non-implemented TBEGIN
 
 
 
index 5b3d3c08033e207b3930ebe63b4340cd74877a81..96dac1b66b9881d17e5ba474c8f72e4aefea1e34 100644 (file)
@@ -22,6 +22,9 @@ Limitations
 - Some gcc versions use mvc to copy 4/8 byte values. This will affect
   certain debug messages. For example, memcheck will complain about
   4 one-byte reads/writes instead of just a single read/write.
+- The transactional-execution facility is not supported; it is masked
+  off from HWCAP.
+- The vector facility is not supported; it is masked off from HWCAP.
 
 
 Hardware facilities
index c8b7080f597f301b4bf300b1b71bfb9b34570858..ce876152c2634e3ac81cfd290d8bc4acdac5c365 100644 (file)
@@ -701,6 +701,12 @@ Addr setup_client_stack( void*  init_sp,
                  in syswrap-arm-linux.c rather than to base this on
                  conditional compilation. */
             }
+#           elif defined(VGP_s390x_linux)
+            {
+               /* Advertise hardware features "below" TE only.  TE and VXRS
+                  (and anything above) are not supported by Valgrind. */
+               auxv->u.a_val &= VKI_HWCAP_S390_TE - 1;
+            }
 #           endif
             break;
 #        if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
index d8eebedfd5d3c432eb4244313d47c995f82175f9..c3f6d00478823f5e5873084209eeb546b4c62c52 100644 (file)
@@ -800,12 +800,15 @@ typedef struct
 #define VKI_PTRACE_POKEUSR_AREA       0x5001
 
 //----------------------------------------------------------------------
-// From linux-2.6.16.60/include/asm-s390/elf.h
+// From linux-3.18/include/asm-s390/elf.h
 //----------------------------------------------------------------------
 
 typedef vki_s390_fp_regs vki_elf_fpregset_t;
 typedef vki_s390_regs vki_elf_gregset_t;
 
+#define VKI_HWCAP_S390_TE           1024
+#define VKI_HWCAP_S390_VXRS         2048
+
 
 //----------------------------------------------------------------------
 // From linux-2.6.16.60/include/asm-s390/ucontext.h