Julian Seward [Wed, 24 May 2017 13:42:33 +0000 (13:42 +0000)]
When a thread hints that it is in a spin-wait loop (eg, x86 REP NOP insn),
deschedule the thread much sooner (300 evchecks) than previously (1000
evchecks). Once the thread is spinning, there's absolutely no point in
continuing with it, since only a different thread can get it out of the loop,
so we need to drop the current thread ASAP.
Julian Seward [Mon, 22 May 2017 08:50:07 +0000 (08:50 +0000)]
Make the message "brk segment overflow in thread #%u: can't grow to %#lx"
be printed only once, rather than every time it happens. Also make it
not be printed in silent mode (-q).
Compile fb_test_amd64 only if adx instructions can be compiled
Note: this just unbreaks the build on avx + non_adx capable systems
(such as gcc farm gcc20).
adx capable system should probably be better handled:
* ./tests/x86_amd64_features cannot check for adx flag
(so fb_test_amd64 is run if compiled and system is avx capable, which
might give problems if gcc/as can compile the test, but the cpu
cannot execute adx instructions)
* on an adx capable system, a native run of cpuid tells it is adx capable
but under valgrind, cpuid reports the valgrind synthetic cpu is not adx
capable.
Mark Wielaard [Thu, 18 May 2017 08:39:21 +0000 (08:39 +0000)]
Protect vgversion.h in a tarball from getting deleted by make clean
Create a file vgversion_dist.h in the tarball.
This file is not deleted by make clean
Change auxprogs/make_or_upd_vgversion_h to use vgversion_dist.h if it is
available.
Add some missing quotes to auxprogs/make_or_upd_vgversion_h
Mark Wielaard [Wed, 17 May 2017 20:38:18 +0000 (20:38 +0000)]
Fix vgversion.h generation for builddir != srcdir.
Make sure to include the builddir include directory to find the
generated vgversion.h. Make include/vgversion.h a .PHONY target
so it always gets regenerated even if the file is already there.
Make sure to run svnversion in the srcdir.
Carl Love [Wed, 17 May 2017 20:11:32 +0000 (20:11 +0000)]
PPC64, ISA 3.0 fixes
- Fix mffs instruction, FPSCR, C_FPCC field access is not
working correctly.
- Fix xscmpexpdp again still had a bug.
- Remove duplicate tests from test_isa_3_0.c
- Comment out he tests for the new ISA 3.0B instructions. There
seem to be some issues between the simulator and early HW that
need to be sorted out.
Ivo Raisr [Wed, 17 May 2017 11:06:53 +0000 (11:06 +0000)]
Fix test fb_test_amd64.
Follow up to r16372.
The test is now built if the compiler understands AVX
instructions. The test is executed if the host speaks AVX
is well. Finally bogus printf format flags were fixed as
they caused the output to be inconsistent on Linux and Solaris.
Ivo Raisr [Tue, 16 May 2017 08:22:51 +0000 (08:22 +0000)]
Increase Valgrind's load address to prevent mmap failure.
Fixes BZ#374963.
Previously Valgrind failed to start when the executable contained
large text, data or bss segments. The load address was increased
for almost all platforms to 0x58000000 (from 0x38000000),
giving another 512 MB for the executable.
Julian Seward [Tue, 16 May 2017 06:20:26 +0000 (06:20 +0000)]
Bug 368507 - valgrind throws std::bad_alloc on memory allocations larger than 34255421416 bytes.
Increase the amount of usable memory from 64GB to 128GB on Linux and Solaris.
(Solaris bits from Ivo Raisr.) OSX is so far unchanged.
Petar Jovanovic [Mon, 15 May 2017 14:56:22 +0000 (14:56 +0000)]
mips: implement set/long_jmp instead of builtins
- VG_MINIMAL_SETJMP and VG_MINIMAL_LONGJMP for VGP_mips64_linux are defined.
- Implementation of VG_MINIMAL_SETJMP and VG_MINIMAL_LONGJMP for mips32 is
improved by rescuing FP registers.
Julian Seward [Sun, 14 May 2017 07:56:41 +0000 (07:56 +0000)]
Add a test for amd64 basic instructions, with particular emphasis on testing
condition codes. This is originally by Fabrice Bellard (GPL2+'d), with MD5
support from Alexander Peslyak (public domain) and has been extended to cover
ADOX and ADCX as per bug #360415.
The program generates more than 800MB of output, which it MD5 sums, so the final
MD5 sum serves as the pass/fail check. It takes roughly a minute to run.
Fix mempool2 test
mempool2 test was using a wrong address for the pool arguments
in the client requests VALGRIND_MEMPOOL_FREE.
So, instead of testing what it was supposed to test (e.g. reading
memory from a freed mempool block), this was all causing
an illegal memory pool address.
So, fix the calls, and add a specific test to verify the illegal
mempool address.
Ivo Raisr [Fri, 12 May 2017 17:18:05 +0000 (17:18 +0000)]
Reduce the number of compiler warnings on MIPS platforms in coregrind/m_mallocfree.c
Fixes BZ#370028
Patch by: Tamara Vlahovic <tamara.vlahovic@imgtec.com>
Ivo Raisr [Fri, 12 May 2017 01:16:01 +0000 (01:16 +0000)]
Reduce the number of compiler warnings on MIPS platforms in coregrind/launcher-linux.c
Fixes BZ#370028
Patch by: Tamara Vlahovic <tamara.vlahovic@imgtec.com>
Bart Van Assche [Thu, 11 May 2017 03:07:11 +0000 (03:07 +0000)]
tests: Remove exception specifications
Exception specifications are a deprecated feature in C++11 and gcc 7
complains about these specifications. Hence remove these specifications.
This patch avoids that gcc reports the following:
warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
Ivo Raisr [Wed, 10 May 2017 05:43:03 +0000 (05:43 +0000)]
Fix compilation problems with some unit tests on Ubuntu 16.10+.
Compiler produces position independent executables (PIE) by default
which gets in the way of some unit tests.
Fixes BZ#377066.
Petar Jovanovic [Tue, 9 May 2017 15:57:59 +0000 (15:57 +0000)]
mips: reduce compiler warnings
Compiler complained about
warning: implicit declaration of function ‘vgPlain_prctl’
in coregrind/m_machine.c.
Also, it complained about
warning: no previous prototype for ‘vgSysWrap_mips_linux_sys_ptrace_before’
[-Wmissing-prototypes]
warning: no previous prototype for ‘vgSysWrap_mips_linux_sys_ptrace_after’
[-Wmissing-prototypes]
Carl Love [Wed, 3 May 2017 17:28:35 +0000 (17:28 +0000)]
PPC64 ISA 3.0B, add support for the additional instructions: addex, mffscdrn,
mffscdrni, mffsce, mffscrn, mffscrni, mffsl. vmsumudm.
Additionally, the OV32 and CA32 bits were introduced in ISA 3.0 but
Valgrind add support for setting these bits for ISA 3.0. The OV32 and CA32
bits must now be set on a number of pre ISA 3.0 instructions. So now the
instructions produce different results in the XER register. Thus we need pre
and post ISA 3.0 expect files. Command line options were added to thee
pre ISA test cases so instructions that didn't change could be run with one
set of command line args. The instructions that have different XER results
are run using a different set of command line args. The tests were split into
two, one for instructions that didn't change on for instructions that do
change under ISA 3.0. We then create ISA3.0 expect files only for the tests
that run differently. By doing this we minimized the size of the expect files
needed.
Vex commit 3359 Has the source code changes for the instruction and OV32, CS32
support
This commit is all the test case changes, adding the new test case files.
Rhys Kidd [Sat, 29 Apr 2017 22:06:20 +0000 (22:06 +0000)]
macos: Improve macOS 10.12 support. bz#365327.
The new macOS 10.12 way of loading dylib (placing them at the end of the currently
loaded segments) requires that Valgrind needs to know where the last segment was loaded.
A new structure (load_info_t) has been created to store all this information and easily
carry it around.
Changes:
- dyld text address is relative instead of absolute (macOS 10.12)
- Handle dylinker's offset (macOS 10.12)
- Handle the executable requesting a non-default stack address (macOS 10.12)
- Refactor to use load_info_t structure (all macOS)