Skip to content

Commit b3fb595

Browse files
author
florian
committed
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 ([email protected]). Fixes BZ #353680. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15702 a5019735-40e9-0310-863c-91ae7b9d1cf9
1 parent dd8c19c commit b3fb595

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ where XXXXXX is the bug number as listed below.
3535
353084 arm64 doesn't support sigpending system call
3636
353370 don't advertise RDRAND in cpuid for Core-i7-4910-like avx2 machine
3737
353398 WARNING: unhandled amd64-solaris syscall: 207
38+
353680 s390x: Crash with certain glibc versions due to non-implemented TBEGIN
3839

3940

4041

README.s390

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ Limitations
2222
- Some gcc versions use mvc to copy 4/8 byte values. This will affect
2323
certain debug messages. For example, memcheck will complain about
2424
4 one-byte reads/writes instead of just a single read/write.
25+
- The transactional-execution facility is not supported; it is masked
26+
off from HWCAP.
27+
- The vector facility is not supported; it is masked off from HWCAP.
2528

2629

2730
Hardware facilities

coregrind/m_initimg/initimg-linux.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,12 @@ Addr setup_client_stack( void* init_sp,
701701
in syswrap-arm-linux.c rather than to base this on
702702
conditional compilation. */
703703
}
704+
# elif defined(VGP_s390x_linux)
705+
{
706+
/* Advertise hardware features "below" TE only. TE and VXRS
707+
(and anything above) are not supported by Valgrind. */
708+
auxv->u.a_val &= VKI_HWCAP_S390_TE - 1;
709+
}
704710
# endif
705711
break;
706712
# if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)

include/vki/vki-s390x-linux.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,12 +800,15 @@ typedef struct
800800
#define VKI_PTRACE_POKEUSR_AREA 0x5001
801801

802802
//----------------------------------------------------------------------
803-
// From linux-2.6.16.60/include/asm-s390/elf.h
803+
// From linux-3.18/include/asm-s390/elf.h
804804
//----------------------------------------------------------------------
805805

806806
typedef vki_s390_fp_regs vki_elf_fpregset_t;
807807
typedef vki_s390_regs vki_elf_gregset_t;
808808

809+
#define VKI_HWCAP_S390_TE 1024
810+
#define VKI_HWCAP_S390_VXRS 2048
811+
809812

810813
//----------------------------------------------------------------------
811814
// From linux-2.6.16.60/include/asm-s390/ucontext.h

0 commit comments

Comments
 (0)