3.17.0-0.1.RC1
This commit is contained in:
parent
aa2330f490
commit
3828df5e3f
1
.gitignore
vendored
1
.gitignore
vendored
@ -38,3 +38,4 @@
|
||||
/valgrind-3.16.0.RC2.tar.bz2
|
||||
/valgrind-3.16.0.tar.bz2
|
||||
/valgrind-3.16.1.tar.bz2
|
||||
/valgrind-3.17.0.RC1.tar.bz2
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (valgrind-3.16.1.tar.bz2) = 2a4173efe1b6facdd2f5c5ee8ed006704168eba1813736fccc8191d60363afd96197512cf42037e65f18d4ddd49adc74a54c47210df216fba3c46bf68ef0f950
|
||||
SHA512 (valgrind-3.17.0.RC1.tar.bz2) = ef71f3fca24466e78bd8a137666722f06cc5744cda5ae608b96d69390a72839e4d7499293872eb797e1c9edbe13ca6cf6147b6eb2491bb455d6696180f9864b7
|
||||
|
@ -1,117 +0,0 @@
|
||||
diff --git a/Makefile.all.am b/Makefile.all.am
|
||||
index 3786e34..1befef5 100644
|
||||
--- a/Makefile.all.am
|
||||
+++ b/Makefile.all.am
|
||||
@@ -50,20 +50,20 @@ inplace-noinst_DSYMS: build-noinst_DSYMS
|
||||
done
|
||||
|
||||
# This is used by coregrind/Makefile.am and by <tool>/Makefile.am for doing
|
||||
-# "make install". It copies $(noinst_PROGRAMS) into $prefix/lib/valgrind/.
|
||||
+# "make install". It copies $(noinst_PROGRAMS) into $prefix/libexec/valgrind/.
|
||||
# It needs to be depended on by an 'install-exec-local' rule.
|
||||
install-noinst_PROGRAMS: $(noinst_PROGRAMS)
|
||||
- $(mkinstalldirs) $(DESTDIR)$(pkglibdir); \
|
||||
+ $(mkinstalldirs) $(DESTDIR)$(pkglibexecdir); \
|
||||
for f in $(noinst_PROGRAMS); do \
|
||||
- $(INSTALL_PROGRAM) $$f $(DESTDIR)$(pkglibdir); \
|
||||
+ $(INSTALL_PROGRAM) $$f $(DESTDIR)$(pkglibexecdir); \
|
||||
done
|
||||
|
||||
# This is used by coregrind/Makefile.am and by <tool>/Makefile.am for doing
|
||||
-# "make uninstall". It removes $(noinst_PROGRAMS) from $prefix/lib/valgrind/.
|
||||
+# "make uninstall". It removes $(noinst_PROGRAMS) from $prefix/libexec/valgrind/.
|
||||
# It needs to be depended on by an 'uninstall-local' rule.
|
||||
uninstall-noinst_PROGRAMS:
|
||||
for f in $(noinst_PROGRAMS); do \
|
||||
- rm -f $(DESTDIR)$(pkglibdir)/$$f; \
|
||||
+ rm -f $(DESTDIR)$(pkglibexecdir)/$$f; \
|
||||
done
|
||||
|
||||
# Similar to install-noinst_PROGRAMS.
|
||||
@@ -71,15 +71,15 @@ uninstall-noinst_PROGRAMS:
|
||||
# directories. XXX: not sure whether the resulting permissions will be
|
||||
# correct when using 'cp -R'...
|
||||
install-noinst_DSYMS: build-noinst_DSYMS
|
||||
- $(mkinstalldirs) $(DESTDIR)$(pkglibdir); \
|
||||
+ $(mkinstalldirs) $(DESTDIR)$(pkglibexecdir); \
|
||||
for f in $(noinst_DSYMS); do \
|
||||
- cp -R $$f.dSYM $(DESTDIR)$(pkglibdir); \
|
||||
+ cp -R $$f.dSYM $(DESTDIR)$(pkglibexecdir); \
|
||||
done
|
||||
|
||||
# Similar to uninstall-noinst_PROGRAMS.
|
||||
uninstall-noinst_DSYMS:
|
||||
for f in $(noinst_DSYMS); do \
|
||||
- rm -f $(DESTDIR)$(pkglibdir)/$$f.dSYM; \
|
||||
+ rm -f $(DESTDIR)$(pkglibexecdir)/$$f.dSYM; \
|
||||
done
|
||||
|
||||
# This needs to be depended on by a 'clean-local' rule.
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 242b38a..3b7c806 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -58,7 +58,7 @@ DEFAULT_SUPP_FILES = @DEFAULT_SUPP@
|
||||
# default.supp, as it is built from the base .supp files at compile-time.
|
||||
dist_noinst_DATA = $(SUPP_FILES)
|
||||
|
||||
-vglibdir = $(pkglibdir)
|
||||
+vglibdir = $(pkglibexecdir)
|
||||
vglib_DATA = default.supp
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am
|
||||
index 94030fd..f09763a 100644
|
||||
--- a/coregrind/Makefile.am
|
||||
+++ b/coregrind/Makefile.am
|
||||
@@ -11,12 +11,12 @@ include $(top_srcdir)/Makefile.all.am
|
||||
|
||||
AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@ += \
|
||||
-I$(top_srcdir)/coregrind \
|
||||
- -DVG_LIBDIR="\"$(pkglibdir)"\" \
|
||||
+ -DVG_LIBDIR="\"$(pkglibexecdir)"\" \
|
||||
-DVG_PLATFORM="\"@VGCONF_ARCH_PRI@-@VGCONF_OS@\""
|
||||
if VGCONF_HAVE_PLATFORM_SEC
|
||||
AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@ += \
|
||||
-I$(top_srcdir)/coregrind \
|
||||
- -DVG_LIBDIR="\"$(pkglibdir)"\" \
|
||||
+ -DVG_LIBDIR="\"$(pkglibexecdir)"\" \
|
||||
-DVG_PLATFORM="\"@VGCONF_ARCH_SEC@-@VGCONF_OS@\""
|
||||
endif
|
||||
|
||||
@@ -714,7 +714,7 @@ GDBSERVER_XML_FILES = \
|
||||
m_gdbserver/mips64-fpu.xml
|
||||
|
||||
# so as to make sure these get copied into the install tree
|
||||
-vglibdir = $(pkglibdir)
|
||||
+vglibdir = $(pkglibexecdir)
|
||||
vglib_DATA = $(GDBSERVER_XML_FILES)
|
||||
|
||||
# so as to make sure these get copied into the tarball
|
||||
diff --git a/mpi/Makefile.am b/mpi/Makefile.am
|
||||
index 7ad9a25..471fee0 100644
|
||||
--- a/mpi/Makefile.am
|
||||
+++ b/mpi/Makefile.am
|
||||
@@ -18,16 +18,18 @@ EXTRA_DIST = \
|
||||
# libmpiwrap-<platform>.so
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
-noinst_PROGRAMS =
|
||||
+# These are really real libraries, so they should go to libdir, not libexec.
|
||||
+mpidir = $(pkglibdir)
|
||||
+mpi_PROGRAMS =
|
||||
if BUILD_MPIWRAP_PRI
|
||||
-noinst_PROGRAMS += libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so
|
||||
+mpi_PROGRAMS += libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so
|
||||
endif
|
||||
if BUILD_MPIWRAP_SEC
|
||||
-noinst_PROGRAMS += libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so
|
||||
+mpi_PROGRAMS += libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so
|
||||
endif
|
||||
|
||||
if VGCONF_OS_IS_DARWIN
|
||||
-noinst_DSYMS = $(noinst_PROGRAMS)
|
||||
+mpi_DSYMS = $(mpi_PROGRAMS)
|
||||
endif
|
||||
|
||||
|
@ -1,111 +0,0 @@
|
||||
commit 232893d9b3c7d79d018db7f303aee219161a86d0
|
||||
Author: Anssi Hannula <anssi.hannula@bitwise.fi>
|
||||
Date: Thu Jul 2 14:49:17 2020 +0300
|
||||
|
||||
Fix shmat() on Linux nanomips and x86
|
||||
|
||||
On Linux, there are two variants of the direct shmctl syscall:
|
||||
- sys_shmctl: always uses shmid64_ds, does not accept IPC_64
|
||||
- sys_old_shmctl: uses shmid_ds or shmid64_ds depending on IPC_64
|
||||
|
||||
The following Linux ABIs have the sys_old_shmctl variant:
|
||||
alpha, arm, microblaze, mips n32/n64, xtensa
|
||||
|
||||
Other ABIs (and future ABIs) have the sys_shmctl variant, including ABIs
|
||||
that only got sys_shmctl in Linux 5.1 (such as x86, mips o32, ppc,
|
||||
s390x).
|
||||
|
||||
We incorrectly assume the sys_old_shmctl variant on nanomips and x86,
|
||||
causing shmat() calls under valgrind to fail with EINVAL.
|
||||
|
||||
On x86, the issue was previously masked by the non-existence of
|
||||
__NR_shmctl until a9fc7bceeb0b0 ("Update Linux x86 system call number
|
||||
definitions") in 2019.
|
||||
|
||||
On mips o32, ppc, and s390x this issue is not visible as our headers do
|
||||
not have __NR_shmctl for those ABIs (396 since Linux 5.1).
|
||||
|
||||
Fix the issue by correcting the preprocessor check in get_shm_size() to
|
||||
only assume the old Linux sys_old_shmctl behavior on the specific
|
||||
affected platforms.
|
||||
|
||||
Also, exclude the use of direct shmctl entirely on Linux x86, ppc,
|
||||
mips o32, s390x in order to keep compatibility with pre-5.1 kernel
|
||||
versions that did not yet have direct shmctl for those ABIs.
|
||||
This currently only has actual effect on x86 as only it has __NR_shmctl
|
||||
in our headers.
|
||||
|
||||
Fixes tests mremap4, mremap5, mremap6.
|
||||
|
||||
https://bugs.kde.org/show_bug.cgi?id=410743
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c
|
||||
index badb8c778..7d4b385a3 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-generic.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-generic.c
|
||||
@@ -1960,11 +1960,27 @@ ML_(generic_POST_sys_semctl) ( ThreadId tid,
|
||||
static
|
||||
SizeT get_shm_size ( Int shmid )
|
||||
{
|
||||
-#if defined(__NR_shmctl)
|
||||
+ /*
|
||||
+ * The excluded platforms below gained direct shmctl in Linux 5.1. Keep
|
||||
+ * using ipc-multiplexed shmctl to keep compatibility with older kernel
|
||||
+ * versions.
|
||||
+ */
|
||||
+#if defined(__NR_shmctl) && \
|
||||
+ !defined(VGP_x86_linux) && !defined(VGP_mips32_linux) && \
|
||||
+ !defined(VGP_ppc32_linux) && !defined(VGP_ppc64be_linux) && \
|
||||
+ !defined(VGP_ppc64le_linux) && !defined(VGP_s390x_linux)
|
||||
# ifdef VKI_IPC_64
|
||||
struct vki_shmid64_ds buf;
|
||||
-# if defined(VGP_amd64_linux) || defined(VGP_arm64_linux)
|
||||
- /* See bug 222545 comment 7 */
|
||||
+ /*
|
||||
+ * On Linux, the following ABIs use old shmid_ds by default with direct
|
||||
+ * shmctl and require IPC_64 for shmid64_ds (i.e. the direct syscall is
|
||||
+ * mapped to sys_old_shmctl):
|
||||
+ * alpha, arm, microblaze, mips n32/n64, xtensa
|
||||
+ * Other Linux ABIs use shmid64_ds by default and do not recognize IPC_64
|
||||
+ * with the direct shmctl syscall (but still recognize it for the
|
||||
+ * ipc-multiplexed version if that exists for the ABI).
|
||||
+ */
|
||||
+# if defined(VGO_linux) && !defined(VGP_arm_linux) && !defined(VGP_mips64_linux)
|
||||
SysRes __res = VG_(do_syscall3)(__NR_shmctl, shmid,
|
||||
VKI_IPC_STAT, (UWord)&buf);
|
||||
# else
|
||||
commit 620dba22be67dea2ada9fa825b2ed4d61774af82
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Wed Feb 3 16:56:14 2021 +0100
|
||||
|
||||
syswrap-linux.c: Pass implicit VKI_IPC_64 for shmctl also on arm64.
|
||||
|
||||
The shmctl syscall on amd64, arm64 and riscv (but we don't have a port
|
||||
for that last one) always use IPC_64. Explicitly pass it to the generic
|
||||
PRE/POST handlers so they select the correct (64bit) data structures on
|
||||
those architectures.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1909548
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
|
||||
index 328e02a98..52074149d 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-linux.c
|
||||
@@ -5127,7 +5127,7 @@ PRE(sys_shmctl)
|
||||
PRINT("sys_shmctl ( %ld, %ld, %#" FMT_REGWORD "x )", SARG1, SARG2, ARG3);
|
||||
PRE_REG_READ3(long, "shmctl",
|
||||
int, shmid, int, cmd, struct shmid_ds *, buf);
|
||||
-#ifdef VGP_amd64_linux
|
||||
+#if defined(VGP_amd64_linux) || defined(VGP_arm64_linux)
|
||||
ML_(generic_PRE_sys_shmctl)(tid, ARG1,ARG2|VKI_IPC_64,ARG3);
|
||||
#else
|
||||
ML_(generic_PRE_sys_shmctl)(tid, ARG1,ARG2,ARG3);
|
||||
@@ -5136,7 +5136,7 @@ PRE(sys_shmctl)
|
||||
|
||||
POST(sys_shmctl)
|
||||
{
|
||||
-#ifdef VGP_amd64_linux
|
||||
+#if defined(VGP_amd64_linux) || defined(VGP_arm64_linux)
|
||||
ML_(generic_POST_sys_shmctl)(tid, RES,ARG1,ARG2|VKI_IPC_64,ARG3);
|
||||
#else
|
||||
ML_(generic_POST_sys_shmctl)(tid, RES,ARG1,ARG2,ARG3);
|
@ -52,8 +52,8 @@ diff --git a/configure.ac b/configure.ac
|
||||
index f8c798b..ccc8f52 100755
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -2188,24 +2188,24 @@ AC_LANG(C)
|
||||
AC_SUBST(FLAG_FALIGNED_NEW)
|
||||
@@ -2352,24 +2352,24 @@
|
||||
AM_CONDITIONAL([HAVE_ALIGNED_CXX_ALLOC], [test x$ac_have_aligned_cxx_alloc = xyes])
|
||||
|
||||
# does this compiler support -fno-stack-protector ?
|
||||
-AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])
|
||||
|
@ -1,34 +0,0 @@
|
||||
diff --git a/none/tests/ppc64/ldst_multiple.vgtest b/none/tests/ppc64/ldst_multiple.vgtest
|
||||
index 87e668e09..22dd46c99 100644
|
||||
--- a/none/tests/ppc64/ldst_multiple.vgtest
|
||||
+++ b/none/tests/ppc64/ldst_multiple.vgtest
|
||||
@@ -1 +1,2 @@
|
||||
+prereq: ../../../tests/is_ppc64_BE
|
||||
prog: ldst_multiple
|
||||
--- valgrind-3.16.1/none/tests/ppc64/Makefile.am.orig 2020-10-18 20:43:34.579699246 +0200
|
||||
+++ valgrind-3.16.1/none/tests/ppc64/Makefile.am 2020-10-18 20:44:52.950198040 +0200
|
||||
@@ -54,17 +54,22 @@
|
||||
|
||||
check_PROGRAMS = \
|
||||
allexec \
|
||||
- lsw jm-insns round \
|
||||
+ jm-insns round \
|
||||
test_isa_2_06_part1 test_isa_2_06_part2 test_isa_2_06_part3 \
|
||||
test_dfp1 test_dfp2 test_dfp3 test_dfp4 test_dfp5 \
|
||||
test_isa_2_07_part1 test_isa_2_07_part2 \
|
||||
test_isa_3_0 \
|
||||
subnormal_test \
|
||||
- test_tm test_touch_tm ldst_multiple data-cache-instructions \
|
||||
+ test_tm test_touch_tm data-cache-instructions \
|
||||
power6_mf_gpr std_reg_imm \
|
||||
twi_tdi tw_td power6_bcmp
|
||||
|
||||
|
||||
+# lsw and ldst_multiple compile (and run) only on big endian.
|
||||
+if VGCONF_PLATFORMS_INCLUDE_PPC64BE_LINUX
|
||||
+check_PROGRAMS += lsw ldst_multiple
|
||||
+endif
|
||||
+
|
||||
AM_CFLAGS += @FLAG_M64@
|
||||
AM_CXXFLAGS += @FLAG_M64@
|
||||
AM_CCASFLAGS += @FLAG_M64@
|
@ -1,38 +0,0 @@
|
||||
commit e2dec0ff9b1e071779bee2c4e6fc82f8194b1c1d
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Sun Jul 26 21:17:23 2020 +0200
|
||||
|
||||
Handle REX prefixed JMP instruction.
|
||||
|
||||
The NET Core runtime might generate a JMP with a REX prefix.
|
||||
For Jv (32bit offset) and Jb (8bit offset) this is valid.
|
||||
Prefixes that change operand size are ignored for such JMPs.
|
||||
So remove the check for sz == 4 and force sz = 4 for Jv.
|
||||
|
||||
https://bugs.kde.org/show_bug.cgi?id=422174
|
||||
|
||||
diff --git a/VEX/priv/guest_amd64_toIR.c b/VEX/priv/guest_amd64_toIR.c
|
||||
index fadf47d41..7888132eb 100644
|
||||
--- a/VEX/priv/guest_amd64_toIR.c
|
||||
+++ b/VEX/priv/guest_amd64_toIR.c
|
||||
@@ -21392,8 +21392,8 @@ Long dis_ESC_NONE (
|
||||
|
||||
case 0xE9: /* Jv (jump, 16/32 offset) */
|
||||
if (haveF3(pfx)) goto decode_failure;
|
||||
- if (sz != 4)
|
||||
- goto decode_failure; /* JRS added 2004 July 11 */
|
||||
+ sz = 4; /* Prefixes that change operand size are ignored for this
|
||||
+ instruction. Operand size is forced to 32bit. */
|
||||
if (haveF2(pfx)) DIP("bnd ; "); /* MPX bnd prefix. */
|
||||
d64 = (guest_RIP_bbstart+delta+sz) + getSDisp(sz,delta);
|
||||
delta += sz;
|
||||
@@ -21404,8 +21404,7 @@ Long dis_ESC_NONE (
|
||||
|
||||
case 0xEB: /* Jb (jump, byte offset) */
|
||||
if (haveF3(pfx)) goto decode_failure;
|
||||
- if (sz != 4)
|
||||
- goto decode_failure; /* JRS added 2004 July 11 */
|
||||
+ /* Prefixes that change operand size are ignored for this instruction. */
|
||||
if (haveF2(pfx)) DIP("bnd ; "); /* MPX bnd prefix. */
|
||||
d64 = (guest_RIP_bbstart+delta+1) + getSDisp8(delta);
|
||||
delta++;
|
@ -1,19 +0,0 @@
|
||||
commit 359b98828ced9cfff8c1badfed75c7ef999cfee5
|
||||
Author: Julian Seward <jseward@acm.org>
|
||||
Date: Sun Nov 15 18:28:09 2020 +0100
|
||||
|
||||
memcheck: on arm64, use expensive instrumentation for Cmp{EQ,NE}64 by default.
|
||||
|
||||
diff --git a/memcheck/mc_translate.c b/memcheck/mc_translate.c
|
||||
index b32c9c9c5..e91d51094 100644
|
||||
--- a/memcheck/mc_translate.c
|
||||
+++ b/memcheck/mc_translate.c
|
||||
@@ -8485,6 +8485,8 @@ IRSB* MC_(instrument) ( VgCallbackClosure* closure,
|
||||
# elif defined(VGA_ppc64le)
|
||||
// Needed by (at least) set_AV_CR6() in the front end.
|
||||
mce.dlbo.dl_CmpEQ64_CmpNE64 = DLexpensive;
|
||||
+# elif defined(VGA_arm64)
|
||||
+ mce.dlbo.dl_CmpEQ64_CmpNE64 = DLexpensive;
|
||||
# endif
|
||||
|
||||
/* preInstrumentationAnalysis() will allocate &mce.tmpHowUsed and then
|
@ -1,729 +0,0 @@
|
||||
From 04cdc29b007594a0e58ffef0c9dd87df3ea595ea Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Wed, 14 Oct 2020 06:11:34 -0400
|
||||
Subject: [PATCH] arm64 VEX frontend and backend support for
|
||||
Iop_M{Add,Sub}F{32,64}
|
||||
|
||||
The arm64 frontend used to implement the scalar fmadd, fmsub, fnmadd
|
||||
and fnmsub iinstructions into separate addition/substraction and
|
||||
multiplication instructions, which caused rounding issues.
|
||||
|
||||
This patch turns them into Iop_M{Add,Sub}F{32,64} instructions
|
||||
(with some arguments negated). And the backend now emits fmadd or fmsub
|
||||
instructions.
|
||||
|
||||
Alexandra Hajkova <ahajkova@redhat.com> added tests and fixed up the
|
||||
implementation to make sure rounding (and sign) are correct now.
|
||||
|
||||
https://bugs.kde.org/show_bug.cgi?id=426014
|
||||
---
|
||||
VEX/priv/guest_arm64_toIR.c | 58 ++++++++---
|
||||
VEX/priv/host_arm64_defs.c | 136 +++++++++++++++++++++++++-
|
||||
VEX/priv/host_arm64_defs.h | 30 ++++++
|
||||
VEX/priv/host_arm64_isel.c | 39 ++++++++
|
||||
none/tests/arm64/Makefile.am | 6 +-
|
||||
none/tests/arm64/fmadd_sub.c | 98 +++++++++++++++++++
|
||||
none/tests/arm64/fmadd_sub.stderr.exp | 0
|
||||
none/tests/arm64/fmadd_sub.stdout.exp | 125 +++++++++++++++++++++++
|
||||
none/tests/arm64/fmadd_sub.vgtest | 3 +
|
||||
9 files changed, 479 insertions(+), 16 deletions(-)
|
||||
create mode 100644 none/tests/arm64/fmadd_sub.c
|
||||
create mode 100644 none/tests/arm64/fmadd_sub.stderr.exp
|
||||
create mode 100644 none/tests/arm64/fmadd_sub.stdout.exp
|
||||
create mode 100644 none/tests/arm64/fmadd_sub.vgtest
|
||||
|
||||
diff --git a/VEX/priv/guest_arm64_toIR.c b/VEX/priv/guest_arm64_toIR.c
|
||||
index 556b85a6a..d242d43c0 100644
|
||||
--- a/VEX/priv/guest_arm64_toIR.c
|
||||
+++ b/VEX/priv/guest_arm64_toIR.c
|
||||
@@ -286,6 +286,12 @@ static IRExpr* triop ( IROp op, IRExpr* a1, IRExpr* a2, IRExpr* a3 )
|
||||
return IRExpr_Triop(op, a1, a2, a3);
|
||||
}
|
||||
|
||||
+static IRExpr* qop ( IROp op, IRExpr* a1, IRExpr* a2,
|
||||
+ IRExpr* a3, IRExpr* a4 )
|
||||
+{
|
||||
+ return IRExpr_Qop(op, a1, a2, a3, a4);
|
||||
+}
|
||||
+
|
||||
static IRExpr* loadLE ( IRType ty, IRExpr* addr )
|
||||
{
|
||||
return IRExpr_Load(Iend_LE, ty, addr);
|
||||
@@ -532,6 +538,22 @@ static IROp mkADDF ( IRType ty ) {
|
||||
}
|
||||
}
|
||||
|
||||
+static IROp mkFMADDF ( IRType ty ) {
|
||||
+ switch (ty) {
|
||||
+ case Ity_F32: return Iop_MAddF32;
|
||||
+ case Ity_F64: return Iop_MAddF64;
|
||||
+ default: vpanic("mkFMADDF");
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static IROp mkFMSUBF ( IRType ty ) {
|
||||
+ switch (ty) {
|
||||
+ case Ity_F32: return Iop_MSubF32;
|
||||
+ case Ity_F64: return Iop_MSubF64;
|
||||
+ default: vpanic("mkFMSUBF");
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static IROp mkSUBF ( IRType ty ) {
|
||||
switch (ty) {
|
||||
case Ity_F32: return Iop_SubF32;
|
||||
@@ -14368,30 +14390,40 @@ Bool dis_AdvSIMD_fp_data_proc_3_source(/*MB_OUT*/DisResult* dres, UInt insn)
|
||||
where Fx=Dx when sz=1, Fx=Sx when sz=0
|
||||
|
||||
-----SPEC------ ----IMPL----
|
||||
- fmadd a + n * m a + n * m
|
||||
- fmsub a + (-n) * m a - n * m
|
||||
- fnmadd (-a) + (-n) * m -(a + n * m)
|
||||
- fnmsub (-a) + n * m -(a - n * m)
|
||||
+ fmadd a + n * m fmadd (a, n, m)
|
||||
+ fmsub a + (-n) * m fmsub (a, n, m)
|
||||
+ fnmadd (-a) + (-n) * m fmadd (-a, -n, m)
|
||||
+ fnmsub (-a) + n * m fmadd (-a, n, m)
|
||||
+
|
||||
+ Note Iop_MAdd/SubF32/64 take arguments in the order: rm, N, M, A
|
||||
*/
|
||||
Bool isD = (ty & 1) == 1;
|
||||
UInt ix = (bitO1 << 1) | bitO0;
|
||||
IRType ity = isD ? Ity_F64 : Ity_F32;
|
||||
- IROp opADD = mkADDF(ity);
|
||||
- IROp opSUB = mkSUBF(ity);
|
||||
- IROp opMUL = mkMULF(ity);
|
||||
+ IROp opFMADD = mkFMADDF(ity);
|
||||
+ IROp opFMSUB = mkFMSUBF(ity);
|
||||
IROp opNEG = mkNEGF(ity);
|
||||
IRTemp res = newTemp(ity);
|
||||
IRExpr* eA = getQRegLO(aa, ity);
|
||||
IRExpr* eN = getQRegLO(nn, ity);
|
||||
IRExpr* eM = getQRegLO(mm, ity);
|
||||
IRExpr* rm = mkexpr(mk_get_IR_rounding_mode());
|
||||
- IRExpr* eNxM = triop(opMUL, rm, eN, eM);
|
||||
switch (ix) {
|
||||
- case 0: assign(res, triop(opADD, rm, eA, eNxM)); break;
|
||||
- case 1: assign(res, triop(opSUB, rm, eA, eNxM)); break;
|
||||
- case 2: assign(res, unop(opNEG, triop(opADD, rm, eA, eNxM))); break;
|
||||
- case 3: assign(res, unop(opNEG, triop(opSUB, rm, eA, eNxM))); break;
|
||||
- default: vassert(0);
|
||||
+ case 0: /* FMADD */
|
||||
+ assign(res, qop(opFMADD, rm, eN, eM, eA));
|
||||
+ break;
|
||||
+ case 1: /* FMSUB */
|
||||
+ assign(res, qop(opFMSUB, rm, eN, eM, eA));
|
||||
+ break;
|
||||
+ case 2: /* FNMADD */
|
||||
+ assign(res, qop(opFMADD, rm, unop(opNEG, eN), eM,
|
||||
+ unop(opNEG,eA)));
|
||||
+ break;
|
||||
+ case 3: /* FNMSUB */
|
||||
+ assign(res, qop(opFMADD, rm, eN, eM, unop(opNEG, eA)));
|
||||
+ break;
|
||||
+ default:
|
||||
+ vassert(0);
|
||||
}
|
||||
putQReg128(dd, mkV128(0x0000));
|
||||
putQRegLO(dd, mkexpr(res));
|
||||
diff --git a/VEX/priv/host_arm64_defs.c b/VEX/priv/host_arm64_defs.c
|
||||
index e4ef56986..13b497f60 100644
|
||||
--- a/VEX/priv/host_arm64_defs.c
|
||||
+++ b/VEX/priv/host_arm64_defs.c
|
||||
@@ -546,6 +546,14 @@ static const HChar* showARM64FpBinOp ( ARM64FpBinOp op ) {
|
||||
}
|
||||
}
|
||||
|
||||
+static const HChar* showARM64FpTriOp ( ARM64FpTriOp op ) {
|
||||
+ switch (op) {
|
||||
+ case ARM64fpt_FMADD: return "fmadd";
|
||||
+ case ARM64fpt_FMSUB: return "fmsub";
|
||||
+ default: vpanic("showARM64FpTriOp");
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static const HChar* showARM64FpUnaryOp ( ARM64FpUnaryOp op ) {
|
||||
switch (op) {
|
||||
case ARM64fpu_NEG: return "neg ";
|
||||
@@ -1154,6 +1162,28 @@ ARM64Instr* ARM64Instr_VBinS ( ARM64FpBinOp op,
|
||||
i->ARM64in.VBinS.argR = argR;
|
||||
return i;
|
||||
}
|
||||
+ARM64Instr* ARM64Instr_VTriD ( ARM64FpTriOp op,
|
||||
+ HReg dst, HReg arg1, HReg arg2, HReg arg3 ) {
|
||||
+ ARM64Instr* i = LibVEX_Alloc_inline(sizeof(ARM64Instr));
|
||||
+ i->tag = ARM64in_VTriD;
|
||||
+ i->ARM64in.VTriD.op = op;
|
||||
+ i->ARM64in.VTriD.dst = dst;
|
||||
+ i->ARM64in.VTriD.arg1 = arg1;
|
||||
+ i->ARM64in.VTriD.arg2 = arg2;
|
||||
+ i->ARM64in.VTriD.arg3 = arg3;
|
||||
+ return i;
|
||||
+}
|
||||
+ARM64Instr* ARM64Instr_VTriS ( ARM64FpTriOp op,
|
||||
+ HReg dst, HReg arg1, HReg arg2, HReg arg3 ) {
|
||||
+ ARM64Instr* i = LibVEX_Alloc_inline(sizeof(ARM64Instr));
|
||||
+ i->tag = ARM64in_VTriS;
|
||||
+ i->ARM64in.VTriS.op = op;
|
||||
+ i->ARM64in.VTriS.dst = dst;
|
||||
+ i->ARM64in.VTriS.arg1 = arg1;
|
||||
+ i->ARM64in.VTriS.arg2 = arg2;
|
||||
+ i->ARM64in.VTriS.arg3 = arg3;
|
||||
+ return i;
|
||||
+}
|
||||
ARM64Instr* ARM64Instr_VCmpD ( HReg argL, HReg argR ) {
|
||||
ARM64Instr* i = LibVEX_Alloc_inline(sizeof(ARM64Instr));
|
||||
i->tag = ARM64in_VCmpD;
|
||||
@@ -1756,6 +1786,26 @@ void ppARM64Instr ( const ARM64Instr* i ) {
|
||||
vex_printf(", ");
|
||||
ppHRegARM64asSreg(i->ARM64in.VBinS.argR);
|
||||
return;
|
||||
+ case ARM64in_VTriD:
|
||||
+ vex_printf("f%s ", showARM64FpTriOp(i->ARM64in.VTriD.op));
|
||||
+ ppHRegARM64(i->ARM64in.VTriD.dst);
|
||||
+ vex_printf(", ");
|
||||
+ ppHRegARM64(i->ARM64in.VTriD.arg1);
|
||||
+ vex_printf(", ");
|
||||
+ ppHRegARM64(i->ARM64in.VTriD.arg2);
|
||||
+ vex_printf(", ");
|
||||
+ ppHRegARM64(i->ARM64in.VTriD.arg3);
|
||||
+ return;
|
||||
+ case ARM64in_VTriS:
|
||||
+ vex_printf("f%s ", showARM64FpTriOp(i->ARM64in.VTriS.op));
|
||||
+ ppHRegARM64asSreg(i->ARM64in.VTriS.dst);
|
||||
+ vex_printf(", ");
|
||||
+ ppHRegARM64asSreg(i->ARM64in.VTriS.arg1);
|
||||
+ vex_printf(", ");
|
||||
+ ppHRegARM64asSreg(i->ARM64in.VTriS.arg2);
|
||||
+ vex_printf(", ");
|
||||
+ ppHRegARM64asSreg(i->ARM64in.VTriS.arg3);
|
||||
+ return;
|
||||
case ARM64in_VCmpD:
|
||||
vex_printf("fcmp ");
|
||||
ppHRegARM64(i->ARM64in.VCmpD.argL);
|
||||
@@ -2197,6 +2247,18 @@ void getRegUsage_ARM64Instr ( HRegUsage* u, const ARM64Instr* i, Bool mode64 )
|
||||
addHRegUse(u, HRmRead, i->ARM64in.VBinS.argL);
|
||||
addHRegUse(u, HRmRead, i->ARM64in.VBinS.argR);
|
||||
return;
|
||||
+ case ARM64in_VTriD:
|
||||
+ addHRegUse(u, HRmWrite, i->ARM64in.VTriD.dst);
|
||||
+ addHRegUse(u, HRmRead, i->ARM64in.VTriD.arg1);
|
||||
+ addHRegUse(u, HRmRead, i->ARM64in.VTriD.arg2);
|
||||
+ addHRegUse(u, HRmRead, i->ARM64in.VTriD.arg3);
|
||||
+ return;
|
||||
+ case ARM64in_VTriS:
|
||||
+ addHRegUse(u, HRmWrite, i->ARM64in.VTriS.dst);
|
||||
+ addHRegUse(u, HRmRead, i->ARM64in.VTriS.arg1);
|
||||
+ addHRegUse(u, HRmRead, i->ARM64in.VTriS.arg2);
|
||||
+ addHRegUse(u, HRmRead, i->ARM64in.VTriS.arg3);
|
||||
+ return;
|
||||
case ARM64in_VCmpD:
|
||||
addHRegUse(u, HRmRead, i->ARM64in.VCmpD.argL);
|
||||
addHRegUse(u, HRmRead, i->ARM64in.VCmpD.argR);
|
||||
@@ -2454,6 +2516,18 @@ void mapRegs_ARM64Instr ( HRegRemap* m, ARM64Instr* i, Bool mode64 )
|
||||
i->ARM64in.VBinS.argL = lookupHRegRemap(m, i->ARM64in.VBinS.argL);
|
||||
i->ARM64in.VBinS.argR = lookupHRegRemap(m, i->ARM64in.VBinS.argR);
|
||||
return;
|
||||
+ case ARM64in_VTriD:
|
||||
+ i->ARM64in.VTriD.dst = lookupHRegRemap(m, i->ARM64in.VTriD.dst);
|
||||
+ i->ARM64in.VTriD.arg1 = lookupHRegRemap(m, i->ARM64in.VTriD.arg1);
|
||||
+ i->ARM64in.VTriD.arg2 = lookupHRegRemap(m, i->ARM64in.VTriD.arg2);
|
||||
+ i->ARM64in.VTriD.arg3 = lookupHRegRemap(m, i->ARM64in.VTriD.arg3);
|
||||
+ return;
|
||||
+ case ARM64in_VTriS:
|
||||
+ i->ARM64in.VTriS.dst = lookupHRegRemap(m, i->ARM64in.VTriS.dst);
|
||||
+ i->ARM64in.VTriS.arg1 = lookupHRegRemap(m, i->ARM64in.VTriS.arg1);
|
||||
+ i->ARM64in.VTriS.arg2 = lookupHRegRemap(m, i->ARM64in.VTriS.arg2);
|
||||
+ i->ARM64in.VTriS.arg3 = lookupHRegRemap(m, i->ARM64in.VTriS.arg3);
|
||||
+ return;
|
||||
case ARM64in_VCmpD:
|
||||
i->ARM64in.VCmpD.argL = lookupHRegRemap(m, i->ARM64in.VCmpD.argL);
|
||||
i->ARM64in.VCmpD.argR = lookupHRegRemap(m, i->ARM64in.VCmpD.argR);
|
||||
@@ -2812,7 +2886,8 @@ static inline UInt qregEnc ( HReg r )
|
||||
#define X11110011 BITS8(1,1,1,1,0,0,1,1)
|
||||
#define X11110101 BITS8(1,1,1,1,0,1,0,1)
|
||||
#define X11110111 BITS8(1,1,1,1,0,1,1,1)
|
||||
-
|
||||
+#define X11111000 BITS8(1,1,1,1,1,0,0,0)
|
||||
+#define X11111010 BITS8(1,1,1,1,1,0,1,0)
|
||||
|
||||
/* --- 4 fields --- */
|
||||
|
||||
@@ -2972,6 +3047,27 @@ static inline UInt X_3_6_1_6_6_5_5 ( UInt f1, UInt f2, UInt f3,
|
||||
}
|
||||
|
||||
|
||||
+static inline UInt X_3_8_5_1_5_5_5 ( UInt f1, UInt f2, UInt f3, UInt f4,
|
||||
+ UInt f5, UInt f6, UInt f7 ) {
|
||||
+ vassert(3+8+5+1+5+5+5 == 32);
|
||||
+ vassert(f1 < (1<<3));
|
||||
+ vassert(f2 < (1<<8));
|
||||
+ vassert(f3 < (1<<5));
|
||||
+ vassert(f4 < (1<<1));
|
||||
+ vassert(f5 < (1<<5));
|
||||
+ vassert(f6 < (1<<5));
|
||||
+ vassert(f7 < (1<<5));
|
||||
+ UInt w = 0;
|
||||
+ w = (w << 3) | f1;
|
||||
+ w = (w << 8) | f2;
|
||||
+ w = (w << 5) | f3;
|
||||
+ w = (w << 1) | f4;
|
||||
+ w = (w << 5) | f5;
|
||||
+ w = (w << 5) | f6;
|
||||
+ w = (w << 5) | f7;
|
||||
+ return w;
|
||||
+}
|
||||
+
|
||||
//ZZ #define X0000 BITS4(0,0,0,0)
|
||||
//ZZ #define X0001 BITS4(0,0,0,1)
|
||||
//ZZ #define X0010 BITS4(0,0,1,0)
|
||||
@@ -4339,6 +4435,44 @@ Int emit_ARM64Instr ( /*MB_MOD*/Bool* is_profInc,
|
||||
= X_3_8_5_6_5_5(X000, X11110001, sM, (b1512 << 2) | X10, sN, sD);
|
||||
goto done;
|
||||
}
|
||||
+ case ARM64in_VTriD: {
|
||||
+ /* 31 20 15 14 9 4
|
||||
+ 000 11111 010 m 0 a n d FMADD Dd,Dn,Dm,Da
|
||||
+ ---------------- 1 ------ FMSUB -----------
|
||||
+ */
|
||||
+ UInt dD = dregEnc(i->ARM64in.VTriD.dst);
|
||||
+ UInt dN = dregEnc(i->ARM64in.VTriD.arg1);
|
||||
+ UInt dM = dregEnc(i->ARM64in.VTriD.arg2);
|
||||
+ UInt dA = dregEnc(i->ARM64in.VTriD.arg3);
|
||||
+ UInt b15 = 2; /* impossible */
|
||||
+ switch (i->ARM64in.VTriD.op) {
|
||||
+ case ARM64fpt_FMADD: b15 = 0; break;
|
||||
+ case ARM64fpt_FMSUB: b15 = 1; break;
|
||||
+ default: goto bad;
|
||||
+ }
|
||||
+ vassert(b15 < 2);
|
||||
+ *p++ = X_3_8_5_1_5_5_5(X000, X11111010, dM, b15, dA, dN, dD);
|
||||
+ goto done;
|
||||
+ }
|
||||
+ case ARM64in_VTriS: {
|
||||
+ /* 31 20 15 14 9 4
|
||||
+ 000 11111 000 m 0 a n d FMADD Dd,Dn,Dm,Da
|
||||
+ ---------------- 1 ------ FMSUB -----------
|
||||
+ */
|
||||
+ UInt dD = dregEnc(i->ARM64in.VTriD.dst);
|
||||
+ UInt dN = dregEnc(i->ARM64in.VTriD.arg1);
|
||||
+ UInt dM = dregEnc(i->ARM64in.VTriD.arg2);
|
||||
+ UInt dA = dregEnc(i->ARM64in.VTriD.arg3);
|
||||
+ UInt b15 = 2; /* impossible */
|
||||
+ switch (i->ARM64in.VTriD.op) {
|
||||
+ case ARM64fpt_FMADD: b15 = 0; break;
|
||||
+ case ARM64fpt_FMSUB: b15 = 1; break;
|
||||
+ default: goto bad;
|
||||
+ }
|
||||
+ vassert(b15 < 2);
|
||||
+ *p++ = X_3_8_5_1_5_5_5(X000, X11111000, dM, b15, dA, dN, dD);
|
||||
+ goto done;
|
||||
+ }
|
||||
case ARM64in_VCmpD: {
|
||||
/* 000 11110 01 1 m 00 1000 n 00 000 FCMP Dn, Dm */
|
||||
UInt dN = dregEnc(i->ARM64in.VCmpD.argL);
|
||||
diff --git a/VEX/priv/host_arm64_defs.h b/VEX/priv/host_arm64_defs.h
|
||||
index 05dba7ab8..5a82564ce 100644
|
||||
--- a/VEX/priv/host_arm64_defs.h
|
||||
+++ b/VEX/priv/host_arm64_defs.h
|
||||
@@ -289,6 +289,14 @@ typedef
|
||||
}
|
||||
ARM64FpBinOp;
|
||||
|
||||
+typedef
|
||||
+ enum {
|
||||
+ ARM64fpt_FMADD=105,
|
||||
+ ARM64fpt_FMSUB,
|
||||
+ ARM64fpt_INVALID
|
||||
+ }
|
||||
+ ARM64FpTriOp;
|
||||
+
|
||||
typedef
|
||||
enum {
|
||||
ARM64fpu_NEG=110,
|
||||
@@ -498,6 +506,8 @@ typedef
|
||||
ARM64in_VUnaryS,
|
||||
ARM64in_VBinD,
|
||||
ARM64in_VBinS,
|
||||
+ ARM64in_VTriD,
|
||||
+ ARM64in_VTriS,
|
||||
ARM64in_VCmpD,
|
||||
ARM64in_VCmpS,
|
||||
ARM64in_VFCSel,
|
||||
@@ -799,6 +809,22 @@ typedef
|
||||
HReg argL;
|
||||
HReg argR;
|
||||
} VBinS;
|
||||
+ /* 64-bit FP ternary arithmetic */
|
||||
+ struct {
|
||||
+ ARM64FpTriOp op;
|
||||
+ HReg dst;
|
||||
+ HReg arg1;
|
||||
+ HReg arg2;
|
||||
+ HReg arg3;
|
||||
+ } VTriD;
|
||||
+ /* 32-bit FP ternary arithmetic */
|
||||
+ struct {
|
||||
+ ARM64FpTriOp op;
|
||||
+ HReg dst;
|
||||
+ HReg arg1;
|
||||
+ HReg arg2;
|
||||
+ HReg arg3;
|
||||
+ } VTriS;
|
||||
/* 64-bit FP compare */
|
||||
struct {
|
||||
HReg argL;
|
||||
@@ -970,6 +996,10 @@ extern ARM64Instr* ARM64Instr_VUnaryD ( ARM64FpUnaryOp op, HReg dst, HReg src );
|
||||
extern ARM64Instr* ARM64Instr_VUnaryS ( ARM64FpUnaryOp op, HReg dst, HReg src );
|
||||
extern ARM64Instr* ARM64Instr_VBinD ( ARM64FpBinOp op, HReg, HReg, HReg );
|
||||
extern ARM64Instr* ARM64Instr_VBinS ( ARM64FpBinOp op, HReg, HReg, HReg );
|
||||
+extern ARM64Instr* ARM64Instr_VTriD ( ARM64FpTriOp op, HReg dst,
|
||||
+ HReg, HReg, HReg );
|
||||
+extern ARM64Instr* ARM64Instr_VTriS ( ARM64FpTriOp op, HReg dst,
|
||||
+ HReg, HReg, HReg );
|
||||
extern ARM64Instr* ARM64Instr_VCmpD ( HReg argL, HReg argR );
|
||||
extern ARM64Instr* ARM64Instr_VCmpS ( HReg argL, HReg argR );
|
||||
extern ARM64Instr* ARM64Instr_VFCSel ( HReg dst, HReg argL, HReg argR,
|
||||
diff --git a/VEX/priv/host_arm64_isel.c b/VEX/priv/host_arm64_isel.c
|
||||
index 2f19eab81..da1218715 100644
|
||||
--- a/VEX/priv/host_arm64_isel.c
|
||||
+++ b/VEX/priv/host_arm64_isel.c
|
||||
@@ -3255,6 +3255,25 @@ static HReg iselDblExpr_wrk ( ISelEnv* env, IRExpr* e )
|
||||
}
|
||||
}
|
||||
|
||||
+ if (e->tag == Iex_Qop) {
|
||||
+ IRQop* qop = e->Iex.Qop.details;
|
||||
+ ARM64FpTriOp triop = ARM64fpt_INVALID;
|
||||
+ switch (qop->op) {
|
||||
+ case Iop_MAddF64: triop = ARM64fpt_FMADD; break;
|
||||
+ case Iop_MSubF64: triop = ARM64fpt_FMSUB; break;
|
||||
+ default: break;
|
||||
+ }
|
||||
+ if (triop != ARM64fpt_INVALID) {
|
||||
+ HReg N = iselDblExpr(env, qop->arg2);
|
||||
+ HReg M = iselDblExpr(env, qop->arg3);
|
||||
+ HReg A = iselDblExpr(env, qop->arg4);
|
||||
+ HReg dst = newVRegD(env);
|
||||
+ set_FPCR_rounding_mode(env, qop->arg1);
|
||||
+ addInstr(env, ARM64Instr_VTriD(triop, dst, N, M, A));
|
||||
+ return dst;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (e->tag == Iex_ITE) {
|
||||
/* ITE(ccexpr, iftrue, iffalse) */
|
||||
ARM64CondCode cc;
|
||||
@@ -3450,6 +3469,26 @@ static HReg iselFltExpr_wrk ( ISelEnv* env, IRExpr* e )
|
||||
return dst;
|
||||
}
|
||||
|
||||
+ if (e->tag == Iex_Qop) {
|
||||
+ IRQop* qop = e->Iex.Qop.details;
|
||||
+ ARM64FpTriOp triop = ARM64fpt_INVALID;
|
||||
+ switch (qop->op) {
|
||||
+ case Iop_MAddF32: triop = ARM64fpt_FMADD; break;
|
||||
+ case Iop_MSubF32: triop = ARM64fpt_FMSUB; break;
|
||||
+ default: break;
|
||||
+ }
|
||||
+
|
||||
+ if (triop != ARM64fpt_INVALID) {
|
||||
+ HReg N = iselFltExpr(env, qop->arg2);
|
||||
+ HReg M = iselFltExpr(env, qop->arg3);
|
||||
+ HReg A = iselFltExpr(env, qop->arg4);
|
||||
+ HReg dst = newVRegD(env);
|
||||
+ set_FPCR_rounding_mode(env, qop->arg1);
|
||||
+ addInstr(env, ARM64Instr_VTriS(triop, dst, N, M, A));
|
||||
+ return dst;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
ppIRExpr(e);
|
||||
vpanic("iselFltExpr_wrk");
|
||||
}
|
||||
diff --git a/none/tests/arm64/Makefile.am b/none/tests/arm64/Makefile.am
|
||||
index 7b3ebbdca..4ecab36ad 100644
|
||||
--- a/none/tests/arm64/Makefile.am
|
||||
+++ b/none/tests/arm64/Makefile.am
|
||||
@@ -10,14 +10,16 @@ EXTRA_DIST = \
|
||||
integer.stdout.exp integer.stderr.exp integer.vgtest \
|
||||
memory.stdout.exp memory.stderr.exp memory.vgtest \
|
||||
atomics_v81.stdout.exp atomics_v81.stderr.exp atomics_v81.vgtest \
|
||||
- simd_v81.stdout.exp simd_v81.stderr.exp simd_v81.vgtest
|
||||
+ simd_v81.stdout.exp simd_v81.stderr.exp simd_v81.vgtest \
|
||||
+ fmadd_sub.stdout.exp fmadd_sub.stderr.exp fmadd_sub.vgtest
|
||||
|
||||
check_PROGRAMS = \
|
||||
allexec \
|
||||
cvtf_imm \
|
||||
fp_and_simd \
|
||||
integer \
|
||||
- memory
|
||||
+ memory \
|
||||
+ fmadd_sub
|
||||
|
||||
if BUILD_ARMV8_CRC_TESTS
|
||||
check_PROGRAMS += crc32
|
||||
diff --git a/none/tests/arm64/fmadd_sub.c b/none/tests/arm64/fmadd_sub.c
|
||||
new file mode 100644
|
||||
index 000000000..dcab22d1b
|
||||
--- /dev/null
|
||||
+++ b/none/tests/arm64/fmadd_sub.c
|
||||
@@ -0,0 +1,98 @@
|
||||
+#include <math.h>
|
||||
+#include <stdint.h>
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+#define COUNT 5
|
||||
+
|
||||
+static void
|
||||
+print_float(const char *ident, float x)
|
||||
+{
|
||||
+ union
|
||||
+ {
|
||||
+ float f;
|
||||
+ uint32_t i;
|
||||
+ } u;
|
||||
+
|
||||
+ u.f = x;
|
||||
+ printf("%s = %08x = %.17g\n", ident, u.i, x);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+print_double(const char *ident, double x)
|
||||
+{
|
||||
+ union
|
||||
+ {
|
||||
+ double f;
|
||||
+ uint64_t i;
|
||||
+ } u;
|
||||
+
|
||||
+ u.f = x;
|
||||
+ printf("%s = %016lx = %.17g\n", ident, u.i, x);
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main(int argc, char **argv)
|
||||
+{
|
||||
+ float x[] = { 55, 0.98076171874999996, 0, 1, 0xFFFFFFFF } ;
|
||||
+ float y[] = { 0.69314718055994529, 1.015625, 0, 1, 0xFFFFFFFF };
|
||||
+ float z[] = { 38.123094930796988, 1, 0, 1, 0xFFFFFFFF };
|
||||
+ float dst = -5;
|
||||
+
|
||||
+ double dx[] = { 55, 0.98076171874999996, 0, 1, 0xFFFFFFFF } ;
|
||||
+ double dy[] = { 0.69314718055994529, 1.015625, 0, 1, 0xFFFFFFFF };
|
||||
+ double dz[] = { 38.123094930796988, 1, 0, 1, 0xFFFFFFFF };
|
||||
+ double ddst= -5;
|
||||
+
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < COUNT; i++) {
|
||||
+ //32bit variant
|
||||
+ asm("fmadd %s0, %s1, %s2, %s3\n;" : "=w"(dst) : "w"(x[i]), "w"(y[i]), "w"(z[i]));
|
||||
+ printf("FMADD 32bit: dst = z + x * y\n");
|
||||
+ printf("%f = %f + %f * %f\n", dst, z[i], x[i], y[i]);
|
||||
+ print_float("dst", dst);
|
||||
+
|
||||
+ // Floating-point negated fused multiply-add
|
||||
+ asm("fnmadd %s0, %s1, %s2, %s3\n;" : "=w"(dst) : "w"(x[i]), "w"(y[i]), "w"(z[i]));
|
||||
+ printf("FNMADD 32bit: dst = -z + (-x) * y\n");
|
||||
+ printf("%f = -%f + (-%f) * %f\n", dst, z[i], x[i], y[i]);
|
||||
+ print_float("dst", dst);
|
||||
+
|
||||
+ asm("fmsub %s0, %s1, %s2, %s3\n;" : "=w"(dst) : "w"(x[i]), "w"(y[i]), "w"(z[i]));
|
||||
+ printf("FMSUB 32bit: dst = z + (-x) * y\n");
|
||||
+ printf("%f = %f + (-%f) * %f\n", dst, z[i], x[i], y[i]);
|
||||
+ print_float("dst", dst);
|
||||
+
|
||||
+ asm("fnmsub %s0, %s1, %s2, %s3\n;" : "=w"(dst) : "w"(x[i]), "w"(y[i]), "w"(z[i]));
|
||||
+ printf("FNMSUB 32bit: dst = -z + x * y\n");
|
||||
+ printf("%f = -%f + %f * %f\n", dst, z[i], x[i], y[i]);
|
||||
+ print_float("dst", dst);
|
||||
+
|
||||
+ //64bit variant
|
||||
+ asm("fmadd %d0, %d1, %d2, %d3\n;" : "=w"(ddst) : "w"(dx[i]), "w"(dy[i]), "w"(dz[i]));
|
||||
+ printf("FMADD 64bit: dst = z + x * y\n");
|
||||
+ printf("%f = %f + %f * %f\n", ddst, dz[i], dx[i], dy[i]);
|
||||
+ print_double("dst", ddst);
|
||||
+
|
||||
+ asm("fnmadd %d0, %d1, %d2, %d3\n;" : "=w"(ddst) : "w"(dx[i]), "w"(dy[i]), "w"(dz[i]));
|
||||
+ printf("FNMADD 64bit: dst = -z + (-x) * y\n");
|
||||
+ printf("%f = -%f - %f * %f\n", ddst, dz[i], dx[i], dy[i]);
|
||||
+ print_double("dst", ddst);
|
||||
+
|
||||
+ asm("fmsub %d0, %d1, %d2, %d3\n;" : "=w"(ddst) : "w"(dx[i]), "w"(dy[i]), "w"(dz[i]));
|
||||
+ printf("FMSUB 64bit: dst = z + (-x) * y\n");
|
||||
+ printf("%f = %f + (-%f) * %f\n", ddst, dz[i], dx[i], dy[i]);
|
||||
+ print_double("dst", ddst);
|
||||
+
|
||||
+ asm("fnmsub %d0, %d1, %d2, %d3\n;" : "=w"(ddst) : "w"(dx[i]), "w"(dy[i]), "w"(dz[i]));
|
||||
+ printf("FNMSUB 64bit: dst = -z + x * y\n");
|
||||
+ printf("%f = -%f + %f * %f\n", ddst, dz[i], dx[i], dy[i]);
|
||||
+ print_double("dst", ddst);
|
||||
+
|
||||
+ printf("\n");
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
diff --git a/none/tests/arm64/fmadd_sub.stderr.exp b/none/tests/arm64/fmadd_sub.stderr.exp
|
||||
new file mode 100644
|
||||
index 000000000..e69de29bb
|
||||
diff --git a/none/tests/arm64/fmadd_sub.stdout.exp b/none/tests/arm64/fmadd_sub.stdout.exp
|
||||
new file mode 100644
|
||||
index 000000000..f1824b12b
|
||||
--- /dev/null
|
||||
+++ b/none/tests/arm64/fmadd_sub.stdout.exp
|
||||
@@ -0,0 +1,125 @@
|
||||
+FMADD 32bit: dst = z + x * y
|
||||
+76.246193 = 38.123096 + 55.000000 * 0.693147
|
||||
+dst = 42987e0d = 76.246192932128906
|
||||
+FNMADD 32bit: dst = -z + (-x) * y
|
||||
+-76.246193 = -38.123096 + (-55.000000) * 0.693147
|
||||
+dst = c2987e0d = -76.246192932128906
|
||||
+FMSUB 32bit: dst = z + (-x) * y
|
||||
+0.000001 = 38.123096 + (-55.000000) * 0.693147
|
||||
+dst = 35c00000 = 1.430511474609375e-06
|
||||
+FNMSUB 32bit: dst = -z + x * y
|
||||
+-0.000001 = -38.123096 + 55.000000 * 0.693147
|
||||
+dst = b5c00000 = -1.430511474609375e-06
|
||||
+FMADD 64bit: dst = z + x * y
|
||||
+76.246190 = 38.123095 + 55.000000 * 0.693147
|
||||
+dst = 40530fc1931f09c9 = 76.246189861593976
|
||||
+FNMADD 64bit: dst = -z + (-x) * y
|
||||
+-76.246190 = -38.123095 - 55.000000 * 0.693147
|
||||
+dst = c0530fc1931f09c9 = -76.246189861593976
|
||||
+FMSUB 64bit: dst = z + (-x) * y
|
||||
+-0.000000 = 38.123095 + (-55.000000) * 0.693147
|
||||
+dst = bce9000000000000 = -2.7755575615628914e-15
|
||||
+FNMSUB 64bit: dst = -z + x * y
|
||||
+0.000000 = -38.123095 + 55.000000 * 0.693147
|
||||
+dst = 3ce9000000000000 = 2.7755575615628914e-15
|
||||
+
|
||||
+FMADD 32bit: dst = z + x * y
|
||||
+1.996086 = 1.000000 + 0.980762 * 1.015625
|
||||
+dst = 3fff7fc0 = 1.9960861206054688
|
||||
+FNMADD 32bit: dst = -z + (-x) * y
|
||||
+-1.996086 = -1.000000 + (-0.980762) * 1.015625
|
||||
+dst = bfff7fc0 = -1.9960861206054688
|
||||
+FMSUB 32bit: dst = z + (-x) * y
|
||||
+0.003914 = 1.000000 + (-0.980762) * 1.015625
|
||||
+dst = 3b80401a = 0.00391389150172472
|
||||
+FNMSUB 32bit: dst = -z + x * y
|
||||
+-0.003914 = -1.000000 + 0.980762 * 1.015625
|
||||
+dst = bb80401a = -0.00391389150172472
|
||||
+FMADD 64bit: dst = z + x * y
|
||||
+1.996086 = 1.000000 + 0.980762 * 1.015625
|
||||
+dst = 3fffeff800000000 = 1.9960861206054688
|
||||
+FNMADD 64bit: dst = -z + (-x) * y
|
||||
+-1.996086 = -1.000000 - 0.980762 * 1.015625
|
||||
+dst = bfffeff800000000 = -1.9960861206054688
|
||||
+FMSUB 64bit: dst = z + (-x) * y
|
||||
+0.003914 = 1.000000 + (-0.980762) * 1.015625
|
||||
+dst = 3f70080000000034 = 0.0039138793945312951
|
||||
+FNMSUB 64bit: dst = -z + x * y
|
||||
+-0.003914 = -1.000000 + 0.980762 * 1.015625
|
||||
+dst = bf70080000000034 = -0.0039138793945312951
|
||||
+
|
||||
+FMADD 32bit: dst = z + x * y
|
||||
+0.000000 = 0.000000 + 0.000000 * 0.000000
|
||||
+dst = 00000000 = 0
|
||||
+FNMADD 32bit: dst = -z + (-x) * y
|
||||
+-0.000000 = -0.000000 + (-0.000000) * 0.000000
|
||||
+dst = 80000000 = -0
|
||||
+FMSUB 32bit: dst = z + (-x) * y
|
||||
+0.000000 = 0.000000 + (-0.000000) * 0.000000
|
||||
+dst = 00000000 = 0
|
||||
+FNMSUB 32bit: dst = -z + x * y
|
||||
+0.000000 = -0.000000 + 0.000000 * 0.000000
|
||||
+dst = 00000000 = 0
|
||||
+FMADD 64bit: dst = z + x * y
|
||||
+0.000000 = 0.000000 + 0.000000 * 0.000000
|
||||
+dst = 0000000000000000 = 0
|
||||
+FNMADD 64bit: dst = -z + (-x) * y
|
||||
+-0.000000 = -0.000000 - 0.000000 * 0.000000
|
||||
+dst = 8000000000000000 = -0
|
||||
+FMSUB 64bit: dst = z + (-x) * y
|
||||
+0.000000 = 0.000000 + (-0.000000) * 0.000000
|
||||
+dst = 0000000000000000 = 0
|
||||
+FNMSUB 64bit: dst = -z + x * y
|
||||
+0.000000 = -0.000000 + 0.000000 * 0.000000
|
||||
+dst = 0000000000000000 = 0
|
||||
+
|
||||
+FMADD 32bit: dst = z + x * y
|
||||
+2.000000 = 1.000000 + 1.000000 * 1.000000
|
||||
+dst = 40000000 = 2
|
||||
+FNMADD 32bit: dst = -z + (-x) * y
|
||||
+-2.000000 = -1.000000 + (-1.000000) * 1.000000
|
||||
+dst = c0000000 = -2
|
||||
+FMSUB 32bit: dst = z + (-x) * y
|
||||
+0.000000 = 1.000000 + (-1.000000) * 1.000000
|
||||
+dst = 00000000 = 0
|
||||
+FNMSUB 32bit: dst = -z + x * y
|
||||
+0.000000 = -1.000000 + 1.000000 * 1.000000
|
||||
+dst = 00000000 = 0
|
||||
+FMADD 64bit: dst = z + x * y
|
||||
+2.000000 = 1.000000 + 1.000000 * 1.000000
|
||||
+dst = 4000000000000000 = 2
|
||||
+FNMADD 64bit: dst = -z + (-x) * y
|
||||
+-2.000000 = -1.000000 - 1.000000 * 1.000000
|
||||
+dst = c000000000000000 = -2
|
||||
+FMSUB 64bit: dst = z + (-x) * y
|
||||
+0.000000 = 1.000000 + (-1.000000) * 1.000000
|
||||
+dst = 0000000000000000 = 0
|
||||
+FNMSUB 64bit: dst = -z + x * y
|
||||
+0.000000 = -1.000000 + 1.000000 * 1.000000
|
||||
+dst = 0000000000000000 = 0
|
||||
+
|
||||
+FMADD 32bit: dst = z + x * y
|
||||
+18446744073709551616.000000 = 4294967296.000000 + 4294967296.000000 * 4294967296.000000
|
||||
+dst = 5f800000 = 1.8446744073709552e+19
|
||||
+FNMADD 32bit: dst = -z + (-x) * y
|
||||
+-18446744073709551616.000000 = -4294967296.000000 + (-4294967296.000000) * 4294967296.000000
|
||||
+dst = df800000 = -1.8446744073709552e+19
|
||||
+FMSUB 32bit: dst = z + (-x) * y
|
||||
+-18446744073709551616.000000 = 4294967296.000000 + (-4294967296.000000) * 4294967296.000000
|
||||
+dst = df800000 = -1.8446744073709552e+19
|
||||
+FNMSUB 32bit: dst = -z + x * y
|
||||
+18446744073709551616.000000 = -4294967296.000000 + 4294967296.000000 * 4294967296.000000
|
||||
+dst = 5f800000 = 1.8446744073709552e+19
|
||||
+FMADD 64bit: dst = z + x * y
|
||||
+18446744069414584320.000000 = 4294967295.000000 + 4294967295.000000 * 4294967295.000000
|
||||
+dst = 43efffffffe00000 = 1.8446744069414584e+19
|
||||
+FNMADD 64bit: dst = -z + (-x) * y
|
||||
+-18446744069414584320.000000 = -4294967295.000000 - 4294967295.000000 * 4294967295.000000
|
||||
+dst = c3efffffffe00000 = -1.8446744069414584e+19
|
||||
+FMSUB 64bit: dst = z + (-x) * y
|
||||
+-18446744060824649728.000000 = 4294967295.000000 + (-4294967295.000000) * 4294967295.000000
|
||||
+dst = c3efffffffa00000 = -1.844674406082465e+19
|
||||
+FNMSUB 64bit: dst = -z + x * y
|
||||
+18446744060824649728.000000 = -4294967295.000000 + 4294967295.000000 * 4294967295.000000
|
||||
+dst = 43efffffffa00000 = 1.844674406082465e+19
|
||||
+
|
||||
diff --git a/none/tests/arm64/fmadd_sub.vgtest b/none/tests/arm64/fmadd_sub.vgtest
|
||||
new file mode 100644
|
||||
index 000000000..b4c53eea4
|
||||
--- /dev/null
|
||||
+++ b/none/tests/arm64/fmadd_sub.vgtest
|
||||
@@ -0,0 +1,3 @@
|
||||
+prog: fmadd_sub
|
||||
+prereq: test -x fmadd_sub
|
||||
+vgopts: -q
|
||||
--
|
||||
2.18.4
|
||||
|
||||
diff --git a/VEX/priv/guest_generic_bb_to_IR.c b/VEX/priv/guest_generic_bb_to_IR.c
|
||||
index 0cee970e4..1e72ddacd 100644
|
||||
--- a/VEX/priv/guest_generic_bb_to_IR.c
|
||||
+++ b/VEX/priv/guest_generic_bb_to_IR.c
|
||||
@@ -422,6 +422,8 @@ static Bool expr_is_guardable ( const IRExpr* e )
|
||||
return !primopMightTrap(e->Iex.Binop.op);
|
||||
case Iex_Triop:
|
||||
return !primopMightTrap(e->Iex.Triop.details->op);
|
||||
+ case Iex_Qop:
|
||||
+ return !primopMightTrap(e->Iex.Qop.details->op);
|
||||
case Iex_ITE:
|
||||
case Iex_CCall:
|
||||
case Iex_Get:
|
@ -1,72 +0,0 @@
|
||||
diff --git a/coregrind/m_debuginfo/d3basics.c b/coregrind/m_debuginfo/d3basics.c
|
||||
index e1127ffe2..1bc5f8f05 100644
|
||||
--- a/coregrind/m_debuginfo/d3basics.c
|
||||
+++ b/coregrind/m_debuginfo/d3basics.c
|
||||
@@ -523,6 +523,7 @@ static Bool get_Dwarf_Reg( /*OUT*/Addr* a, Word regno, const RegSummary* regs )
|
||||
if (regno == 30) { *a = regs->fp; return True; }
|
||||
# elif defined(VGP_arm64_linux)
|
||||
if (regno == 31) { *a = regs->sp; return True; }
|
||||
+ if (regno == 29) { *a = regs->fp; return True; }
|
||||
# else
|
||||
# error "Unknown platform"
|
||||
# endif
|
||||
diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c
|
||||
index c4a5ea593..bc2578b37 100644
|
||||
--- a/coregrind/m_debuginfo/debuginfo.c
|
||||
+++ b/coregrind/m_debuginfo/debuginfo.c
|
||||
@@ -2874,7 +2874,9 @@ UWord evalCfiExpr ( const XArray* exprs, Int ix,
|
||||
# elif defined(VGA_ppc32) || defined(VGA_ppc64be) \
|
||||
|| defined(VGA_ppc64le)
|
||||
# elif defined(VGP_arm64_linux)
|
||||
+ case Creg_ARM64_SP: return eec->uregs->sp;
|
||||
case Creg_ARM64_X30: return eec->uregs->x30;
|
||||
+ case Creg_ARM64_X29: return eec->uregs->x29;
|
||||
# else
|
||||
# error "Unsupported arch"
|
||||
# endif
|
||||
diff --git a/coregrind/m_debuginfo/priv_storage.h b/coregrind/m_debuginfo/priv_storage.h
|
||||
index 39456eccb..ae44ca34e 100644
|
||||
--- a/coregrind/m_debuginfo/priv_storage.h
|
||||
+++ b/coregrind/m_debuginfo/priv_storage.h
|
||||
@@ -415,7 +415,9 @@ typedef
|
||||
Creg_ARM_R15,
|
||||
Creg_ARM_R14,
|
||||
Creg_ARM_R7,
|
||||
+ Creg_ARM64_SP,
|
||||
Creg_ARM64_X30,
|
||||
+ Creg_ARM64_X29,
|
||||
Creg_S390_IA,
|
||||
Creg_S390_SP,
|
||||
Creg_S390_FP,
|
||||
diff --git a/coregrind/m_debuginfo/readdwarf.c b/coregrind/m_debuginfo/readdwarf.c
|
||||
index 3996623ed..bcacca4cb 100644
|
||||
--- a/coregrind/m_debuginfo/readdwarf.c
|
||||
+++ b/coregrind/m_debuginfo/readdwarf.c
|
||||
@@ -2816,7 +2816,12 @@ static Int copy_convert_CfiExpr_tree ( XArray* dstxa,
|
||||
if (dwreg == srcuc->ra_reg)
|
||||
return ML_(CfiExpr_CfiReg)( dstxa, Creg_IA_IP );
|
||||
# elif defined(VGA_arm64)
|
||||
- I_die_here;
|
||||
+ if (dwreg == SP_REG)
|
||||
+ return ML_(CfiExpr_CfiReg)( dstxa, Creg_ARM64_SP );
|
||||
+ if (dwreg == FP_REG)
|
||||
+ return ML_(CfiExpr_CfiReg)( dstxa, Creg_ARM64_X29 );
|
||||
+ if (dwreg == srcuc->ra_reg)
|
||||
+ return ML_(CfiExpr_CfiReg)( dstxa, Creg_ARM64_X30 );
|
||||
# elif defined(VGA_ppc32) || defined(VGA_ppc64be) \
|
||||
|| defined(VGA_ppc64le)
|
||||
# else
|
||||
diff --git a/coregrind/m_debuginfo/storage.c b/coregrind/m_debuginfo/storage.c
|
||||
index 8667d123f..48a92b402 100644
|
||||
--- a/coregrind/m_debuginfo/storage.c
|
||||
+++ b/coregrind/m_debuginfo/storage.c
|
||||
@@ -1002,7 +1002,9 @@ static void ppCfiReg ( CfiReg reg )
|
||||
case Creg_ARM_R15: VG_(printf)("R15"); break;
|
||||
case Creg_ARM_R14: VG_(printf)("R14"); break;
|
||||
case Creg_ARM_R7: VG_(printf)("R7"); break;
|
||||
+ case Creg_ARM64_SP: VG_(printf)("SP"); break;
|
||||
case Creg_ARM64_X30: VG_(printf)("X30"); break;
|
||||
+ case Creg_ARM64_X29: VG_(printf)("X29"); break;
|
||||
case Creg_MIPS_RA: VG_(printf)("RA"); break;
|
||||
case Creg_S390_IA: VG_(printf)("IA"); break;
|
||||
case Creg_S390_SP: VG_(printf)("SP"); break;
|
@ -1,206 +0,0 @@
|
||||
commit f4abcc05fdba3f25890a9b30b71d511ccc906d46
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Mon Jul 27 22:43:28 2020 +0200
|
||||
|
||||
Incorrect call-graph tracking due to new _dl_runtime_resolve_xsave*
|
||||
|
||||
Newer glibc have alternate ld.so _ld_runtime_resolve functions.
|
||||
Namely _dl_runtime_resolve_xsave and _dl_runtime_resolve_xsave'2
|
||||
|
||||
This patch recognizes the xsave, xsvec and fxsave variants and
|
||||
changes callgrind so that any variant counts as _dl_runtime_resolve.
|
||||
|
||||
Original patch by paulo.cesar.pereira.de.andrade@gmail.com
|
||||
https://bugs.kde.org/show_bug.cgi?id=415293
|
||||
|
||||
diff --git a/callgrind/fn.c b/callgrind/fn.c
|
||||
index e9d8dd214..7cce1a0c7 100644
|
||||
--- a/callgrind/fn.c
|
||||
+++ b/callgrind/fn.c
|
||||
@@ -30,8 +30,11 @@
|
||||
|
||||
static fn_array current_fn_active;
|
||||
|
||||
-static Addr runtime_resolve_addr = 0;
|
||||
-static int runtime_resolve_length = 0;
|
||||
+/* x86_64 defines 4 variants. */
|
||||
+#define MAX_RESOLVE_ADDRS 4
|
||||
+static int runtime_resolve_addrs = 0;
|
||||
+static Addr runtime_resolve_addr[MAX_RESOLVE_ADDRS];
|
||||
+static int runtime_resolve_length[MAX_RESOLVE_ADDRS];
|
||||
|
||||
// a code pattern is a list of tuples (start offset, length)
|
||||
struct chunk_t { int start, len; };
|
||||
@@ -56,6 +59,9 @@ static Bool check_code(obj_node* obj,
|
||||
/* first chunk of pattern should always start at offset 0 and
|
||||
* have at least 3 bytes */
|
||||
CLG_ASSERT((pat->chunk[0].start == 0) && (pat->chunk[0].len >2));
|
||||
+
|
||||
+ /* and we cannot be called more than MAX_RESOLVE_ADDRS times */
|
||||
+ CLG_ASSERT(runtime_resolve_addrs < MAX_RESOLVE_ADDRS);
|
||||
|
||||
CLG_DEBUG(1, "check_code: %s, pattern %s, check %d bytes of [%x %x %x...]\n",
|
||||
obj->name, pat->name, pat->chunk[0].len, code[0], code[1], code[2]);
|
||||
@@ -93,8 +99,9 @@ static Bool check_code(obj_node* obj,
|
||||
pat->name, obj->name + obj->last_slash_pos,
|
||||
addr - obj->start, addr, pat->len);
|
||||
|
||||
- runtime_resolve_addr = addr;
|
||||
- runtime_resolve_length = pat->len;
|
||||
+ runtime_resolve_addr[runtime_resolve_addrs] = addr;
|
||||
+ runtime_resolve_length[runtime_resolve_addrs] = pat->len;
|
||||
+ runtime_resolve_addrs++;
|
||||
return True;
|
||||
}
|
||||
}
|
||||
@@ -138,8 +145,9 @@ static Bool search_runtime_resolve(obj_node* obj)
|
||||
"x86-glibc2.8", 30, {{ 0,12 }, { 16,14 }, { 30,0}} };
|
||||
|
||||
if (VG_(strncmp)(obj->name, "/lib/ld", 7) != 0) return False;
|
||||
- if (check_code(obj, code, &pat)) return True;
|
||||
- if (check_code(obj, code_28, &pat_28)) return True;
|
||||
+ Bool pat_p = check_code(obj, code, &pat);
|
||||
+ Bool pat_28_p = check_code(obj, code_28, &pat_28);
|
||||
+ if (pat_p || pat_28_p) return True;
|
||||
return False;
|
||||
#endif
|
||||
|
||||
@@ -186,9 +194,98 @@ static Bool search_runtime_resolve(obj_node* obj)
|
||||
static struct pattern pat = {
|
||||
"amd64-def", 110, {{ 0,62 }, { 66,44 }, { 110,0 }} };
|
||||
|
||||
+ static UChar code_xsavec[] = {
|
||||
+ /* 0*/ 0x53, 0x48, 0x89, 0xe3, 0x48, 0x83, 0xe4, 0xc0,
|
||||
+ /* 8*/ 0x48, 0x2b, 0x25, 0x00, 0x00, 0x00, 0x00, /* sub <i32>(%rip),%rsp */
|
||||
+ /*15*/ 0x48,
|
||||
+ /*16*/ 0x89, 0x04, 0x24, 0x48, 0x89, 0x4c, 0x24, 0x08,
|
||||
+ /*24*/ 0x48, 0x89, 0x54, 0x24, 0x10, 0x48, 0x89, 0x74,
|
||||
+ /*32*/ 0x24, 0x18, 0x48, 0x89, 0x7c, 0x24, 0x20, 0x4c,
|
||||
+ /*40*/ 0x89, 0x44, 0x24, 0x28, 0x4c, 0x89, 0x4c, 0x24,
|
||||
+ /*48*/ 0x30, 0xb8, 0xee, 0x00, 0x00, 0x00, 0x31, 0xd2,
|
||||
+ /*56*/ 0x48, 0x89, 0x94, 0x24, 0x50, 0x02, 0x00, 0x00,
|
||||
+ /*64*/ 0x48, 0x89, 0x94, 0x24, 0x58, 0x02, 0x00, 0x00,
|
||||
+ /*72*/ 0x48, 0x89, 0x94, 0x24, 0x60, 0x02, 0x00, 0x00,
|
||||
+ /*80*/ 0x48, 0x89, 0x94, 0x24, 0x68, 0x02, 0x00, 0x00,
|
||||
+ /*88*/ 0x48, 0x89, 0x94, 0x24, 0x70, 0x02, 0x00, 0x00,
|
||||
+ /*96*/ 0x48, 0x89, 0x94, 0x24, 0x78, 0x02, 0x00, 0x00,
|
||||
+ /*04*/ 0x0f, 0xc7, 0x64, 0x24, 0x40, 0x48, 0x8b, 0x73,
|
||||
+ /*112*/0x10, 0x48, 0x8b, 0x7b, 0x08,
|
||||
+ /*117*/0xe8, 0x00, 0x00, 0x00, 0x00, /* callq <_dl_fixup> */
|
||||
+ /*122*/0x49, 0x89, 0xc3, 0xb8, 0xee, 0x00,
|
||||
+ /*128*/0x00, 0x00, 0x31, 0xd2, 0x0f, 0xae, 0x6c, 0x24,
|
||||
+ /*136*/0x40, 0x4c, 0x8b, 0x4c, 0x24, 0x30, 0x4c, 0x8b,
|
||||
+ /*144*/0x44, 0x24, 0x28, 0x48, 0x8b, 0x7c, 0x24, 0x20,
|
||||
+ /*152*/0x48, 0x8b, 0x74, 0x24, 0x18, 0x48, 0x8b, 0x54,
|
||||
+ /*160*/0x24, 0x10, 0x48, 0x8b, 0x4c, 0x24, 0x08, 0x48,
|
||||
+ /*168*/0x8b, 0x04, 0x24, 0x48, 0x89, 0xdc, 0x48, 0x8b,
|
||||
+ /*176*/0x1c, 0x24, 0x48, 0x83, 0xc4, 0x18, 0xf2, 0x41,
|
||||
+ /*184*/0xff, 0xe3 };
|
||||
+ static struct pattern pat_xsavec = {
|
||||
+ "amd64-xsavec", 186, {{ 0,11 }, { 15,103 }, {122,64}, { 186,0 }} };
|
||||
+
|
||||
+ static UChar code_xsave[] = {
|
||||
+ /* 0*/ 0x53, 0x48, 0x89, 0xe3, 0x48, 0x83, 0xe4, 0xc0,
|
||||
+ /* 8*/ 0x48, 0x2b, 0x25, 0x00, 0x00, 0x00, 0x00, /* sub <i32>(%rip),%rsp */
|
||||
+ /*15*/ 0x48,
|
||||
+ /*16*/ 0x89, 0x04, 0x24, 0x48, 0x89, 0x4c, 0x24, 0x08,
|
||||
+ /*24*/ 0x48, 0x89, 0x54, 0x24, 0x10, 0x48, 0x89, 0x74,
|
||||
+ /*32*/ 0x24, 0x18, 0x48, 0x89, 0x7c, 0x24, 0x20, 0x4c,
|
||||
+ /*40*/ 0x89, 0x44, 0x24, 0x28, 0x4c, 0x89, 0x4c, 0x24,
|
||||
+ /*48*/ 0x30, 0xb8, 0xee, 0x00, 0x00, 0x00, 0x31, 0xd2,
|
||||
+ /*56*/ 0x48, 0x89, 0x94, 0x24, 0x40, 0x02, 0x00, 0x00,
|
||||
+ /*64*/ 0x48, 0x89, 0x94, 0x24, 0x48, 0x02, 0x00, 0x00,
|
||||
+ /*72*/ 0x48, 0x89, 0x94, 0x24, 0x50, 0x02, 0x00, 0x00,
|
||||
+ /*80*/ 0x48, 0x89, 0x94, 0x24, 0x58, 0x02, 0x00, 0x00,
|
||||
+ /*88*/ 0x48, 0x89, 0x94, 0x24, 0x60, 0x02, 0x00, 0x00,
|
||||
+ /*96*/ 0x48, 0x89, 0x94, 0x24, 0x68, 0x02, 0x00, 0x00,
|
||||
+ /*104*/0x48, 0x89, 0x94, 0x24, 0x70, 0x02, 0x00, 0x00,
|
||||
+ /*112*/0x48, 0x89, 0x94, 0x24, 0x78, 0x02, 0x00, 0x00,
|
||||
+ /*120*/0x0f, 0xae, 0x64, 0x24, 0x40, 0x48, 0x8b, 0x73,
|
||||
+ /*128*/0x10, 0x48, 0x8b, 0x7b, 0x08,
|
||||
+ /*133*/0xe8, 0x00, 0x00, 0x00, 0x00, /* callq <_dl_fixup> */
|
||||
+ /*138*/0x49, 0x89, 0xc3, 0xb8, 0xee, 0x00,
|
||||
+ /*144*/0x00, 0x00, 0x31, 0xd2, 0x0f, 0xae, 0x6c, 0x24,
|
||||
+ /*152*/0x40, 0x4c, 0x8b, 0x4c, 0x24, 0x30, 0x4c, 0x8b,
|
||||
+ /*160*/0x44, 0x24, 0x28, 0x48, 0x8b, 0x7c, 0x24, 0x20,
|
||||
+ /*168*/0x48, 0x8b, 0x74, 0x24, 0x18, 0x48, 0x8b, 0x54,
|
||||
+ /*176*/0x24, 0x10, 0x48, 0x8b, 0x4c, 0x24, 0x08, 0x48,
|
||||
+ /*184*/0x8b, 0x04, 0x24, 0x48, 0x89, 0xdc, 0x48, 0x8b,
|
||||
+ /*192*/0x1c, 0x24, 0x48, 0x83, 0xc4, 0x18, 0xf2, 0x41,
|
||||
+ /*200*/0xff, 0xe3 };
|
||||
+ static struct pattern pat_xsave = {
|
||||
+ "amd64-xsave", 202, {{ 0,11 }, { 15,119 }, {138,64}, { 202,0 }} };
|
||||
+
|
||||
+ static UChar code_fxsave[] = {
|
||||
+ /* 0*/ 0x53, 0x48, 0x89, 0xe3, 0x48, 0x83, 0xe4, 0xf0,
|
||||
+ /* 8*/ 0x48, 0x81, 0xec, 0x40, 0x02, 0x00, 0x00, 0x48,
|
||||
+ /*16*/ 0x89, 0x04, 0x24, 0x48, 0x89, 0x4c, 0x24, 0x08,
|
||||
+ /*24*/ 0x48, 0x89, 0x54, 0x24, 0x10, 0x48, 0x89, 0x74,
|
||||
+ /*32*/ 0x24, 0x18, 0x48, 0x89, 0x7c, 0x24, 0x20, 0x4c,
|
||||
+ /*40*/ 0x89, 0x44, 0x24, 0x28, 0x4c, 0x89, 0x4c, 0x24,
|
||||
+ /*48*/ 0x30, 0x0f, 0xae, 0x44, 0x24, 0x40, 0x48, 0x8b,
|
||||
+ /*56*/ 0x73, 0x10, 0x48, 0x8b, 0x7b, 0x08,
|
||||
+ /*62*/ 0xe8, 0x00, 0x00, 0x00, 0x00, /* callq <_dl_fixup> */
|
||||
+ /*67*/ 0x49, 0x89, 0xc3, 0x0f, 0xae,
|
||||
+ /*72*/ 0x4c, 0x24, 0x40, 0x4c, 0x8b, 0x4c, 0x24, 0x30,
|
||||
+ /*80*/ 0x4c, 0x8b, 0x44, 0x24, 0x28, 0x48, 0x8b, 0x7c,
|
||||
+ /*88*/ 0x24, 0x20, 0x48, 0x8b, 0x74, 0x24, 0x18, 0x48,
|
||||
+ /*96*/ 0x8b, 0x54, 0x24, 0x10, 0x48, 0x8b, 0x4c, 0x24,
|
||||
+ /*104*/0x08, 0x48, 0x8b, 0x04, 0x24, 0x48, 0x89, 0xdc,
|
||||
+ /*112*/0x48, 0x8b, 0x1c, 0x24, 0x48, 0x83, 0xc4, 0x18,
|
||||
+ /*120*/0xf2, 0x41, 0xff, 0xe3 };
|
||||
+ static struct pattern pat_fxsave = {
|
||||
+ "amd64-fxsave", 124, {{ 0,63 }, { 67,57 }, { 124,0 }} };
|
||||
+
|
||||
if ((VG_(strncmp)(obj->name, "/lib/ld", 7) != 0) &&
|
||||
- (VG_(strncmp)(obj->name, "/lib64/ld", 9) != 0)) return False;
|
||||
- return check_code(obj, code, &pat);
|
||||
+ (VG_(strncmp)(obj->name, "/lib64/ld", 9) != 0) &&
|
||||
+ (VG_(strncmp)(obj->name, "/usr/lib/ld", 11) != 0) &&
|
||||
+ (VG_(strncmp)(obj->name, "/usr/lib64/ld", 13) != 0)) return False;
|
||||
+ Bool pat_p = check_code(obj, code, &pat);
|
||||
+ Bool pat_xsavec_p = check_code(obj, code_xsavec, &pat_xsavec);
|
||||
+ Bool pat_xsave_p = check_code(obj, code_xsave, &pat_xsave);
|
||||
+ Bool pat_fxsave_p = check_code(obj, code_fxsave, &pat_fxsave);
|
||||
+ if (pat_p || pat_xsavec_p || pat_xsave_p || pat_fxsave_p) return True;
|
||||
#endif
|
||||
|
||||
/* For other platforms, no patterns known */
|
||||
@@ -254,7 +351,7 @@ obj_node* new_obj_node(DebugInfo* di, obj_node* next)
|
||||
i++;
|
||||
}
|
||||
|
||||
- if (runtime_resolve_addr == 0) search_runtime_resolve(obj);
|
||||
+ if (runtime_resolve_addrs == 0) search_runtime_resolve(obj);
|
||||
|
||||
return obj;
|
||||
}
|
||||
@@ -490,6 +587,7 @@ fn_node* CLG_(get_fn_node)(BB* bb)
|
||||
DebugInfo* di;
|
||||
UInt line_num;
|
||||
fn_node* fn;
|
||||
+ Int i;
|
||||
|
||||
/* fn from debug info is idempotent for a BB */
|
||||
if (bb->fn) return bb->fn;
|
||||
@@ -538,12 +636,14 @@ fn_node* CLG_(get_fn_node)(BB* bb)
|
||||
}
|
||||
if (0 == VG_(strcmp)(fnname, "_exit") && !exit_bb)
|
||||
exit_bb = bb;
|
||||
-
|
||||
- if (runtime_resolve_addr &&
|
||||
- (bb_addr(bb) >= runtime_resolve_addr) &&
|
||||
- (bb_addr(bb) < runtime_resolve_addr + runtime_resolve_length)) {
|
||||
- /* BB in runtime_resolve found by code check; use this name */
|
||||
- fnname = "_dl_runtime_resolve";
|
||||
+
|
||||
+ for (i = 0; i < runtime_resolve_addrs; i++) {
|
||||
+ if ((bb_addr(bb) >= runtime_resolve_addr[i]) &&
|
||||
+ (bb_addr(bb) < runtime_resolve_addr[i] + runtime_resolve_length[i])) {
|
||||
+ /* BB in runtime_resolve found by code check; use this name */
|
||||
+ fnname = "_dl_runtime_resolve";
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
|
||||
/* get fn_node struct for this function */
|
File diff suppressed because it is too large
Load Diff
@ -1,117 +0,0 @@
|
||||
commit f326d68d762edf4b0e9604daa446b6f8ca25725a
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Sun Jul 26 22:40:22 2020 +0200
|
||||
|
||||
epoll_ctl warns for uninitialized padding on non-amd64 64bit arches
|
||||
|
||||
struct vki_epoll_event is packed on x86_64, but not on other 64bit
|
||||
arches. This means that on 64bit arches there can be padding in the
|
||||
epoll_event struct. Seperately the data field is only used by user
|
||||
space (which might not set the data field if it doesn't need to).
|
||||
|
||||
Only check the events field on epoll_ctl. But assume both events
|
||||
and data are both written to by epoll_[p]wait (exclude padding).
|
||||
|
||||
https://bugs.kde.org/show_bug.cgi?id=422623
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
|
||||
index 5b5b7eee6..929a4d9af 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-linux.c
|
||||
@@ -2099,8 +2099,29 @@ PRE(sys_epoll_ctl)
|
||||
SARG1, ( ARG2<3 ? epoll_ctl_s[ARG2] : "?" ), SARG3, ARG4);
|
||||
PRE_REG_READ4(long, "epoll_ctl",
|
||||
int, epfd, int, op, int, fd, struct vki_epoll_event *, event);
|
||||
- if (ARG2 != VKI_EPOLL_CTL_DEL)
|
||||
- PRE_MEM_READ( "epoll_ctl(event)", ARG4, sizeof(struct vki_epoll_event) );
|
||||
+ if (ARG2 != VKI_EPOLL_CTL_DEL) {
|
||||
+ /* Just check the events field, the data field is for user space and
|
||||
+ unused by the kernel. */
|
||||
+ struct vki_epoll_event *event = (struct vki_epoll_event *) ARG4;
|
||||
+ PRE_MEM_READ( "epoll_ctl(event)", (Addr) &event->events,
|
||||
+ sizeof(__vki_u32) );
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/* RES event records have been written (exclude padding). */
|
||||
+static void epoll_post_helper ( ThreadId tid, SyscallArgs* arrghs,
|
||||
+ SyscallStatus* status )
|
||||
+{
|
||||
+ vg_assert(SUCCESS);
|
||||
+ if (RES > 0) {
|
||||
+ Int i;
|
||||
+ struct vki_epoll_event **events = (struct vki_epoll_event**)(Addr)ARG2;
|
||||
+ for (i = 0; i < RES; i++) {
|
||||
+ /* Assume both events and data are set (data is user space only). */
|
||||
+ POST_FIELD_WRITE(events[i]->events);
|
||||
+ POST_FIELD_WRITE(events[i]->data);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
PRE(sys_epoll_wait)
|
||||
@@ -2111,13 +2132,12 @@ PRE(sys_epoll_wait)
|
||||
PRE_REG_READ4(long, "epoll_wait",
|
||||
int, epfd, struct vki_epoll_event *, events,
|
||||
int, maxevents, int, timeout);
|
||||
+ /* Assume all (maxevents) events records should be (fully) writable. */
|
||||
PRE_MEM_WRITE( "epoll_wait(events)", ARG2, sizeof(struct vki_epoll_event)*ARG3);
|
||||
}
|
||||
POST(sys_epoll_wait)
|
||||
{
|
||||
- vg_assert(SUCCESS);
|
||||
- if (RES > 0)
|
||||
- POST_MEM_WRITE( ARG2, sizeof(struct vki_epoll_event)*RES ) ;
|
||||
+ epoll_post_helper (tid, arrghs, status);
|
||||
}
|
||||
|
||||
PRE(sys_epoll_pwait)
|
||||
@@ -2130,15 +2150,14 @@ PRE(sys_epoll_pwait)
|
||||
int, epfd, struct vki_epoll_event *, events,
|
||||
int, maxevents, int, timeout, vki_sigset_t *, sigmask,
|
||||
vki_size_t, sigsetsize);
|
||||
+ /* Assume all (maxevents) events records should be (fully) writable. */
|
||||
PRE_MEM_WRITE( "epoll_pwait(events)", ARG2, sizeof(struct vki_epoll_event)*ARG3);
|
||||
if (ARG5)
|
||||
PRE_MEM_READ( "epoll_pwait(sigmask)", ARG5, sizeof(vki_sigset_t) );
|
||||
}
|
||||
POST(sys_epoll_pwait)
|
||||
{
|
||||
- vg_assert(SUCCESS);
|
||||
- if (RES > 0)
|
||||
- POST_MEM_WRITE( ARG2, sizeof(struct vki_epoll_event)*RES ) ;
|
||||
+ epoll_post_helper (tid, arrghs, status);
|
||||
}
|
||||
|
||||
PRE(sys_eventfd)
|
||||
commit b74f9f23c8758c77367f18368ea95baa858544cb
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Tue Aug 18 23:58:55 2020 +0200
|
||||
|
||||
Fix epoll_ctl setting of array event and data fields.
|
||||
|
||||
Fix for https://bugs.kde.org/show_bug.cgi?id=422623 in commit ecf5ba119
|
||||
epoll_ctl warns for uninitialized padding on non-amd64 64bit arches
|
||||
contained a bug. A pointer to an array is not a pointer to a pointer to
|
||||
an array. Found by a Fedora user:
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1844778#c10
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
|
||||
index 0850487e9..3f488795a 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-linux.c
|
||||
@@ -2115,11 +2115,11 @@ static void epoll_post_helper ( ThreadId tid, SyscallArgs* arrghs,
|
||||
vg_assert(SUCCESS);
|
||||
if (RES > 0) {
|
||||
Int i;
|
||||
- struct vki_epoll_event **events = (struct vki_epoll_event**)(Addr)ARG2;
|
||||
+ struct vki_epoll_event *events = (struct vki_epoll_event*)(Addr)ARG2;
|
||||
for (i = 0; i < RES; i++) {
|
||||
/* Assume both events and data are set (data is user space only). */
|
||||
- POST_FIELD_WRITE(events[i]->events);
|
||||
- POST_FIELD_WRITE(events[i]->data);
|
||||
+ POST_FIELD_WRITE(events[i].events);
|
||||
+ POST_FIELD_WRITE(events[i].data);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,201 +0,0 @@
|
||||
From fe4b349df3d5edc1c849e9890cbc6b191386a03c Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Fri, 16 Oct 2020 02:55:06 +0200
|
||||
Subject: [PATCH] Support new faccessat2 linux syscall (439)
|
||||
|
||||
faccessat2 is a new syscall in linux 5.8 and will be used by glibc 2.33.
|
||||
faccessat2 is simply faccessat with a new flag argument. It has
|
||||
a common number across all linux arches.
|
||||
|
||||
https://bugs.kde.org/427787
|
||||
---
|
||||
NEWS | 1 +
|
||||
coregrind/m_syswrap/priv_syswrap-linux.h | 1 +
|
||||
coregrind/m_syswrap/syswrap-amd64-linux.c | 2 ++
|
||||
coregrind/m_syswrap/syswrap-arm-linux.c | 2 ++
|
||||
coregrind/m_syswrap/syswrap-arm64-linux.c | 2 ++
|
||||
coregrind/m_syswrap/syswrap-linux.c | 9 +++++++++
|
||||
coregrind/m_syswrap/syswrap-mips32-linux.c | 2 ++
|
||||
coregrind/m_syswrap/syswrap-mips64-linux.c | 1 +
|
||||
coregrind/m_syswrap/syswrap-nanomips-linux.c | 1 +
|
||||
coregrind/m_syswrap/syswrap-ppc32-linux.c | 2 ++
|
||||
coregrind/m_syswrap/syswrap-ppc64-linux.c | 2 ++
|
||||
coregrind/m_syswrap/syswrap-s390x-linux.c | 2 ++
|
||||
coregrind/m_syswrap/syswrap-x86-linux.c | 2 ++
|
||||
include/vki/vki-scnums-shared-linux.h | 2 ++
|
||||
14 files changed, 31 insertions(+)
|
||||
|
||||
diff --git a/coregrind/m_syswrap/priv_syswrap-linux.h b/coregrind/m_syswrap/priv_syswrap-linux.h
|
||||
index eb0b320ca..110f7c832 100644
|
||||
--- a/coregrind/m_syswrap/priv_syswrap-linux.h
|
||||
+++ b/coregrind/m_syswrap/priv_syswrap-linux.h
|
||||
@@ -180,6 +180,7 @@ DECL_TEMPLATE(linux, sys_symlinkat);
|
||||
DECL_TEMPLATE(linux, sys_readlinkat);
|
||||
DECL_TEMPLATE(linux, sys_fchmodat);
|
||||
DECL_TEMPLATE(linux, sys_faccessat);
|
||||
+DECL_TEMPLATE(linux, sys_faccessat2);
|
||||
DECL_TEMPLATE(linux, sys_utimensat);
|
||||
DECL_TEMPLATE(linux, sys_name_to_handle_at);
|
||||
DECL_TEMPLATE(linux, sys_open_by_handle_at);
|
||||
diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c
|
||||
index d6f3eb910..45e1f3d1b 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-amd64-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-amd64-linux.c
|
||||
@@ -873,6 +873,8 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425
|
||||
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
|
||||
LINXY(__NR_io_uring_register, sys_io_uring_register), // 427
|
||||
+
|
||||
+ LINX_(__NR_faccessat2, sys_faccessat2), // 439
|
||||
};
|
||||
|
||||
SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
|
||||
diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c
|
||||
index 70700e53f..978aedbe6 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-arm-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-arm-linux.c
|
||||
@@ -1046,6 +1046,8 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
LINXY(__NR_futex_time64, sys_futex_time64), // 422
|
||||
LINXY(__NR_sched_rr_get_interval_time64,
|
||||
sys_sched_rr_get_interval_time64), // 423
|
||||
+
|
||||
+ LINX_(__NR_faccessat2, sys_faccessat2), // 439
|
||||
};
|
||||
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c
|
||||
index acca02442..051d84989 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-arm64-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-arm64-linux.c
|
||||
@@ -825,6 +825,8 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
// (__NR_pkey_free, sys_ni_syscall), // 290
|
||||
|
||||
LINXY(__NR_statx, sys_statx), // 397
|
||||
+
|
||||
+ LINX_(__NR_faccessat2, sys_faccessat2), // 439
|
||||
};
|
||||
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
|
||||
index 3f488795a..41849873e 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-linux.c
|
||||
@@ -5988,6 +5988,15 @@ PRE(sys_faccessat)
|
||||
PRE_MEM_RASCIIZ( "faccessat(pathname)", ARG2 );
|
||||
}
|
||||
|
||||
+PRE(sys_faccessat2)
|
||||
+{
|
||||
+ PRINT("sys_faccessat2 ( %ld, %#" FMT_REGWORD "x(%s), %ld, %ld )",
|
||||
+ SARG1, ARG2, (HChar*)(Addr)ARG2, SARG3, SARG4);
|
||||
+ PRE_REG_READ4(long, "faccessat2",
|
||||
+ int, dfd, const char *, pathname, int, mode, int, flags);
|
||||
+ PRE_MEM_RASCIIZ( "faccessat2(pathname)", ARG2 );
|
||||
+}
|
||||
+
|
||||
PRE(sys_name_to_handle_at)
|
||||
{
|
||||
PRINT("sys_name_to_handle_at ( %ld, %#" FMT_REGWORD "x(%s), %#"
|
||||
diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c
|
||||
index 5face576b..f35fb8bbb 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-mips32-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-mips32-linux.c
|
||||
@@ -1131,6 +1131,8 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
LINXY(__NR_futex_time64, sys_futex_time64), // 422
|
||||
LINXY(__NR_sched_rr_get_interval_time64,
|
||||
sys_sched_rr_get_interval_time64), // 423
|
||||
+
|
||||
+ LINX_ (__NR_faccessat2, sys_faccessat2), // 439
|
||||
};
|
||||
|
||||
SyscallTableEntry* ML_(get_linux_syscall_entry) (UInt sysno)
|
||||
diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c
|
||||
index c64911a50..bd260679c 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-mips64-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-mips64-linux.c
|
||||
@@ -812,6 +812,7 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
LINX_ (__NR_syncfs, sys_syncfs),
|
||||
LINXY (__NR_statx, sys_statx),
|
||||
LINX_ (__NR_setns, sys_setns),
|
||||
+ LINX_ (__NR_faccessat2, sys_faccessat2),
|
||||
};
|
||||
|
||||
SyscallTableEntry * ML_(get_linux_syscall_entry) ( UInt sysno )
|
||||
diff --git a/coregrind/m_syswrap/syswrap-nanomips-linux.c b/coregrind/m_syswrap/syswrap-nanomips-linux.c
|
||||
index 7ceecb6da..a904745ab 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-nanomips-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-nanomips-linux.c
|
||||
@@ -821,6 +821,7 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
// (__NR_pkey_mprotect, sys_ni_syscall),
|
||||
// (__NR_pkey_alloc, sys_ni_syscall),
|
||||
// (__NR_pkey_free, sys_ni_syscall),
|
||||
+ LINX_ (__NR_faccessat2, sys_faccessat2),
|
||||
};
|
||||
|
||||
SyscallTableEntry* ML_(get_linux_syscall_entry) (UInt sysno)
|
||||
diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c
|
||||
index c19cb9e0e..6ddd482d9 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-ppc32-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c
|
||||
@@ -1049,6 +1049,8 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINXY(__NR_futex_time64, sys_futex_time64), // 422
|
||||
LINXY(__NR_sched_rr_get_interval_time64,
|
||||
sys_sched_rr_get_interval_time64), // 423
|
||||
+
|
||||
+ LINX_(__NR_faccessat2, sys_faccessat2), // 439
|
||||
};
|
||||
|
||||
SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
|
||||
diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c
|
||||
index b6422a765..7026e4ac6 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c
|
||||
@@ -1014,6 +1014,8 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINX_(__NR_pwritev2, sys_pwritev2), // 381
|
||||
|
||||
LINXY(__NR_statx, sys_statx), // 383
|
||||
+
|
||||
+ LINX_(__NR_faccessat2, sys_faccessat2), // 439
|
||||
};
|
||||
|
||||
SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
|
||||
diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c
|
||||
index 3427fee16..c5e4bb957 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-s390x-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-s390x-linux.c
|
||||
@@ -859,6 +859,8 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINX_(__NR_pwritev2, sys_pwritev2), // 377
|
||||
|
||||
LINXY(__NR_statx, sys_statx), // 379
|
||||
+
|
||||
+ LINX_(__NR_faccessat2, sys_faccessat2), // 439
|
||||
};
|
||||
|
||||
SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
|
||||
diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c
|
||||
index b59d96f37..67d866497 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-x86-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-x86-linux.c
|
||||
@@ -1644,6 +1644,8 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425
|
||||
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
|
||||
LINXY(__NR_io_uring_register, sys_io_uring_register),// 427
|
||||
+
|
||||
+ LINX_(__NR_faccessat2, sys_faccessat2), // 439
|
||||
};
|
||||
|
||||
SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
|
||||
diff --git a/include/vki/vki-scnums-shared-linux.h b/include/vki/vki-scnums-shared-linux.h
|
||||
index 6221d5a81..c8bc31b4b 100644
|
||||
--- a/include/vki/vki-scnums-shared-linux.h
|
||||
+++ b/include/vki/vki-scnums-shared-linux.h
|
||||
@@ -39,4 +39,6 @@
|
||||
#define __NR_fsmount 432
|
||||
#define __NR_fspick 433
|
||||
|
||||
+#define __NR_faccessat2 439
|
||||
+
|
||||
#endif
|
||||
--
|
||||
2.20.1
|
||||
|
@ -1,43 +0,0 @@
|
||||
commit 1c49351424f04ee29a5efc054cb08ab3ad22b978
|
||||
Author: Laurent Bonnans <laurent.bonnans@here.com>
|
||||
Date: Fri Nov 16 15:22:18 2018 +0100
|
||||
|
||||
Fix 397605 - Add support for Linux FICLONE ioctl
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
|
||||
index 41849873e..328e02a98 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-linux.c
|
||||
@@ -7961,6 +7961,11 @@ PRE(sys_ioctl)
|
||||
case VKI_FIBMAP:
|
||||
PRE_MEM_READ( "ioctl(FIBMAP)", ARG3, sizeof(int));
|
||||
break;
|
||||
+ case VKI_FICLONE:
|
||||
+ /* The direction of FICLONE (W) is incorrectly specified
|
||||
+ * as it expects a file descriptor and not a pointer to
|
||||
+ * user data */
|
||||
+ break;
|
||||
|
||||
case VKI_FBIOGET_VSCREENINFO: /* 0x4600 */
|
||||
PRE_MEM_WRITE( "ioctl(FBIOGET_VSCREENINFO)", ARG3,
|
||||
@@ -10898,6 +10903,8 @@ POST(sys_ioctl)
|
||||
case VKI_FIBMAP:
|
||||
POST_MEM_WRITE(ARG3, sizeof(int));
|
||||
break;
|
||||
+ case VKI_FICLONE:
|
||||
+ break;
|
||||
|
||||
case VKI_FBIOGET_VSCREENINFO: //0x4600
|
||||
POST_MEM_WRITE(ARG3, sizeof(struct vki_fb_var_screeninfo));
|
||||
diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h
|
||||
index ef93b9258..3b9dc3779 100644
|
||||
--- a/include/vki/vki-linux.h
|
||||
+++ b/include/vki/vki-linux.h
|
||||
@@ -1888,6 +1888,7 @@ struct vki_ppdev_frob_struct {
|
||||
|
||||
#define VKI_FIBMAP _VKI_IO(0x00,1) /* bmap access */
|
||||
#define VKI_FIGETBSZ _VKI_IO(0x00,2) /* get the block size used for bmap */
|
||||
+#define VKI_FICLONE _VKI_IOW(0x94, 9, int)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// From linux-2.6.8.1/include/scsi/sg.h
|
@ -1,13 +0,0 @@
|
||||
diff --git a/gdbserver_tests/nlcontrolc.vgtest b/gdbserver_tests/nlcontrolc.vgtest
|
||||
index bb5308403..4eb479595 100644
|
||||
--- a/gdbserver_tests/nlcontrolc.vgtest
|
||||
+++ b/gdbserver_tests/nlcontrolc.vgtest
|
||||
@@ -13,7 +13,7 @@ args: 1000000000 1000000000 1000000000 BSBSBSBS 1
|
||||
vgopts: --tool=none --vgdb=yes --vgdb-error=0 --vgdb-prefix=./vgdb-prefix-nlcontrolc
|
||||
stderr_filter: filter_stderr
|
||||
# Bug 338633 nlcontrol hangs on arm64 currently.
|
||||
-prereq: test -e gdb -a -f vgdb.invoker && ! ../tests/arch_test arm64 && ! ../tests/os_test solaris
|
||||
+prereq: false && test -e gdb -a -f vgdb.invoker && ! ../tests/arch_test arm64 && ! ../tests/os_test solaris
|
||||
progB: gdb
|
||||
argsB: --quiet -l 60 --nx ./sleepers
|
||||
stdinB: nlcontrolc.stdinB.gdb
|
@ -1,98 +0,0 @@
|
||||
diff --git a/coregrind/m_syswrap/priv_syswrap-generic.h b/coregrind/m_syswrap/priv_syswrap-generic.h
|
||||
index 4717abac6..c50b31399 100644
|
||||
--- a/coregrind/m_syswrap/priv_syswrap-generic.h
|
||||
+++ b/coregrind/m_syswrap/priv_syswrap-generic.h
|
||||
@@ -106,6 +106,10 @@ extern Bool
|
||||
ML_(handle_auxv_open)(SyscallStatus *status, const HChar *filename,
|
||||
int flags);
|
||||
|
||||
+extern Bool
|
||||
+ML_(handle_self_exe_open)(SyscallStatus *status, const HChar *filename,
|
||||
+ int flags);
|
||||
+
|
||||
/* Helper function for generic mprotect and linux pkey_mprotect. */
|
||||
extern void handle_sys_mprotect (ThreadId tid, SyscallStatus *status,
|
||||
Addr *addr, SizeT *len, Int *prot);
|
||||
diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c
|
||||
index 7d4b385a3..3810f7474 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-generic.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-generic.c
|
||||
@@ -4078,6 +4078,38 @@ Bool ML_(handle_auxv_open)(SyscallStatus *status, const HChar *filename,
|
||||
}
|
||||
#endif // defined(VGO_linux) || defined(VGO_solaris)
|
||||
|
||||
+#if defined(VGO_linux)
|
||||
+Bool ML_(handle_self_exe_open)(SyscallStatus *status, const HChar *filename,
|
||||
+ int flags)
|
||||
+{
|
||||
+ HChar name[30]; // large enough for /proc/<int>/exe
|
||||
+
|
||||
+ if (!ML_(safe_to_deref)((const void *) filename, 1))
|
||||
+ return False;
|
||||
+
|
||||
+ /* Opening /proc/<pid>/exe or /proc/self/exe? */
|
||||
+ VG_(sprintf)(name, "/proc/%d/exe", VG_(getpid)());
|
||||
+ if (!VG_STREQ(filename, name) && !VG_STREQ(filename, "/proc/self/exe"))
|
||||
+ return False;
|
||||
+
|
||||
+ /* Allow to open the file only for reading. */
|
||||
+ if (flags & (VKI_O_WRONLY | VKI_O_RDWR)) {
|
||||
+ SET_STATUS_Failure(VKI_EACCES);
|
||||
+ return True;
|
||||
+ }
|
||||
+
|
||||
+ SysRes sres = VG_(dup)(VG_(cl_exec_fd));
|
||||
+ SET_STATUS_from_SysRes(sres);
|
||||
+ if (!sr_isError(sres)) {
|
||||
+ OffT off = VG_(lseek)(sr_Res(sres), 0, VKI_SEEK_SET);
|
||||
+ if (off < 0)
|
||||
+ SET_STATUS_Failure(VKI_EMFILE);
|
||||
+ }
|
||||
+
|
||||
+ return True;
|
||||
+}
|
||||
+#endif // defined(VGO_linux)
|
||||
+
|
||||
PRE(sys_open)
|
||||
{
|
||||
if (ARG2 & VKI_O_CREAT) {
|
||||
@@ -4119,8 +4151,10 @@ PRE(sys_open)
|
||||
}
|
||||
}
|
||||
|
||||
- /* Handle also the case of /proc/self/auxv or /proc/<pid>/auxv. */
|
||||
- if (ML_(handle_auxv_open)(status, (const HChar *)(Addr)ARG1, ARG2))
|
||||
+ /* Handle also the case of /proc/self/auxv or /proc/<pid>/auxv
|
||||
+ or /proc/self/exe or /proc/<pid>/exe. */
|
||||
+ if (ML_(handle_auxv_open)(status, (const HChar *)(Addr)ARG1, ARG2)
|
||||
+ || ML_(handle_self_exe_open)(status, (const HChar *)(Addr)ARG1, ARG2))
|
||||
return;
|
||||
#endif // defined(VGO_linux)
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
|
||||
index 52074149d..fcc534454 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-linux.c
|
||||
@@ -5745,6 +5745,22 @@ PRE(sys_openat)
|
||||
return;
|
||||
}
|
||||
|
||||
+ /* And for /proc/self/exe or /proc/<pid>/exe case. */
|
||||
+
|
||||
+ VG_(sprintf)(name, "/proc/%d/exe", VG_(getpid)());
|
||||
+ if (ML_(safe_to_deref)( (void*)(Addr)ARG2, 1 )
|
||||
+ && (VG_(strcmp)((HChar *)(Addr)ARG2, name) == 0
|
||||
+ || VG_(strcmp)((HChar *)(Addr)ARG2, "/proc/self/exe") == 0)) {
|
||||
+ sres = VG_(dup)( VG_(cl_exec_fd) );
|
||||
+ SET_STATUS_from_SysRes( sres );
|
||||
+ if (!sr_isError(sres)) {
|
||||
+ OffT off = VG_(lseek)( sr_Res(sres), 0, VKI_SEEK_SET );
|
||||
+ if (off < 0)
|
||||
+ SET_STATUS_Failure( VKI_EMFILE );
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
/* Otherwise handle normally */
|
||||
*flags |= SfMayBlock;
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
From a88c168b4dd607bca47d3a1ec08573d3e5fa889b Mon Sep 17 00:00:00 2001
|
||||
From: Florian Weimer <fweimer@redhat.com>
|
||||
Date: Fri, 8 Jan 2021 15:08:50 +0100
|
||||
Subject: [PATCH] ppc64: Mask unrecognized AT_HWCAP2 values
|
||||
|
||||
Also suppress printing a log message for scv instructions in the
|
||||
instruction stream.
|
||||
|
||||
These changes are required for running glibc 2.33 on kernels with scv
|
||||
support under valgrind.
|
||||
---
|
||||
VEX/priv/guest_ppc_toIR.c | 5 +++--
|
||||
coregrind/m_initimg/initimg-linux.c | 6 ++++++
|
||||
2 files changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c
|
||||
index e7b576fa2..99e96a577 100644
|
||||
--- a/VEX/priv/guest_ppc_toIR.c
|
||||
+++ b/VEX/priv/guest_ppc_toIR.c
|
||||
@@ -8739,8 +8739,9 @@
|
||||
{
|
||||
IRType ty = mode64 ? Ity_I64 : Ity_I32;
|
||||
|
||||
- if (theInstr != 0x44000002) {
|
||||
- vex_printf("dis_syslink(ppc)(theInstr)\n");
|
||||
+ if (theInstr != 0x44000002) { // sc
|
||||
+ if (theInstr != 0x44000001) // scv
|
||||
+ vex_printf("dis_syslink(ppc)(theInstr)\n");
|
||||
return False;
|
||||
}
|
||||
|
||||
diff --git a/coregrind/m_initimg/initimg-linux.c b/coregrind/m_initimg/initimg-linux.c
|
||||
index ba84fa6e9..fb68ae00b 100644
|
||||
--- a/coregrind/m_initimg/initimg-linux.c
|
||||
+++ b/coregrind/m_initimg/initimg-linux.c
|
||||
@@ -750,6 +750,7 @@ Addr setup_client_stack( void* init_sp,
|
||||
PPC_FEATURE2_HAS_ISEL 0x08000000
|
||||
PPC_FEATURE2_HAS_TAR 0x04000000
|
||||
PPC_FEATURE2_HAS_VCRYPTO 0x02000000
|
||||
+ PPC_FEATURE2_HAS_IEEE128 0x00400000
|
||||
*/
|
||||
auxv_2_07 = (auxv->u.a_val & 0x80000000ULL) == 0x80000000ULL;
|
||||
hw_caps_2_07 = (vex_archinfo->hwcaps & VEX_HWCAPS_PPC64_ISA2_07)
|
||||
@@ -757,6 +757,11 @@
|
||||
* matches the setting in VEX HWCAPS.
|
||||
*/
|
||||
vg_assert(auxv_2_07 == hw_caps_2_07);
|
||||
+
|
||||
+ /* Mask unrecognized HWCAP bits. Only keep the bits that have
|
||||
+ * been mentioned above.
|
||||
+ */
|
||||
+ auxv->u.a_val &= 0xfec00000ULL;
|
||||
}
|
||||
|
||||
break;
|
||||
--- valgrind-3.16.1/VEX/priv/guest_ppc_toIR.c 2021-01-08 16:43:45.947122866 +0100
|
||||
+++ guest_ppc_toIR.c.new 2021-01-08 16:43:40.238166866 +0100
|
@ -1,222 +0,0 @@
|
||||
commit 15330adf7c2471fbaa6a0818db07078d81dbff97
|
||||
Author: Bart Van Assche <bvanassche@acm.org>
|
||||
Date: Sat Sep 19 08:08:59 2020 -0700
|
||||
|
||||
drd: Port to Fedora 33
|
||||
|
||||
Apparently on Fedora 33 the POSIX thread functions exist in both libc and
|
||||
libpthread. Hence this patch that intercepts the pthread functions in
|
||||
libc. See also https://bugs.kde.org/show_bug.cgi?id=426144 .
|
||||
|
||||
diff --git a/drd/drd_pthread_intercepts.c b/drd/drd_pthread_intercepts.c
|
||||
index 58c45aaec..c2882e5ab 100644
|
||||
--- a/drd/drd_pthread_intercepts.c
|
||||
+++ b/drd/drd_pthread_intercepts.c
|
||||
@@ -174,7 +174,16 @@ static int never_true;
|
||||
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl \
|
||||
{ return implf argl; }
|
||||
#else
|
||||
+/*
|
||||
+ * On Linux, intercept both the libc and the libpthread functions. At
|
||||
+ * least glibc 2.32.9000 (Fedora 34) has an implementation of all pthread
|
||||
+ * functions in both libc and libpthread. Older glibc versions only have an
|
||||
+ * implementation of the pthread functions in libpthread.
|
||||
+ */
|
||||
#define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \
|
||||
+ ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl; \
|
||||
+ ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl \
|
||||
+ { return implf argl; } \
|
||||
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl; \
|
||||
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \
|
||||
{ return implf argl; }
|
||||
|
||||
commit 3073d03e4b6e76797828b3f466863dbdda76cc7a
|
||||
Author: Bart Van Assche <bvanassche@acm.org>
|
||||
Date: Tue Oct 20 19:40:19 2020 -0700
|
||||
|
||||
drd: Unbreak the musl build
|
||||
|
||||
See also https://bugs.kde.org/show_bug.cgi?id=428035.
|
||||
|
||||
Reported-by: Stacy <stacy.gaikovaia@windriver.com>
|
||||
Fixes: 15330adf7c24 ("drd: Port to Fedora 33")
|
||||
|
||||
diff --git a/drd/drd_pthread_intercepts.c b/drd/drd_pthread_intercepts.c
|
||||
index 62c466f50..585aafe22 100644
|
||||
--- a/drd/drd_pthread_intercepts.c
|
||||
+++ b/drd/drd_pthread_intercepts.c
|
||||
@@ -174,6 +174,13 @@ static int never_true;
|
||||
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl \
|
||||
{ return implf argl; }
|
||||
#else
|
||||
+#ifdef MUSL_LIBC
|
||||
+/* musl provides a single library that includes pthreads functions. */
|
||||
+#define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \
|
||||
+ ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl; \
|
||||
+ ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \
|
||||
+ { return implf argl; }
|
||||
+#else
|
||||
/*
|
||||
* On Linux, intercept both the libc and the libpthread functions. At
|
||||
* least glibc 2.32.9000 (Fedora 34) has an implementation of all pthread
|
||||
@@ -188,6 +195,7 @@ static int never_true;
|
||||
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \
|
||||
{ return implf argl; }
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
/**
|
||||
* Macro for generating three Valgrind interception functions: one with the
|
||||
diff --git a/drd/drd_pthread_intercepts.c b/drd/drd_pthread_intercepts.c
|
||||
|
||||
index 585aafe22..3d1f90d3b 100644
|
||||
--- a/drd/drd_pthread_intercepts.c
|
||||
+++ b/drd/drd_pthread_intercepts.c
|
||||
@@ -151,7 +151,7 @@ static drd_rtld_guard_fn DRD_(rtld_bind_clear) = NULL;
|
||||
* @param[in] arg_decl Argument declaration list enclosed in parentheses.
|
||||
* @param[in] argl Argument list enclosed in parentheses.
|
||||
*/
|
||||
-#ifdef VGO_darwin
|
||||
+#if defined(VGO_darwin)
|
||||
static int never_true;
|
||||
#define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \
|
||||
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl; \
|
||||
@@ -164,29 +164,12 @@ static int never_true;
|
||||
fflush(stdout); \
|
||||
return pth_func_result; \
|
||||
}
|
||||
-#elif defined(VGO_solaris)
|
||||
-/* On Solaris, libpthread is just a filter library on top of libc.
|
||||
- * Threading and synchronization functions in runtime linker are not
|
||||
- * intercepted.
|
||||
- */
|
||||
+#elif defined(VG_WRAP_THREAD_FUNCTION_LIBC_ONLY)
|
||||
#define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \
|
||||
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl; \
|
||||
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl \
|
||||
{ return implf argl; }
|
||||
-#else
|
||||
-#ifdef MUSL_LIBC
|
||||
-/* musl provides a single library that includes pthreads functions. */
|
||||
-#define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \
|
||||
- ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl; \
|
||||
- ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \
|
||||
- { return implf argl; }
|
||||
-#else
|
||||
-/*
|
||||
- * On Linux, intercept both the libc and the libpthread functions. At
|
||||
- * least glibc 2.32.9000 (Fedora 34) has an implementation of all pthread
|
||||
- * functions in both libc and libpthread. Older glibc versions only have an
|
||||
- * implementation of the pthread functions in libpthread.
|
||||
- */
|
||||
+#elif defined(VG_WRAP_THREAD_FUNCTION_LIBC_AND_LIBPTHREAD)
|
||||
#define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \
|
||||
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl; \
|
||||
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl \
|
||||
@@ -194,7 +177,8 @@ static int never_true;
|
||||
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl; \
|
||||
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \
|
||||
{ return implf argl; }
|
||||
-#endif
|
||||
+#else
|
||||
+# error "Unknown platform/thread wrapping"
|
||||
#endif
|
||||
|
||||
/**
|
||||
diff --git a/helgrind/hg_intercepts.c b/helgrind/hg_intercepts.c
|
||||
index a10c3a4a3..2bc89f8a0 100644
|
||||
--- a/helgrind/hg_intercepts.c
|
||||
+++ b/helgrind/hg_intercepts.c
|
||||
@@ -78,26 +78,37 @@
|
||||
/*----------------------------------------------------------------*/
|
||||
|
||||
#if defined(VGO_solaris)
|
||||
-/* On Solaris, libpthread is just a filter library on top of libc.
|
||||
- * Threading and synchronization functions in runtime linker are not
|
||||
- * intercepted.
|
||||
- */
|
||||
-#define PTH_FUNC(ret_ty, f, args...) \
|
||||
- ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBC_SONAME,f)(args); \
|
||||
- ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBC_SONAME,f)(args)
|
||||
-
|
||||
/* pthread_t is typedef'd to 'unsigned int' but in DO_CREQ_* macros
|
||||
sizeof(Word) is expected. */
|
||||
#define CREQ_PTHREAD_T Word
|
||||
#define SEM_ERROR ret
|
||||
#else
|
||||
-#define PTH_FUNC(ret_ty, f, args...) \
|
||||
- ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args); \
|
||||
- ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args)
|
||||
#define CREQ_PTHREAD_T pthread_t
|
||||
#define SEM_ERROR errno
|
||||
#endif /* VGO_solaris */
|
||||
|
||||
+#define HG_EXPAND(tok) #tok
|
||||
+#define HG_STR(tok) HG_EXPAND(tok)
|
||||
+#define HG_WEAK_ALIAS(name, aliasname) \
|
||||
+ extern __typeof (name) aliasname __attribute__ ((weak, alias(HG_STR(name))))
|
||||
+
|
||||
+#if defined(VG_WRAP_THREAD_FUNCTION_LIBPTHREAD_ONLY)
|
||||
+#define PTH_FUNC(ret_ty, f, args...) \
|
||||
+ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args); \
|
||||
+ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args)
|
||||
+#elif defined(VG_WRAP_THREAD_FUNCTION_LIBC_AND_LIBPTHREAD)
|
||||
+#define PTH_FUNC(ret_ty, f, args...) \
|
||||
+ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args); \
|
||||
+ HG_WEAK_ALIAS(I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f), I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBC_SONAME,f)); \
|
||||
+ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args)
|
||||
+#elif defined(VG_WRAP_THREAD_FUNCTION_LIBC_ONLY)
|
||||
+#define PTH_FUNC(ret_ty, f, args...) \
|
||||
+ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBC_SONAME,f)(args); \
|
||||
+ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBC_SONAME,f)(args)
|
||||
+#else
|
||||
+# error "Unknown platform/thread wrapping"
|
||||
+#endif
|
||||
+
|
||||
// Do a client request. These are macros rather than a functions so
|
||||
// as to avoid having an extra frame in stack traces.
|
||||
|
||||
diff --git a/include/pub_tool_redir.h b/include/pub_tool_redir.h
|
||||
index bd65a44b4..d665afd98 100644
|
||||
--- a/include/pub_tool_redir.h
|
||||
+++ b/include/pub_tool_redir.h
|
||||
@@ -277,11 +277,7 @@
|
||||
/* --- Soname of the pthreads library. --- */
|
||||
|
||||
#if defined(VGO_linux)
|
||||
-# if defined(MUSL_LIBC)
|
||||
-# define VG_Z_LIBPTHREAD_SONAME libcZdZa // libc.*
|
||||
-#else
|
||||
# define VG_Z_LIBPTHREAD_SONAME libpthreadZdsoZd0 // libpthread.so.0
|
||||
-#endif
|
||||
#elif defined(VGO_darwin)
|
||||
# define VG_Z_LIBPTHREAD_SONAME libSystemZdZaZddylib // libSystem.*.dylib
|
||||
#elif defined(VGO_solaris)
|
||||
@@ -364,6 +360,27 @@
|
||||
|
||||
Bool VG_(is_soname_ld_so) (const HChar *soname);
|
||||
|
||||
+// Some macros to help decide which libraries (libc or libpthread
|
||||
+// or some platform-specific variation of these) should be used
|
||||
+// for wrapping pthread/semaphore functions with DRD and Helgrind
|
||||
+// The possibilities are a) only in libpthread
|
||||
+// b) mabye in both libpthread and libc or c) only in libc
|
||||
+// Linux GNU libc is moving from a) to c) (starting with Fedora 33)
|
||||
+// Linux MUSL libc is c)
|
||||
+// Darwin is a)
|
||||
+// Solaris is c)
|
||||
+// FreeBSD is b)
|
||||
+
|
||||
+#if defined(VGO_darwin)
|
||||
+#define VG_WRAP_THREAD_FUNCTION_LIBPTHREAD_ONLY
|
||||
+#elif defined(VGO_solaris) || (defined(VGO_linux) && defined(MUSL_LIBC))
|
||||
+#define VG_WRAP_THREAD_FUNCTION_LIBC_ONLY
|
||||
+#elif defined(VGO_linux)
|
||||
+#define VG_WRAP_THREAD_FUNCTION_LIBC_AND_LIBPTHREAD
|
||||
+#else
|
||||
+# error "Unknown platform"
|
||||
+#endif
|
||||
+
|
||||
#endif // __PUB_TOOL_REDIR_H
|
||||
|
||||
/*--------------------------------------------------------------------*/
|
@ -1,53 +0,0 @@
|
||||
commit 67363912e9cdba83869a72ff8c4084e7a7e4ab85
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Sun Feb 21 22:45:51 2021 +0100
|
||||
|
||||
Fix typo in DWARF 5 line table readers
|
||||
|
||||
This typo meant the directory entry was most often zero, which
|
||||
happened to be sometimes correct anyway (since zero is the compdir).
|
||||
So for simple testcases it looked correct. But it would be wrong for
|
||||
compilation units not in the current compdir. Like files compiled with
|
||||
a relative of absolute path.
|
||||
|
||||
The same typo was in both readdwarf.c (read_dwarf2_lineblock) and
|
||||
readdwarf3.c (read_filename_table). read_dwarf2_lineblock also had
|
||||
an extra "dwarf" string in the debug-line output.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1927153
|
||||
|
||||
diff --git a/coregrind/m_debuginfo/readdwarf.c b/coregrind/m_debuginfo/readdwarf.c
|
||||
index 88d5d99f1..3996623ed 100644
|
||||
--- a/coregrind/m_debuginfo/readdwarf.c
|
||||
+++ b/coregrind/m_debuginfo/readdwarf.c
|
||||
@@ -683,7 +683,7 @@ void read_dwarf2_lineblock ( struct _DebugInfo* di,
|
||||
directories_count = step_leb128U(&data);
|
||||
/* Read the contents of the Directory table. */
|
||||
if (di->ddump_line)
|
||||
- VG_(printf)(" dwarf The Directory Table%s\n",
|
||||
+ VG_(printf)(" The Directory Table%s\n",
|
||||
directories_count == 0 ? " is empty." : ":" );
|
||||
|
||||
for (n = 0; n < directories_count; n++) {
|
||||
@@ -796,7 +796,7 @@ void read_dwarf2_lineblock ( struct _DebugInfo* di,
|
||||
if (f == p_ndx)
|
||||
name = get_line_str (di, ui, &data, form,
|
||||
debugstr_img, debuglinestr_img);
|
||||
- else if (n == d_ndx)
|
||||
+ else if (f == d_ndx)
|
||||
diridx = get_line_ndx (di, &data, form);
|
||||
else
|
||||
data = skip_line_form (di, ui, data, form);
|
||||
diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c
|
||||
index 82bc8f241..60fc40244 100644
|
||||
--- a/coregrind/m_debuginfo/readdwarf3.c
|
||||
+++ b/coregrind/m_debuginfo/readdwarf3.c
|
||||
@@ -2323,7 +2323,7 @@ void read_filename_table( /*MOD*/XArray* /* of UInt* */ fndn_ix_Table,
|
||||
if (f == p_ndx)
|
||||
str = get_line_str (cc->di, cc->is_dw64, &c, form,
|
||||
debugstr_img, debuglinestr_img);
|
||||
- else if (n == d_ndx)
|
||||
+ else if (f == d_ndx)
|
||||
dir_xa_ix = get_line_ndx (cc->di, &c, form);
|
||||
else
|
||||
skip_line_form (cc->di, cc->is_dw64, &c, form);
|
@ -1,27 +0,0 @@
|
||||
commit ba73f8d2ebe4b5fe8163ee5ab806f0e50961ebdf
|
||||
Author: Andreas Arnez <arnez@linux.ibm.com>
|
||||
Date: Tue Nov 3 18:17:30 2020 +0100
|
||||
|
||||
Bug 428648 - s390x: Force 12-bit amode for vector loads in isel
|
||||
|
||||
Similar to Bug 417452, where the instruction selector sometimes attempted
|
||||
to generate vector stores with a 20-bit displacement, the same problem has
|
||||
now been reported with vector loads.
|
||||
|
||||
The problem is caused in s390_isel_vec_expr_wrk(), where the addressing
|
||||
mode is generated with s390_isel_amode() instead of
|
||||
s390_isel_amode_short(). This is fixed.
|
||||
|
||||
diff --git a/VEX/priv/host_s390_isel.c b/VEX/priv/host_s390_isel.c
|
||||
index 2f80dd850..134f3eb6f 100644
|
||||
--- a/VEX/priv/host_s390_isel.c
|
||||
+++ b/VEX/priv/host_s390_isel.c
|
||||
@@ -3741,7 +3741,7 @@ s390_isel_vec_expr_wrk(ISelEnv *env, IRExpr *expr)
|
||||
/* --------- LOAD --------- */
|
||||
case Iex_Load: {
|
||||
HReg dst = newVRegV(env);
|
||||
- s390_amode *am = s390_isel_amode(env, expr->Iex.Load.addr);
|
||||
+ s390_amode *am = s390_isel_amode_short(env, expr->Iex.Load.addr);
|
||||
|
||||
if (expr->Iex.Load.end != Iend_BE)
|
||||
goto irreducible;
|
File diff suppressed because it is too large
Load Diff
@ -1,201 +0,0 @@
|
||||
commit a53adb79711ccfc76a4ee32b20253045cdab55c7
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Mon Jul 27 16:36:17 2020 +0200
|
||||
|
||||
Handle linux syscalls sched_getattr and sched_setattr
|
||||
|
||||
The only "special" thing about these syscalls is that the given
|
||||
struct sched_attr determines its own size for future expansion.
|
||||
|
||||
Original fix by "ISHIKAWA,chiaki" <ishikawa@yk.rim.or.jp>
|
||||
|
||||
https://bugs.kde.org/show_bug.cgi?id=369029
|
||||
|
||||
diff --git a/coregrind/m_syswrap/priv_syswrap-linux.h b/coregrind/m_syswrap/priv_syswrap-linux.h
|
||||
index cdc73c1e6..eb0b320ca 100644
|
||||
--- a/coregrind/m_syswrap/priv_syswrap-linux.h
|
||||
+++ b/coregrind/m_syswrap/priv_syswrap-linux.h
|
||||
@@ -227,6 +227,8 @@ DECL_TEMPLATE(linux, sys_fremovexattr);
|
||||
// syscalls.
|
||||
DECL_TEMPLATE(linux, sys_sched_setparam);
|
||||
DECL_TEMPLATE(linux, sys_sched_getparam);
|
||||
+DECL_TEMPLATE(linux, sys_sched_setattr);
|
||||
+DECL_TEMPLATE(linux, sys_sched_getattr);
|
||||
DECL_TEMPLATE(linux, sys_sched_setscheduler);
|
||||
DECL_TEMPLATE(linux, sys_sched_getscheduler);
|
||||
DECL_TEMPLATE(linux, sys_sched_yield);
|
||||
diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c
|
||||
index 28d90135a..d6f3eb910 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-amd64-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-amd64-linux.c
|
||||
@@ -846,9 +846,8 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINX_(__NR_process_vm_writev, sys_process_vm_writev),// 311
|
||||
LINX_(__NR_kcmp, sys_kcmp), // 312
|
||||
LINX_(__NR_finit_module, sys_finit_module), // 313
|
||||
-// LIN__(__NR_sched_setattr, sys_ni_syscall), // 314
|
||||
-
|
||||
-// LIN__(__NR_sched_getattr, sys_ni_syscall), // 315
|
||||
+ LINX_(__NR_sched_setattr, sys_sched_setattr), // 314
|
||||
+ LINXY(__NR_sched_getattr, sys_sched_getattr), // 315
|
||||
LINX_(__NR_renameat2, sys_renameat2), // 316
|
||||
// LIN__(__NR_seccomp, sys_ni_syscall), // 317
|
||||
LINXY(__NR_getrandom, sys_getrandom), // 318
|
||||
diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c
|
||||
index 579542785..70700e53f 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-arm-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-arm-linux.c
|
||||
@@ -1009,6 +1009,8 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
LINXY(__NR_process_vm_readv, sys_process_vm_readv), // 376
|
||||
LINX_(__NR_process_vm_writev, sys_process_vm_writev),// 377
|
||||
|
||||
+ LINX_(__NR_sched_setattr, sys_sched_setattr), // 380
|
||||
+ LINXY(__NR_sched_getattr, sys_sched_getattr), // 381
|
||||
LINX_(__NR_renameat2, sys_renameat2), // 382
|
||||
|
||||
LINXY(__NR_getrandom, sys_getrandom), // 384
|
||||
diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c
|
||||
index 81e01456f..acca02442 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-arm64-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-arm64-linux.c
|
||||
@@ -806,8 +806,8 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
LINX_(__NR_process_vm_writev, sys_process_vm_writev), // 271
|
||||
LINX_(__NR_kcmp, sys_kcmp), // 272
|
||||
LINX_(__NR_finit_module, sys_finit_module), // 273
|
||||
- // (__NR_sched_setattr, sys_ni_syscall), // 274
|
||||
- // (__NR_sched_getattr, sys_ni_syscall), // 275
|
||||
+ LINX_(__NR_sched_setattr, sys_sched_setattr), // 274
|
||||
+ LINXY(__NR_sched_getattr, sys_sched_getattr), // 275
|
||||
LINX_(__NR_renameat2, sys_renameat2), // 276
|
||||
// (__NR_seccomp, sys_ni_syscall), // 277
|
||||
LINXY(__NR_getrandom, sys_getrandom), // 278
|
||||
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
|
||||
index 5b5b7eee6..56be3032d 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-linux.c
|
||||
@@ -3677,6 +3677,41 @@ POST(sys_sched_getparam)
|
||||
POST_MEM_WRITE( ARG2, sizeof(struct vki_sched_param) );
|
||||
}
|
||||
|
||||
+PRE(sys_sched_setattr)
|
||||
+{
|
||||
+ struct vki_sched_attr *attr;
|
||||
+ PRINT("sched_setattr ( %ld, %#" FMT_REGWORD "x, %#"
|
||||
+ FMT_REGWORD "x )", SARG1, ARG2, ARG3 );
|
||||
+ PRE_REG_READ3(long, "sched_setattr",
|
||||
+ vki_pid_t, pid, struct sched_attr *, p, unsigned int, flags);
|
||||
+ /* We need to be able to read at least the size field. */
|
||||
+ PRE_MEM_READ( "sched_setattr(attr->size)", ARG2, sizeof(vki_uint32_t) );
|
||||
+ attr = (struct vki_sched_attr *)(Addr)ARG2;
|
||||
+ if (ML_(safe_to_deref)(attr,sizeof(vki_uint32_t)))
|
||||
+ PRE_MEM_READ( "sched_setattr(attr)", (Addr)attr, attr->size);
|
||||
+}
|
||||
+
|
||||
+PRE(sys_sched_getattr)
|
||||
+{
|
||||
+ struct vki_sched_attr *attr;
|
||||
+ PRINT("sched_getattr ( %ld, %#" FMT_REGWORD "x, %ld, %#"
|
||||
+ FMT_REGWORD "x )", SARG1, ARG2, ARG3, ARG4 );
|
||||
+ PRE_REG_READ4(long, "sched_getattr",
|
||||
+ vki_pid_t, pid, struct sched_attr *, p,
|
||||
+ unsigned int, size, unsigned int, flags);
|
||||
+ /* We need to be able to read at least the size field. */
|
||||
+ PRE_MEM_READ( "sched_setattr(attr->size)", ARG2, sizeof(vki_uint32_t) );
|
||||
+ /* And the kernel needs to be able to write to the whole struct size. */
|
||||
+ attr = (struct vki_sched_attr *)(Addr)ARG2;
|
||||
+ if (ML_(safe_to_deref)(attr,sizeof(vki_uint32_t)))
|
||||
+ PRE_MEM_WRITE( "sched_setattr(attr)", (Addr)attr, attr->size);
|
||||
+}
|
||||
+POST(sys_sched_getattr)
|
||||
+{
|
||||
+ struct vki_sched_attr *attr = (struct vki_sched_attr *)(Addr)ARG2;
|
||||
+ POST_MEM_WRITE( (Addr)attr, attr->size );
|
||||
+}
|
||||
+
|
||||
PRE(sys_sched_getscheduler)
|
||||
{
|
||||
PRINT("sys_sched_getscheduler ( %ld )", SARG1);
|
||||
diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c
|
||||
index eed12a1bc..c19cb9e0e 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-ppc32-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c
|
||||
@@ -1016,6 +1016,9 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINXY(__NR_process_vm_readv, sys_process_vm_readv), // 351
|
||||
LINX_(__NR_process_vm_writev, sys_process_vm_writev),// 352
|
||||
|
||||
+ LINX_(__NR_sched_setattr, sys_sched_setattr), // 355
|
||||
+ LINXY(__NR_sched_getattr, sys_sched_getattr), // 356
|
||||
+
|
||||
LINXY(__NR_getrandom, sys_getrandom), // 359
|
||||
LINXY(__NR_memfd_create, sys_memfd_create), // 360
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c
|
||||
index d58200b49..b6422a765 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c
|
||||
@@ -998,6 +998,8 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINXY(__NR_process_vm_readv, sys_process_vm_readv), // 351
|
||||
LINX_(__NR_process_vm_writev, sys_process_vm_writev),// 352
|
||||
|
||||
+ LINX_(__NR_sched_setattr, sys_sched_setattr), // 355
|
||||
+ LINXY(__NR_sched_getattr, sys_sched_getattr), // 356
|
||||
LINX_(__NR_renameat2, sys_renameat2), // 357
|
||||
|
||||
LINXY(__NR_getrandom, sys_getrandom), // 359
|
||||
diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c
|
||||
index a0a330aa2..3427fee16 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-s390x-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-s390x-linux.c
|
||||
@@ -825,8 +825,8 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINX_(__NR_kcmp, sys_kcmp), // 343
|
||||
// ?????(__NR_finit_module, ), // 344
|
||||
|
||||
-// ?????(__NR_sched_setattr, ), // 345
|
||||
-// ?????(__NR_sched_getattr, ), // 346
|
||||
+ LINX_(__NR_sched_setattr, sys_sched_setattr), // 345
|
||||
+ LINXY(__NR_sched_getattr, sys_sched_getattr), // 346
|
||||
LINX_(__NR_renameat2, sys_renameat2), // 347
|
||||
// ?????(__NR_seccomp, ), // 348
|
||||
LINXY(__NR_getrandom, sys_getrandom), // 349
|
||||
diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c
|
||||
index 332ed0bf2..b59d96f37 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-x86-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-x86-linux.c
|
||||
@@ -1580,8 +1580,8 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINX_(__NR_kcmp, sys_kcmp), // 349
|
||||
|
||||
// LIN__(__NR_finit_module, sys_ni_syscall), // 350
|
||||
-// LIN__(__NR_sched_setattr, sys_ni_syscall), // 351
|
||||
-// LIN__(__NR_sched_getattr, sys_ni_syscall), // 352
|
||||
+ LINX_(__NR_sched_setattr, sys_sched_setattr), // 351
|
||||
+ LINXY(__NR_sched_getattr, sys_sched_getattr), // 352
|
||||
LINX_(__NR_renameat2, sys_renameat2), // 353
|
||||
// LIN__(__NR_seccomp, sys_ni_syscall), // 354
|
||||
|
||||
diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h
|
||||
index 75b583165..ef93b9258 100644
|
||||
--- a/include/vki/vki-linux.h
|
||||
+++ b/include/vki/vki-linux.h
|
||||
@@ -410,6 +410,23 @@ struct vki_sched_param {
|
||||
int sched_priority;
|
||||
};
|
||||
|
||||
+struct vki_sched_attr {
|
||||
+ vki_uint32_t size;
|
||||
+ vki_uint32_t sched_policy;
|
||||
+ vki_uint64_t sched_flags;
|
||||
+
|
||||
+ /* SCHED_NORMAL, SCHED_BATCH */
|
||||
+ vki_int32_t sched_nice;
|
||||
+
|
||||
+ /* SCHED_FIFO, SCHED_RR */
|
||||
+ vki_uint32_t sched_priority;
|
||||
+
|
||||
+ /* SCHED_DEADLINE */
|
||||
+ vki_uint64_t sched_runtime;
|
||||
+ vki_uint64_t sched_deadline;
|
||||
+ vki_uint64_t sched_period;
|
||||
+};
|
||||
+
|
||||
#define VKI_TASK_COMM_LEN 16
|
||||
|
||||
//----------------------------------------------------------------------
|
@ -1,63 +0,0 @@
|
||||
diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c
|
||||
index c9c058a7a..d726d63de 100644
|
||||
--- a/VEX/priv/guest_ppc_toIR.c
|
||||
+++ b/VEX/priv/guest_ppc_toIR.c
|
||||
@@ -25671,49 +25671,29 @@ dis_vx_store ( UInt prefix, UInt theInstr )
|
||||
|
||||
case 0x38D: // stxsibx
|
||||
{
|
||||
- IRExpr *stored_word;
|
||||
- IRTemp byte_to_store = newTemp( Ity_I64 );
|
||||
+ IRTemp byte_to_store = newTemp( Ity_I8 );
|
||||
|
||||
DIP("stxsibx %u,r%u,r%u\n", (UInt)XS, rA_addr, rB_addr);
|
||||
|
||||
- /* Can't store just a byte, need to fetch the word at EA merge data
|
||||
- * and store.
|
||||
- */
|
||||
- stored_word = load( Ity_I64, mkexpr( EA ) );
|
||||
- assign( byte_to_store, binop( Iop_And64,
|
||||
+ assign( byte_to_store, unop( Iop_64to8,
|
||||
unop( Iop_V128HIto64,
|
||||
- mkexpr( vS ) ),
|
||||
- mkU64( 0xFF ) ) );
|
||||
+ mkexpr( vS ) ) ) );
|
||||
|
||||
- store( mkexpr( EA ), binop( Iop_Or64,
|
||||
- binop( Iop_And64,
|
||||
- stored_word,
|
||||
- mkU64( 0xFFFFFFFFFFFFFF00 ) ),
|
||||
- mkexpr( byte_to_store ) ) );
|
||||
+ store( mkexpr( EA ), mkexpr( byte_to_store ) );
|
||||
break;
|
||||
}
|
||||
|
||||
case 0x3AD: // stxsihx
|
||||
{
|
||||
- IRExpr *stored_word;
|
||||
- IRTemp byte_to_store = newTemp( Ity_I64 );
|
||||
+ IRTemp hword_to_store = newTemp( Ity_I16 );
|
||||
|
||||
DIP("stxsihx %u,r%u,r%u\n", (UInt)XS, rA_addr, rB_addr);
|
||||
|
||||
- /* Can't store just a halfword, need to fetch the word at EA merge data
|
||||
- * and store.
|
||||
- */
|
||||
- stored_word = load( Ity_I64, mkexpr( EA ) );
|
||||
- assign( byte_to_store, binop( Iop_And64,
|
||||
- unop( Iop_V128HIto64,
|
||||
- mkexpr( vS ) ),
|
||||
- mkU64( 0xFFFF ) ) );
|
||||
+ assign( hword_to_store, unop( Iop_64to16,
|
||||
+ unop( Iop_V128HIto64,
|
||||
+ mkexpr( vS ) ) ) );
|
||||
|
||||
- store( mkexpr( EA ), binop( Iop_Or64,
|
||||
- binop( Iop_And64,
|
||||
- stored_word,
|
||||
- mkU64( 0xFFFFFFFFFFFF0000 ) ),
|
||||
- mkexpr( byte_to_store ) ) );
|
||||
+ store( mkexpr( EA ), mkexpr( hword_to_store ) );
|
||||
break;
|
||||
}
|
||||
|
116
valgrind.spec
116
valgrind.spec
@ -2,8 +2,8 @@
|
||||
|
||||
Summary: Tool for finding memory management bugs in programs
|
||||
Name: %{?scl_prefix}valgrind
|
||||
Version: 3.16.1
|
||||
Release: 20%{?dist}
|
||||
Version: 3.17.0
|
||||
Release: 0.1.RC1%{?dist}
|
||||
Epoch: 1
|
||||
License: GPLv2+
|
||||
URL: http://www.valgrind.org/
|
||||
@ -71,7 +71,7 @@ URL: http://www.valgrind.org/
|
||||
# So those will already have their full symbol table.
|
||||
%undefine _include_minidebuginfo
|
||||
|
||||
Source0: ftp://sourceware.org/pub/valgrind/valgrind-%{version}.tar.bz2
|
||||
Source0: ftp://sourceware.org/pub/valgrind/valgrind-%{version}.RC1.tar.bz2
|
||||
|
||||
# Needs investigation and pushing upstream
|
||||
Patch1: valgrind-3.9.0-cachegrind-improvements.patch
|
||||
@ -82,81 +82,11 @@ Patch2: valgrind-3.9.0-helgrind-race-supp.patch
|
||||
# Make ld.so supressions slightly less specific.
|
||||
Patch3: valgrind-3.9.0-ldso-supp.patch
|
||||
|
||||
# We want all executables and libraries in libexec instead of lib
|
||||
# so they are only available for valgrind usage itself and so the
|
||||
# same directory is used independent of arch.
|
||||
Patch4: valgrind-3.16.0-pkglibexecdir.patch
|
||||
|
||||
# Add some stack-protector
|
||||
Patch5: valgrind-3.16.0-some-stack-protector.patch
|
||||
Patch4: valgrind-3.16.0-some-stack-protector.patch
|
||||
|
||||
# Add some -Wl,z,now.
|
||||
Patch6: valgrind-3.16.0-some-Wl-z-now.patch
|
||||
|
||||
# KDE#422174 unhandled instruction bytes: 0x48 0xE9 (REX prefix JMP instr)
|
||||
Patch7: valgrind-3.16.1-REX-prefix-JMP.patch
|
||||
|
||||
# KDE#422623 epoll_ctl warns for uninit padding on non-amd64 64bit arches
|
||||
Patch8: valgrind-3.16.1-epoll.patch
|
||||
|
||||
# KDE#369029 handle linux syscalls sched_getattr and sched_setattr
|
||||
Patch9: valgrind-3.16.1-sched_getsetattr.patch
|
||||
|
||||
# KDE#415293 Incorrect call-graph tracking due to new _dl_runtime_resolve*
|
||||
Patch10: valgrind-3.16.1-dl_runtime_resolve.patch
|
||||
|
||||
# KDE#427787 Support new faccessat2 linux syscall (439)
|
||||
Patch11: valgrind-3.16.1-faccessat2.patch
|
||||
|
||||
# KDE#427931 gdbserver_tests/nlcontrolc.vgtest hangs on fedora rawhide
|
||||
Patch12: valgrind-3.16.1-gdbserver_nlcontrolc.patch
|
||||
|
||||
# KDE#427870 lmw, lswi and related PowerPC insns aren't allowed on ppc64le
|
||||
Patch13: valgrind-3.16.1-PPC64BE-lsw.patch
|
||||
|
||||
# KDE#428909 helgrind: need to intercept duplicate libc definitions
|
||||
Patch14: valgrind-3.16.1-pthread-intercept.patch
|
||||
|
||||
# KDE#428648 s390_emit_load_mem panics due to 20-bit offset for vector load
|
||||
Patch15: valgrind-3.16.1-s390_emit_load_mem.patch
|
||||
|
||||
# KDE#133812 s390x: z14 vector instructions not implemented
|
||||
Patch16: valgrind-3.16.1-s390x-z14-vector.patch
|
||||
|
||||
# KDE#430354 ppc stxsibx and stxsihx instructions write too much data
|
||||
Patch17: valgrind-3.16.1-stxsibx-stxsihx.patch
|
||||
|
||||
# KDE#426014 arm64: implement fmadd and fmsub as Iop_MAdd/Sub
|
||||
# KDE#430485 expr_is_guardable doesn't handle Iex_Qop
|
||||
Patch18: valgrind-3.16.1-arm64-fma.patch
|
||||
|
||||
# KDE#397605 Add support for Linux FICLONE ioctl
|
||||
Patch19: valgrind-3.16.1-ficlone.patch
|
||||
|
||||
# rhbz#1909415 valgrind makes false complaint about strcmp() on aarch64
|
||||
# upstream git commit 359b98828
|
||||
Patch20: valgrind-3.16.1-arm64-expensive-cmp.patch
|
||||
|
||||
# KDE#431157 PPC_FEATURE2_SCV needs to be masked in AT_HWCAP2
|
||||
Patch21: valgrind-3.16.1-ppc64-scv-hwcap.patch
|
||||
|
||||
# KDE#432102 Support DWARF5
|
||||
Patch22: valgrind-3.16.1-dwarf5.patch
|
||||
|
||||
# KDE#410743 shmat() calls for 32-bit programs fail when running in 64-bit
|
||||
# RHBZ#1909548 shmctl(IPC_STAT) doesn't set shm_nattch on aarch64
|
||||
Patch23: valgrind-3.16.0-shmctl.patch
|
||||
|
||||
# KDE#140178 open("/proc/self/exe", ...); doesn't quite work
|
||||
# RHBZ#1925786 valgrind appears to only interject readlink on /proc/self/exe
|
||||
Patch24: valgrind-3.16.1-open-proc-self-exe.patch
|
||||
|
||||
# RHBZ#1927153 -flto makes valgrind report non-existing paths to source files
|
||||
Patch25: valgrind-3.16.1-readdwarf-line.patch
|
||||
|
||||
# RHBZ#433898 netresolve: FTBFS in Fedora rawhide/f34 because arm64 valgrind
|
||||
# KDE#433898 arm64: Handle sp, lr, fp as DwReg in CfiExpr
|
||||
Patch26: valgrind-3.16.1-arm64_sp_lr_fp_DwReg.patch
|
||||
Patch5: valgrind-3.16.0-some-Wl-z-now.patch
|
||||
|
||||
BuildRequires: make
|
||||
BuildRequires: glibc-devel
|
||||
@ -191,6 +121,11 @@ BuildRequires: docbook-dtds
|
||||
# configure might use which
|
||||
BuildRequires: which
|
||||
|
||||
# For testing the debuginfod
|
||||
%if 0%{?fedora} > 29 || 0%{?rhel} > 7
|
||||
BuildRequires: elfutils-debuginfod
|
||||
%endif
|
||||
|
||||
%{?scl:Requires:%scl_runtime}
|
||||
|
||||
# We need to fixup selinux file context when doing a scl build.
|
||||
@ -280,40 +215,18 @@ Valgrind User Manual for details.
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%setup -q -n %{?scl:%{pkg_name}}%{!?scl:%{name}}-%{version}
|
||||
%setup -q -n %{?scl:%{pkg_name}}%{!?scl:%{name}}-%{version}.RC1
|
||||
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
|
||||
# Old rhel gcc doesn't have -fstack-protector-strong.
|
||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%endif
|
||||
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
%patch14 -p1
|
||||
%patch15 -p1
|
||||
%patch16 -p1
|
||||
%patch17 -p1
|
||||
%patch18 -p1
|
||||
%patch19 -p1
|
||||
%patch20 -p1
|
||||
%patch21 -p1
|
||||
%patch22 -p1
|
||||
%patch23 -p1
|
||||
%patch24 -p1
|
||||
%patch25 -p1
|
||||
%patch26 -p1
|
||||
|
||||
%build
|
||||
# LTO triggers undefined symbols in valgrind. Valgrind has a --enable-lto
|
||||
# configure time option, but that doesn't seem to help.
|
||||
@ -505,6 +418,7 @@ echo ===============END TESTING===============
|
||||
%{_includedir}/valgrind/drd.h
|
||||
%{_includedir}/valgrind/helgrind.h
|
||||
%{_includedir}/valgrind/memcheck.h
|
||||
%{_includedir}/valgrind/dhat.h
|
||||
%{_libdir}/pkgconfig/valgrind.pc
|
||||
|
||||
%if %{build_tools_devel}
|
||||
@ -537,6 +451,10 @@ fi
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Mon Mar 15 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.17.0-0.1.RC1
|
||||
- Update to upstream 3.17.0-RC1
|
||||
- Drop all upstreamed patches
|
||||
|
||||
* Wed Mar 3 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.16.1-20
|
||||
- Add valgrind-3.16.1-arm64_sp_lr_fp_DwReg.patch
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user