Blame SOURCES/valgrind-3.11.0-s390-hwcap.patch

0ab3a1
On a zEC12 or z13, a glibc with lock elision enabled infers from HWCAP
0ab3a1
that the prerequisites for lock elision are met.  Then it may use TBEGIN
0ab3a1
and other transactional-execution instructions which are not implemented
0ab3a1
by Valgrind.  Likewise, the upcoming glibc 2.23 will exploit vector
0ab3a1
instructions if they are advertised by HWCAP; and those are currently
0ab3a1
not implemented by Valgrind either.  In general, the increased use of
0ab3a1
ifunc may lead to more such cases in the future.
0ab3a1
0ab3a1
This patch suppresses the advertising of those hardware features via
0ab3a1
HWCAP which are either not known to Valgrind or currently unsupported.
0ab3a1
0ab3a1
Patch by Andreas Arnez (arnez@linux.vnet.ibm.com).
0ab3a1
Fixes BZ #353680.
0ab3a1
0ab3a1
Modified: trunk/README.s390
0ab3a1
==============================================================================
0ab3a1
--- trunk/README.s390 (original)
0ab3a1
+++ trunk/README.s390 Mon Oct 12 21:35:56 2015
0ab3a1
@@ -22,6 +22,9 @@
0ab3a1
 - Some gcc versions use mvc to copy 4/8 byte values. This will affect
0ab3a1
   certain debug messages. For example, memcheck will complain about
0ab3a1
   4 one-byte reads/writes instead of just a single read/write.
0ab3a1
+- The transactional-execution facility is not supported; it is masked
0ab3a1
+  off from HWCAP.
0ab3a1
+- The vector facility is not supported; it is masked off from HWCAP.
0ab3a1
 
0ab3a1
 
0ab3a1
 Hardware facilities
0ab3a1
0ab3a1
Modified: trunk/coregrind/m_initimg/initimg-linux.c
0ab3a1
==============================================================================
0ab3a1
--- trunk/coregrind/m_initimg/initimg-linux.c (original)
0ab3a1
+++ trunk/coregrind/m_initimg/initimg-linux.c Mon Oct 12 21:35:56 2015
0ab3a1
@@ -701,6 +701,12 @@
0ab3a1
                  in syswrap-arm-linux.c rather than to base this on
0ab3a1
                  conditional compilation. */
0ab3a1
             }
0ab3a1
+#           elif defined(VGP_s390x_linux)
0ab3a1
+            {
0ab3a1
+               /* Advertise hardware features "below" TE only.  TE and VXRS
0ab3a1
+                  (and anything above) are not supported by Valgrind. */
0ab3a1
+               auxv->u.a_val &= VKI_HWCAP_S390_TE - 1;
0ab3a1
+            }
0ab3a1
 #           endif
0ab3a1
             break;
0ab3a1
 #        if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
0ab3a1
0ab3a1
Modified: trunk/include/vki/vki-s390x-linux.h
0ab3a1
==============================================================================
0ab3a1
--- trunk/include/vki/vki-s390x-linux.h (original)
0ab3a1
+++ trunk/include/vki/vki-s390x-linux.h Mon Oct 12 21:35:56 2015
0ab3a1
@@ -800,12 +800,15 @@
0ab3a1
 #define VKI_PTRACE_POKEUSR_AREA       0x5001
0ab3a1
 
0ab3a1
 //----------------------------------------------------------------------
0ab3a1
-// From linux-2.6.16.60/include/asm-s390/elf.h
0ab3a1
+// From linux-3.18/include/asm-s390/elf.h
0ab3a1
 //----------------------------------------------------------------------
0ab3a1
 
0ab3a1
 typedef vki_s390_fp_regs vki_elf_fpregset_t;
0ab3a1
 typedef vki_s390_regs vki_elf_gregset_t;
0ab3a1
 
0ab3a1
+#define VKI_HWCAP_S390_TE           1024
0ab3a1
+#define VKI_HWCAP_S390_VXRS         2048
0ab3a1
+
0ab3a1
 
0ab3a1
 //----------------------------------------------------------------------
0ab3a1
 // From linux-2.6.16.60/include/asm-s390/ucontext.h
0ab3a1
0ab3a1