Several issues with vector floating point instructions have gone unnoticed
due to a lack of test coverage in this area. Add a test case that
improves the coverage, particuarly when dealing with short and extended
floating point formats.
Add test cases for verifying the new/enhanced instructions in the
vector-enhancements facility 2. For "vector string search" VSTRS add a
memcheck test case.
debuginfod is an HTTP server for distributing ELF/DWARF debugging
information. When a debuginfo file cannot be found locally, Valgrind
is able to query debuginfod servers for the file using its build-id.
readelf.c: Add debuginfod_find_debug_file(). Spawns a child process to
exec `debuginfod-find` in order to query servers for the debuginfo
file. Also add helper debuginfod_find_path().
pub_core_pathscan.h: Moved from priv_initimg_pathscan.h in order to use
VG_(find_executable)() in readelf.c.
docs: Add information regarding debuginfod to valgrind.1
memcheck/tests/linux: Add new test debuginfod-check.
tests/vg_regtest.in: Clear $DEBUGINFOD_URLS before running any tests.
https://bugs.kde.org/show_bug.cgi?id=432215
Test-specific environment variables set in .vgtest files are not reset
between tests. This can result in tests running with environment variables
intended for a previously run test. This can be easily fixed by clearing
the @env and @envB arrays in tests/vg_regtest:read_vgtest_file()
Original patch by Aaron Merey <amerey@redhat.com>
https://bugs.kde.org/show_bug.cgi?id=432672
This commit implements amd64 RDSEED instruction, on hosts that have it
and adds the new test case - none/tests/amd64/rdseed based on the existing
rdrand support.
https://bugs.kde.org/show_bug.cgi?id=424298
It only ever worked on x86 and amd64, and even on those it had a high false
positive rate and was slow. Everything it does, ASan can do faster, better,
and on more architectures. So there's no reason to keep this tool any more.
Make the z15 CPU models known to Valgrind. Add test case output for z15
to the "ecag" test. Also ensure that the facility bits for CPU facilities
unsupported by Valgrind are unset, particularly for the new
deflate-conversion facility.
s390x_features is built unconditionally on a range of platforms, accordingly
any non-portable or glibc-specific functionality must be guarded.
Fixes error reported when running 'make check' or 'make regtest' on a platform
with an alternative libc that Valgrind supports, in this case Apple's libc:
s390x_features.c:13:10: fatal error: 'features.h' file not found
#include <features.h> // __GLIBC_PREREQ
^
1 error generated.
Fixes: 161d22f0a ("s390x: Fix vector facility (vx) check in test suite")
Necessary changes to support nanoMIPS on Linux.
Part 4/4 - Other changes (mainly include/*)
Patch by Aleksandar Rikalo, Dimitrije Nikolic, Tamara Vlahovic,
Nikola Milutinovic and Aleksandra Karadzic.
Related KDE issue: #400872.
When checking the prereqisuites of running a vector test case, it is not
sufficient to check for the appropriate CPU facility bit. It must also be
verified that the kernel and hypervisor(s) have actually enabled the
vector facility. There are various ways of checking this. E.g., we could
try executing a vector instruction and handle any signals. Or we can
check the HWCAP for the appropriate bit. This patch does the latter.
Reuse the existing infrastructure for add, sub and mul.
Add cc checks to all mul tests.
Write a new test for bic.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Add IBM z14 and IBM z14 ZR1 to the list of known machine models. Add an
expected output variant for z14 to the s390x-specific "ecag" test case.
In README.s390, refer to a current version of the z/Architecture
Principles of Operation that describes the instructions introduced with
IBM z14.
Sync VEX/LICENSE.GPL with top-level COPYING file. We used 3 different
addresses for writing to the FSF to receive a copy of the GPL. Replace
all different variants with an URL <http://www.gnu.org/licenses/>.
The following files might still have some slightly different (L)GPL
copyright notice because they were derived from other programs:
- files under coregrind/m_demangle which come from libiberty:
cplus-dem.c, d-demangle.c, demangle.h, rust-demangle.c,
safe-ctype.c and safe-ctype.h
- coregrind/m_demangle/dyn-string.[hc] derived from GCC.
- coregrind/m_demangle/ansidecl.h derived from glibc.
- VEX files for FMA detived from glibc:
host_generic_maddf.h and host_generic_maddf.c
- files under coregrin/m_debuginfo derived from LZO:
lzoconf.h, lzodefs.h, minilzo-inl.c and minilzo.h
- files under coregrind/m_gdbserver detived from GDB:
gdb/signals.h, inferiors.c, regcache.c, regcache.h,
regdef.h, remote-utils.c, server.c, server.h, signals.c,
target.c, target.h and utils.c
Plus the following test files:
- none/tests/ppc32/testVMX.c derived from testVMX.
- ppc tests derived from QEMU: jm-insns.c, ppc64_helpers.h
and test_isa_3_0.c
- tests derived from bzip2 (with embedded GPL text in code):
hackedbz2.c, origin5-bz2.c, varinfo6.c
- tests detived from glibc: str_tester.c, pth_atfork1.c
- test detived from GCC libgomp: tc17_sembar.c
- performance tests derived from bzip2 or tinycc (with embedded GPL
text in code): bz2.c, test_input_for_tinycc.c and tinycc.c
The outer valgrind tries to run libc and libcxx free res functions
in the guest (which in case of self-hosting is a valgrind tool).
And that fails.
So, disable running such free res functions.
The current filter might leave empty lines behind.
This is caused by the fact that glibc used to not include a newline
in the message. But since glibc 2.29 it does.
https://bugs.kde.org/show_bug.cgi?id=405205
Reported-by: Stefan Maksimovic <stefan.maksimovic@rt-rk.com>
Bug 398870 - Please add support for instruction vcvtps2ph
Bug 353370 - RDRAND amd64->IR: unhandled instruction bytes: 0x48 0xF 0xC7 0xF0
This commit implements:
* amd64 RDRAND instruction, on hosts that have it.
* amd64 VCVTPH2PS and VCVTPS2PH, on hosts that have it.
The presence/absence of these on the host is now reflected in the CPUID
results returned to the guest. So code that tests for these features in
CPUID and acts accordingly should "just work".
* New test cases, none/tests/amd64/rdrand and none/tests/amd64/f16c. These
are built if the host's assembler can handle them, in the usual way.
This commit thoroughly overhauls DHAT, moving it out of the
"experimental" ghetto. It makes moderate changes to DHAT itself,
including dumping profiling data to a JSON format output file. It also
implements a new data viewer (as a web app, in dhat/dh_view.html).
The main benefits over the old DHAT are as follows.
- The separation of data collection and presentation means you can run a
program once under DHAT and then sort the data in various ways. Also,
full data is in the output file, and the viewer chooses what to omit.
- The data can be sorted in more ways than previously. Some of these
sorts involve useful filters such as "short-lived" and "zero reads or
zero writes".
- The tree structure view avoids the need to choose stack trace depth.
This avoids both the problem of not enough depth (when records that
should be distinct are combined, and may not contain enough
information to be actionable) and the problem of too much depth (when
records that should be combined are separated, making them seem less
important than they really are).
- Byte and block measures are shown with a percentage relative to the
global count, which helps gauge relative significance of different
parts of the profile.
- Byte and blocks measures are also shown with an allocation rate
(bytes and blocks per million instructions), which enables comparisons
across multiple profiles, even if those profiles represent different
workloads.
- Both global and per-node measurements are taken at the global heap
peak ("At t-gmax"), which gives Massif-like insight into the point of
peak memory use.
- The final/liftimes stats are a bit more useful than the old deaths
stats. (E.g. the old deaths stats didn't take into account lifetimes
of unfreed blocks.)
- The handling of realloc() has changed. The sequence `p = malloc(100);
realloc(p, 200);` now increases the total block count by 2 and the
total byte count by 300. Previously it increased them by 1 and 200.
The new handling is a more operational view that better reflects the
effect of allocations on performance. It makes a significant
difference in the results, giving paths involving reallocation (e.g.
repeated pushing to a growing vector) more prominence.
Other things of note:
- There is now testing, both regression tests that run within the
standard test suite, and viewer-specific tests that cannot run within
the standard test suite. The latter are run by loading
dh_view.html?test=1 in a web browser.
- The commit puts all tool lists in Makefiles (and similar files) in the
following consistent order: memcheck, cachegrind, callgrind, helgrind,
drd, massif, dhat, lackey, none; exp-sgcheck, exp-bbv.
- A lot of fields in dh_main.c have been given more descriptive names.
Those names now match those used in dh_view.js.
Apart from instructions with vector operands, Valgrind does not implement the
additional z/Architecture instructions introduced with z13.
These are:
- load and zero rightmost byte (LZRF, LZRG);
- load logical and zero rightmost byte (LLZRGF);
- load halfword high immediate on condition (LOCHHI);
- load halfword immediate on condition (LOCHI, LOCGHI);
- load high on condition (LOCFHR, LOCFH);
- store high on condition (STOCFH);
- perform pseudorandom number operation (PPNO), with the functions
PPNO-Query and PPNO-SHA-512-DRNG;
- load count to block boundary (LCBB).
Patches from Vadim Barkov (vbrkov@gmail.com), with coordination, testing
and format cleanups from Andreas Arnez (arnez@linux.ibm.com).
C++14 introduces sized delete operators and Valgrind support is added
by 6ef6f73. In addition, stderr filter which is used by Regtest should
be able to recognize this particular form in error report (just like
the other kinds of delete operators) in order to provide uniform output.
Fixes memcheck/tests/mismatches failure on non C++14 builds.
Patch by Aleksandar Rikalo.
This set of tests covers MIPS r6 specific instructions:
none/tests/mips32/MIPS32r6int
none/tests/mips32/branch_pc
none/tests/mips32/branches_r6
none/tests/mips32/fp_r6
none/tests/mips32/pc_instructions_r6
none/tests/mips64/MIPS64r6int
none/tests/mips64/branch_pc
none/tests/mips64/branches_r6
none/tests/mips64/fp_r6
none/tests/mips64/pc_instructions_r6
none/tests/mips64/r6_instructions
The following tests had to be changed to be applicaple for Rev6:
none/tests/libvex_test.c
none/tests/mips32/LoadStore
none/tests/mips32/LoadStore1
none/tests/mips32/MIPS32int
none/tests/mips32/MoveIns
none/tests/mips32/branches
none/tests/mips32/change_fp_mode
none/tests/mips32/mips32_dsp
none/tests/mips32/vfp
none/tests/mips64/arithmetic_instruction
none/tests/mips64/branches
none/tests/mips64/fpu_arithmetic
none/tests/mips64/fpu_load_store
none/tests/mips64/load_store
none/tests/mips64/load_store_multiple
none/tests/mips64/move_instructions
The following tests are not applicable for Rev6:
none/tests/mips32/fpu_branches
none/tests/mips32/unaligned_load_store
none/tests/mips64/branch_and_jump_instructions
none/tests/mips64/change_fp_mode
none/tests/mips64/fpu_branches
none/tests/mips64/load_store_unaligned
none/tests/mips64/unaligned_load
none/tests/mips64/unaligned_load_store.
Contributed by:
Tamara Vlahovic, Aleksandar Rikalo and Aleksandra Karadzic.
Related BZ issue - #387410.
In C99 mode casting the initializer to the struct type will cause gcc
to report an error like:
power_insn_available.c:38:1: error: initializer element is not constant
Simply removing the unnecessary cast fixes this (and is also valid C90).
(from bug 385408 comment 0):
Valgrind currently lacks support for the z/Architecture vector "support"
instructions introduced with z13. These are documented in the
z/Architecture Principles of Operation, Eleventh Edition (March, 2015),
chapter 21: "Vector Overview and Support Instructions".
This set of tests covers the whole MSA instruction set:
none/tests/mips32/msa_arithmetic
none/tests/mips32/msa_comparison
none/tests/mips32/msa_data_transfer
none/tests/mips32/msa_fpu
none/tests/mips32/msa_logical_and_shift
none/tests/mips32/msa_shuffle
none/tests/mips64/msa_arithmetic (symlink to mips32)
none/tests/mips64/msa_comparison (symlink to mips32)
none/tests/mips64/msa_data_transfer
none/tests/mips64/msa_fpu (symlink to mips32)
none/tests/mips64/msa_logical_and_shift (symlink to mips32)
none/tests/mips64/msa_shuffle (symlink to mips32)
Contributed by:
Tamara Vlahovic, Aleksandar Rikalo and Aleksandra Karadzic.
Related BZ issue - #382563.
* Similarly to what was done in revision r16104 for vg_perf, have a way
to append to predefined vg_regtest outer args, rather than only be able
to replace them.
* increase the num callers for outer tool to 40.
(This is in preparation of a future commit, that will allow outer tool
to append the inner guest stack trace to reported errors in the inner)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16133
This is a workaround for bug #371396. It adds a new test program
that can be used skip tests given a specific libc implementation
and optionally a specific minimum version. Currently only glibc
is recognized. This is used for the drd and helgrind tests
pth_cond_destroy_busy to be skipped on glibc 2.24.90+.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16097
A couple things got missed in the previous HW cap stuff needs updating patch
that cause the vbit tester to fail. The fixes are based on the patch
submitted by Mark Weilaard.
The changes were missed in Valgrind commit 16034
bugzilla 370265
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16037
This patch makes the following updates:
- Update the configure scripts to fix a configure/build issue seen on Power 7
- Update the ISA 3.0 hwcaps string.
- Update the ISA 3.0 ifdef value to be consistent with the hwcaps string
The patch was submitted by Will Schmidt. Patch reviewed and tested by Carl Love
on Power 7, Power 8 LE and BE, ISA 3.0 simulator for LE and BE.
Bugzilla 369175
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16034
The test suite support for the Power PC ISA 3.0 instructions added in
VEX commit 3244 is added in this commit.
bugzilla 364948
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15938
Allow 8k and 32k page sizes in memalign and other memory related tests.
This fixes crashes in the tests on systems with 8k or 32k pagesize.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15815