Hello community,

here is the log from the commit of package valgrind for openSUSE:Factory 
checked in at 2016-04-12 18:59:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/valgrind (Old)
 and      /work/SRC/openSUSE:Factory/.valgrind.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "valgrind"

Changes:
--------
--- /work/SRC/openSUSE:Factory/valgrind/valgrind.changes        2016-02-25 
21:42:57.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.valgrind.new/valgrind.changes   2016-04-12 
18:59:46.000000000 +0200
@@ -1,0 +2,5 @@
+Fri Apr  1 10:37:37 UTC 2016 - dmuel...@suse.com
+
+- add r15702.diff, r15792.diff, vex-r3210.diff, r15802.diff (fate#319608)
+
+-------------------------------------------------------------------

New:
----
  r15702.diff
  r15792.diff
  r15802.diff
  vex-r3210.diff

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ valgrind.spec ++++++
--- /var/tmp/diff_new_pack.GKfPXF/_old  2016-04-12 18:59:47.000000000 +0200
+++ /var/tmp/diff_new_pack.GKfPXF/_new  2016-04-12 18:59:47.000000000 +0200
@@ -38,6 +38,10 @@
 Patch2:         armv6-support.diff
 Patch4:         gcc5.patch
 Patch5:         svn-r15766.patch
+Patch6:         r15702.diff
+Patch7:         r15792.diff
+Patch8:         r15802.diff
+Patch100:       vex-r3210.diff
 BuildRequires:  automake
 BuildRequires:  docbook-xsl-stylesheets
 BuildRequires:  docbook_4
@@ -114,6 +118,10 @@
 %patch2
 %patch4
 %patch5
+%patch6
+%patch7
+%patch8
+%patch100
 
 %build
 export FLAGS="%{optflags}"

++++++ r15702.diff ++++++
------------------------------------------------------------------------
r15702 | florian | 2015-10-12 22:35:56 +0200 (Mo, 12. Okt 2015) | 14 Zeilen

On a zEC12 or z13, a glibc with lock elision enabled infers from HWCAP
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 (ar...@linux.vnet.ibm.com).
Fixes BZ #353680.

------------------------------------------------------------------------
Index: include/vki/vki-s390x-linux.h
===================================================================
--- include/vki/vki-s390x-linux.h.orig
+++ include/vki/vki-s390x-linux.h
@@ -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
Index: coregrind/m_initimg/initimg-linux.c
===================================================================
--- coregrind/m_initimg/initimg-linux.c.orig
+++ coregrind/m_initimg/initimg-linux.c
@@ -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: README.s390
===================================================================
--- README.s390.orig
+++ README.s390
@@ -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
++++++ r15792.diff ++++++
------------------------------------------------------------------------
r15792 | florian | 2016-02-17 21:00:59 +0100 (Mi, 17. Feb 2016) | 4 Zeilen

s390: Fix BZ #359289, adding support for popcnt insn.
Companion patch is VEX r3210.
Patch by Andreas Arnez (ar...@linux.vnet.ibm.com).

------------------------------------------------------------------------
Index: tests/s390x_features.c
===================================================================
--- tests/s390x_features.c.orig
+++ tests/s390x_features.c
@@ -231,6 +231,8 @@ static int go(char *feature, char *cpu)
       match = facilities & FAC_BIT(42);
    } else if (strcmp(feature, "s390x-pfpo") == 0 ) {
       match = facilities & FAC_BIT(44);
+   } else if (strcmp(feature, "s390x-highw") == 0 ) {
+      match = facilities & FAC_BIT(45);
    } else {
       return 2;          // Unrecognised feature.
    }
Index: none/tests/s390x/popcnt.stderr.exp
===================================================================
--- /dev/null
+++ none/tests/s390x/popcnt.stderr.exp
@@ -0,0 +1,2 @@
+
+
Index: none/tests/s390x/Makefile.am
===================================================================
--- none/tests/s390x/Makefile.am.orig
+++ none/tests/s390x/Makefile.am
@@ -11,7 +11,7 @@ INSN_TESTS = clc clcle cvb cvd icm lpr t
              ex_sig ex_clone cu14 cu14_1 cu41 fpconv ecag fpext_warn \
              rounding-1 rounding-2 rounding-3 rounding-4 rounding-5 bfp-1 \
              bfp-2 bfp-3 bfp-4 srnm srnmb comp-1 comp-2 exrl tmll tm stmg \
-            ex clst mvc test_fork test_sig rounding-6 rxsbg\
+            ex clst mvc test_fork test_sig rounding-6 rxsbg popcnt \
             spechelper-alr spechelper-algr \
             spechelper-slr spechelper-slgr \
             spechelper-cr  spechelper-clr  \
Index: none/tests/s390x/opcodes.h
===================================================================
--- none/tests/s390x/opcodes.h.orig
+++ none/tests/s390x/opcodes.h
@@ -324,6 +324,7 @@
 #define OY(r1,x2,b2,dl2,dh2)            RXY_RRRD(e3,r1,x2,b2,dl2,dh2,56)
 #define PFD(r1,x2,b2,dl2,dh2)           RXY_URRD(e3,r1,x2,b2,dl2,dh2,36)
 #define PFDRL(r1,i2)                    RIL_UP(c6,r1,2,i2)
+#define POPCNT(r1,r2)                   RRE_RR(b9e1,00,r1,r2)
 #define RISBG(r1,r2,i3,i4,i5)           RIE_RRUUU(ec,r1,r2,i3,i4,i5,55)
 #define RNSBG(r1,r2,i3,i4,i5)           RIE_RRUUU(ec,r1,r2,i3,i4,i5,54)
 #define ROSBG(r1,r2,i3,i4,i5)           RIE_RRUUU(ec,r1,r2,i3,i4,i5,56)
Index: none/tests/s390x/popcnt.stdout.exp
===================================================================
--- /dev/null
+++ none/tests/s390x/popcnt.stdout.exp
@@ -0,0 +1,5 @@
+popcnt                0 ->                0      cc=0    
+popcnt                1 ->                1      cc=1    
+popcnt 8000000000000000 ->  100000000000000      cc=1    
+popcnt ffffffffffffffff ->  808080808080808      cc=1    
+popcnt ff427e3800556bcd ->  802060300040505      cc=1    
Index: none/tests/s390x/popcnt.vgtest
===================================================================
--- /dev/null
+++ none/tests/s390x/popcnt.vgtest
@@ -0,0 +1 @@
+prog: popcnt
Index: none/tests/s390x/popcnt.c
===================================================================
--- /dev/null
+++ none/tests/s390x/popcnt.c
@@ -0,0 +1,30 @@
+#include <stdio.h>
+#include <stdint.h>
+
+
+static void check_popcnt(uint64_t in, uint64_t expected_result,
+                         int expected_cc)
+{
+   uint64_t out = ~expected_result;
+   int cc = ~expected_cc;
+
+   asm volatile(".insn rre, 0xb9e10000, %[out], %[in]\n\t"
+                "ipm     %[cc]\n\t"
+                "srl     %[cc],28\n\t"
+                : [cc]"=d" (cc), [out]"=d" (out)
+                : [in]"d" (in)
+                : "cc");
+   printf("popcnt %16lx -> %16lx %s  cc=%d %s\n",
+          in, out, (out == expected_result ? "   " : "ERR"),
+          cc, (cc == expected_cc ? "   " : "ERR"));
+}
+
+int main()
+{
+   check_popcnt(0, 0, 0);
+   check_popcnt(1, 1, 1);
+   check_popcnt(0x8000000000000000ULL, 0x0100000000000000ULL, 1);
+   check_popcnt(0xffffffffffffffffULL, 0x0808080808080808ULL, 1);
+   check_popcnt(0xff427e3800556bcdULL, 0x0802060300040505ULL, 1);
+   return 0;
+}
++++++ r15802.diff ++++++
------------------------------------------------------------------------
r15802 | mjw | 2016-02-23 16:19:49 +0100 (Di, 23. Feb 2016) | 9 Zeilen

Bug 359703 s390: wire up separate socketcalls system calls

The linux 4.3 s390 kernel has separate system calls that were originally
hidden behind the socketcall multiplexer system call. Newer glibc versions
will use these direct system calls instead of socketcall when available.
Causing several regtest failures.

This fix simply wires up the split out system calls directly to the
existing syswrap handlers for s390.
------------------------------------------------------------------------
Index: include/vki/vki-scnums-s390x-linux.h
===================================================================
--- include/vki/vki-scnums-s390x-linux.h        (Revision 15801)
+++ include/vki/vki-scnums-s390x-linux.h        (Revision 15802)
@@ -316,7 +316,26 @@
 #define __NR_seccomp           348
 #define __NR_getrandom         349
 #define __NR_memfd_create      350
-#define NR_syscalls 351
+
+#define __NR_recvmmsg          357
+#define __NR_sendmmsg          358
+#define __NR_socket            359
+#define __NR_socketpair                360
+#define __NR_bind              361
+#define __NR_connect           362
+#define __NR_listen            363
+#define __NR_accept4           364
+#define __NR_getsockopt                365
+#define __NR_setsockopt                366
+#define __NR_getsockname       367
+#define __NR_getpeername       368
+#define __NR_sendto            369
+#define __NR_sendmsg           370
+#define __NR_recvfrom          371
+#define __NR_recvmsg           372
+#define __NR_shutdown          373
+
+#define NR_syscalls 374
 
 /* 
  * There are some system calls that are not present on 64 bit, some
Index: coregrind/m_syswrap/syswrap-s390x-linux.c
===================================================================
--- coregrind/m_syswrap/syswrap-s390x-linux.c   (Revision 15801)
+++ coregrind/m_syswrap/syswrap-s390x-linux.c   (Revision 15802)
@@ -1051,7 +1051,25 @@ static SyscallTableEntry syscall_table[]
 // ?????(__NR_seccomp, ),                                             // 348
    LINXY(__NR_getrandom, sys_getrandom),                              // 349
 
-   LINXY(__NR_memfd_create, sys_memfd_create)                         // 350
+   LINXY(__NR_memfd_create, sys_memfd_create),                        // 350
+
+   LINXY(__NR_recvmmsg, sys_recvmmsg),                                // 357
+   LINXY(__NR_sendmmsg, sys_sendmmsg),                                // 358
+   LINXY(__NR_socket, sys_socket),                                    // 359
+   LINXY(__NR_socketpair, sys_socketpair),                            // 360
+   LINX_(__NR_bind, sys_bind),                                        // 361
+   LINX_(__NR_connect, sys_connect),                                  // 362
+   LINX_(__NR_listen, sys_listen),                                    // 363
+   LINXY(__NR_accept4, sys_accept4),                                  // 364
+   LINXY(__NR_getsockopt, sys_getsockopt),                            // 365
+   LINX_(__NR_setsockopt, sys_setsockopt),                            // 366
+   LINXY(__NR_getsockname, sys_getsockname),                          // 367
+   LINXY(__NR_getpeername, sys_getpeername),                          // 368
+   LINX_(__NR_sendto, sys_sendto),                                    // 369
+   LINX_(__NR_sendmsg, sys_sendmsg),                                  // 270
+   LINXY(__NR_recvfrom, sys_recvfrom),                                // 371
+   LINXY(__NR_recvmsg, sys_recvmsg),                                  // 372
+   LINX_(__NR_shutdown, sys_shutdown)                                 // 373
 };
 
 SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
++++++ vex-r3210.diff ++++++
------------------------------------------------------------------------
r3210 | florian | 2016-02-17 20:57:01 +0100 (Mi, 17. Feb 2016) | 3 Zeilen

s390: Implement popcnt insn. Part of fixing BZ #359289.
Patch by Andreas Arnez (ar...@linux.vnet.ibm.com)

------------------------------------------------------------------------
Index: priv/guest_s390_toIR.c
===================================================================
--- VEX/priv/guest_s390_toIR.c  (Revision 3209)
+++ VEX/priv/guest_s390_toIR.c  (Revision 3210)
@@ -8,7 +8,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright IBM Corp. 2010-2015
+   Copyright IBM Corp. 2010-2016
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -12938,6 +12938,38 @@ s390_irgen_FLOGR(UChar r1, UChar r2)
 }
 
 static const HChar *
+s390_irgen_POPCNT(UChar r1, UChar r2)
+{
+   Int i;
+   IRTemp val = newTemp(Ity_I64);
+   IRTemp mask[3];
+
+   assign(val, get_gpr_dw0(r2));
+   for (i = 0; i < 3; i++) {
+      mask[i] = newTemp(Ity_I64);
+   }
+   assign(mask[0], mkU64(0x5555555555555555ULL));
+   assign(mask[1], mkU64(0x3333333333333333ULL));
+   assign(mask[2], mkU64(0x0F0F0F0F0F0F0F0FULL));
+   for (i = 0; i < 3; i++) {
+      IRTemp tmp = newTemp(Ity_I64);
+
+      assign(tmp,
+             binop(Iop_Add64,
+                   binop(Iop_And64,
+                         mkexpr(val),
+                         mkexpr(mask[i])),
+                   binop(Iop_And64,
+                         binop(Iop_Shr64, mkexpr(val), mkU8(1 << i)),
+                         mkexpr(mask[i]))));
+      val = tmp;
+   }
+   s390_cc_thunk_putZ(S390_CC_OP_BITWISE, val);
+   put_gpr_dw0(r1, mkexpr(val));
+   return "popcnt";
+}
+
+static const HChar *
 s390_irgen_STCK(IRTemp op2addr)
 {
    IRDirty *d;
@@ -14999,7 +15031,8 @@ s390_decode_4byte_and_irgen(const UChar
                                    ovl.fmt.RRE.r2);  goto ok;
    case 0xb9df: s390_format_RRE_RR(s390_irgen_CLHLR, ovl.fmt.RRE.r1,
                                    ovl.fmt.RRE.r2);  goto ok;
-   case 0xb9e1: /* POPCNT */ goto unimplemented;
+   case 0xb9e1: s390_format_RRE_RR(s390_irgen_POPCNT, ovl.fmt.RRE.r1,
+                                   ovl.fmt.RRE.r2);  goto ok;
    case 0xb9e2: s390_format_RRF_U0RR(s390_irgen_LOCGR, ovl.fmt.RRF3.r3,
                                      ovl.fmt.RRF3.r1, ovl.fmt.RRF3.r2,
                                      S390_XMNM_LOCGR);  goto ok;

Reply via email to