1372 Commits

Author SHA1 Message Date
Mark Wielaard
476b52d62d Bug #385912. Remove explicit NULL check from none/tests/rlimit_nofile.
glibc doesn't guarantee anything about setrlimit with a NULL limit argument.
It could just crash (if it needs to adjust the limit) or might silently
succeed (as newer glibc do). Just remove the extra check.

See also the "setrlimit change to prlimit change in behavior" thread:
https://sourceware.org/ml/libc-alpha/2017-10/threads.html#00830
2017-10-20 14:55:06 +02:00
Carl Love
5398a9f9cb PPC64, Add support for xscmpeqdp, xscmpgtdp, xscmpgedp, xsmincdp instructions.
These are Power 9 instructions.

Add test cases for the new instructions to test_isa_3_0.c

Bugzilla 385183.
2017-10-04 10:24:36 -05:00
Philippe Waroquiers
4adbae3559 Add a .exp file for the dash version in Debian 9
Add shell.stderr.exp-dash3, which differs from shell.stderr.exp-dash2 with:

6c6
< ./shell_binaryfile: 4: ./shell_binaryfile: Syntax error: ")" unexpected
---
> ./shell: 19: ./shell: ./shell_binaryfile: Exec format error

(so the newer dash gives a clearer msg)
2017-09-27 18:29:58 +02:00
Petar Jovanovic
e4f2fdfa4b mips: finetune none/tests/(mips32|64)/test_math test
Compiler may optimize out call to cbrt. Change test to prevent that.
Otherwise, the test does not exercise a desired codepath for cbrt, and it
prints precalculated value.
2017-09-15 18:29:29 +02:00
Tom Hughes
4c8c3af18a Fix eflags handling in amd64 instruction tests
In 64 bit mode there's no way to just save eflags so we save the
whole of rflags but we were doing so to a 32 bit variable!

Replace that with proper rflags support that knows it is dealing
with the full 64 bit flags word in 64 bit mode.
2017-08-30 19:26:37 +01:00
Ivo Raisr
efa1e5ef8d VEX register allocator version 3.
Implements a new version of VEX register allocator which
keeps the main state per virtual registers, as opposed
to real registers in v2. This results in a simpler and
cleaner design and much simpler implementation.
It has been observed that the new allocator executes 20-30%
faster than the previous one but could produce slightly worse
spilling decisions. Overall performance improvement when running
the Valgrind performance regression test suite has been observed
in terms of a few percent.

The new register allocator (v3) is now the default one.
The old register allocator (v2) is still kept around and can be
activated with command line option '--vex-regalloc-version=2'.

Fixes BZ#381553.
2017-08-28 12:40:17 +02:00
Petar Jovanovic
b343cc638a mips32: finetune vfp test to avoid compiler warnings
This patch removes two compiler warnings from the test:

vfp.c: In function 'handler':
vfp.c:260:4: warning: implicit declaration of function 'exit'
[-Wimplicit-function-declaration]
    exit(0);
    ^
vfp.c:260:4: warning: incompatible implicit declaration of built-in
function 'exit'
vfp.c: At top level:
vfp.c:258:13: warning: 'handler' defined but not used [-Wunused-function]
 static void handler(int sig)
             ^
2017-08-17 20:08:17 +02:00
Mark Wielaard
9160ea1ad5 ppc64 doesn't compile test_isa_2_06_partx.c without VSX support
The #ifdef HAS_VSX guard is wrongly placed. It makes the standard
include headers not be used. Causing a build failure. Fix by moving
the #ifdef HAS_VSX after the standard includes.

https://bugs.kde.org/show_bug.cgi?id=381272

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16450
2017-06-16 09:33:35 +00:00
Ivo Raisr
9ae62b13c5 Connect also 32-bit cet_nops tests.
Pertains to BZ#379525.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16423
2017-05-31 12:36:26 +00:00
Ivo Raisr
268a4e7f17 Connect cet_nops test cases with other OSes:
- with fs prefix for Solaris
- with gs prefix for OS X (Darwin)
Pertains to BZ#379525.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16422
2017-05-31 11:22:06 +00:00
Ivo Raisr
f6cef80eaf Split test cases from none/tests/amd64/cet_nops
into three different files with regards to using
fs prefix, gs prefix or no fs/gs prefix.
Pertains to BZ#379525.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16421
2017-05-31 06:19:50 +00:00
Julian Seward
12dc16730d Add test cases for x86 CET nops. Pertains to #379525.
Test case from tatyana.a.mineeva@intel.com.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16415
2017-05-24 14:29:41 +00:00
Ivo Raisr
f8a8e3de4d Fix expected output of brk tests after r16407.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16410
2017-05-23 21:22:31 +00:00
Ivo Raisr
074e6ce5b9 Fix expected output of none/tests/cmdline{1,2}.
Follow up to r16406.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16409
2017-05-23 09:13:31 +00:00
Philippe Waroquiers
f2ede90cbb 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.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16401
2017-05-20 14:59:54 +00:00
Petar Jovanovic
e1daabf714 mips32: fix wrong register use
Fix wrong register use in none/tests/mips32/MoveIns.c.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16399
2017-05-19 13:25:41 +00:00
Carl Love
13cfe17203 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.

Bugzilla 379925, VEX commit 3375


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16396
2017-05-17 20:11:32 +00:00
Petar Jovanovic
cbb7d11b1d mips32: update clobbers in none/mips32/LoadStore tests
Add missing registers to clobbers.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16395
2017-05-17 15:35:48 +00:00
Petar Jovanovic
8af3e329d3 mips32: minor update to the branches test
Update inline assembly with .set noreorder.
This prevents assembler from reordering the instructions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16394
2017-05-17 14:51:13 +00:00
Ivo Raisr
4bf4fc7f13 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16393
2017-05-17 11:06:53 +00:00
Carl Love
478bf158a8 Power PC ISA 3.0 fixes:
Fix for stxvx instruction. 
  Add LE support for stxv instruction 
  Fix for the xscmpexpdp instruction

Bugzilla: 379703

VEX commit: 3374

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16391
2017-05-16 20:38:35 +00:00
Julian Seward
c78994da42 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16372
2017-05-14 07:56:41 +00:00
Julian Seward
5c7234a3ed Add a test case for flag handling for BT/BTC/BTS/BTR. Pertains to #367543.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16370
2017-05-13 16:52:33 +00:00
Julian Seward
23a24548fb Add test cases for PCMPxSTRx variant $0x10. Pertains to #371288.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16367
2017-05-12 14:11:03 +00:00
Petar Jovanovic
8b3d356429 mips32: improve none/tests/mips32/MIPS32int
- Invalid memory access fixed;
- Inappropriate immediate value on ROTR test changed;
- Stricter tests for LWL/LWR instructions.

Patch by Aleksandar Rikalo.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16363
2017-05-11 16:59:33 +00:00
Bart Van Assche
d861692359 none/tests/amd64/bug132918.c: Mark f64 as an output parameter
This change avoids that gcc 7 complains that f64 is used uninitialized
in this source file.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16361
2017-05-11 03:07:49 +00:00
Petar Jovanovic
8d121cf8c9 mips64: finetune cvm_atomic_thread test
Remove unnecessary logs from the expected output.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16353
2017-05-10 16:18:12 +00:00
Ivo Raisr
84ad3a82c2 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16349
2017-05-10 05:43:03 +00:00
Ivo Raisr
246bb0e25f Remove TileGX/Linux port.
Fixes BZ#379504.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16340
2017-05-08 17:21:59 +00:00
Ivo Raisr
d8f648486e Fix some spelling mistakes.
Fixes BZ#374719
Patch by: klemens <ka7@la-evento.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16336
2017-05-05 22:13:20 +00:00
Ivo Raisr
38edd50c0e Update copyright end year to 2017 in preparation for 3.13 release.
n-i-bz



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16333
2017-05-04 15:09:39 +00:00
Carl Love
d4ef9f82c4 Updated PPC64 ISA 3.0B, add support for the additional instructions: addex, mffscdrn,
mffscdrni, mffsce, mffscrn, mffscrni, mffsl. vmsumudm.

Forgot to add the new files.  


Vex commit 3359  Has the source code changes for the instruction and OV32, CS32
support

Valgrind commit 16329 updated the existing files

This commit adds all the new files.  

Valgrind bugzilla 378931

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16330
2017-05-03 18:15:01 +00:00
Carl Love
6c88349325 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.

Valgrind bugzilla 378931

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16329
2017-05-03 17:28:35 +00:00
Julian Seward
9d6e165ea7 Bug 369459 - valgrind on arm64 violates the ARMv8 spec (ldxr/stxr)
This implements a fallback LL/SC implementation as described in bug 344524.

Valgrind side changes:

* Command line plumbing for --sim-hints=fallback-llsc

* memcheck: handle new arm64 guest state in memcheck/mc_machine.c



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16309
2017-04-24 09:24:57 +00:00
Petar Jovanovic
01a572e6f4 mips64: update Makefile
Update Makefile with new name for the stdout.exp file.
Missed to do this as part of r16298.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16299
2017-04-10 17:43:20 +00:00
Petar Jovanovic
2ef4677294 mips64: update cvm_atomic_thread test for BE
Update the test cvm_atomic_thread so it can be executed on BE boards too.
Reuse the stdout.exp file.

Based on patch from Tamara Vlahovic.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16298
2017-04-10 17:11:01 +00:00
Julian Seward
d52a222f8b Bug 358697 - valgrind.h: Some code remains even when defining NVALGRIND.
Patch from Matthias Schwarzott (zzam@gentoo.org).  The patch removes
a volatile memory read which was only there to stop compilers warning
about |format| being unused.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16290
2017-03-30 12:14:23 +00:00
Julian Seward
34b98bc823 Connect the v8 FP and SIMD tests to the build system.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16203
2017-01-19 06:53:13 +00:00
Petar Jovanovic
91a7579ee6 mips64: update exp file for test_math
Leave the old exp file that covers cases in which __addtf3 and __subtf3
did not take into account rounding modes. New exp file is the same file
that already exists in mips32 folder, so we just create a symbolic link
to it.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16201
2017-01-13 16:29:15 +00:00
Julian Seward
cf5a42f9ab Make this compile for both ARM and Thumb encodings,
and make it produce identical results for both encodings.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16198
2017-01-11 21:49:40 +00:00
Julian Seward
2a218b7efc Add test cases for 32-bit v8 FP and SIMD insns.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16194
2017-01-10 16:09:53 +00:00
Philippe Waroquiers
984cc6d07c Add missing EXTRA_DIST clonev.stdout.exp
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16187
2016-12-11 22:18:07 +00:00
Philippe Waroquiers
489cfd5156 Fix 342040 Valgrind mishandles clone with CLONE_VFORK | CLONE_VM that clones to a different stack
Fix 373192 Calling posix_spawn in glibc 2.24 completely broken

Functionally, this patch just does the following 2 changes to the
fork clone handling:
* It does not mask anymore CLONE_VFORK :
  The only effect of this flag is to suspend the parent, waiting for
  the child to either exit or execve.
  If some applications depends on this synchronisation, better keep it,
  as it will not harm to suspend the parent valgrind waiting for the
  child valgrind to exit or execve.
* In case the guest calls the clone syscall providing a non zero client stack,
  set the child guest SP after the syscall, before executing guest instructions.
  Not setting the guest stack ptr was the source of the problem reported
  in the bugs.

This also adds a test case  none/tests/linux/clonev.
Before this patch, test gives a SEGV, which is fixed by the patch.

The patch is however a lot bigger : this fix was touching some (mostly
identical/duplicated) code in all the linux platforms.
So, the clone/fork code has been factorised as much as possible.
This removes about 1700 lines of code.

This has been tested on:
* amd64
* x86
* ppc64 be and le
* ppc32
* arm64

This has been compiled on but *not really tested* on:
* mips64 (not too clear how to properly build and run valgrind on gcc22)

It has *not* been compiled and *not* tested on:
* arm
* mips32
* tilegx
* darwin   (normally, no impact)
* solaris  (normally, no impact)

The changes are relatively mechanical, so it is not impossible that
it will compile and work out of the box on these platforms.
Otherwise, questions welcome.

A few points of interest:
* Some platforms did have a typedef void vki_modify_ldt_t,
  and some platforms had no definition for this type at all.
  To make it easier to factorise, for such platforms, the following has
  been used:
     typedef char vki_modify_ldt_t;
    When the sizeof vki_modify_ldt_t is > 1, then the arg syscall is checked.
  This is somewhat a hack, but was simplifying the factorisation.

* for mips32/mips64 and tilegx, there is a strange unconditional assignment
  of 0 to a register (guest_r2 on mips, guest_r0 on tilegx).
  Unclear what this is, in particular because this is assigned whatever
  the result of the syscall (success or not).
  



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16186
2016-12-11 21:39:23 +00:00
Petar Jovanovic
d047f65f4e mips64: add cvm_atomic.stdout.exp-BE
Add BE variant of exp file for cvm_atomic test.
This fixes none/tests/mips64/cvm_atomic for Cavium MIPS64 BE systems.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16183
2016-12-10 00:29:58 +00:00
Petar Jovanovic
5e3a397049 mips32: minor style change to r16181
Divide one line into two lines that fit "80 columns" rule.
Non-functional change.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16182
2016-12-09 18:51:58 +00:00
Petar Jovanovic
1287ae8616 mips32: allow execution of round_fpu64 test for fpxx
Allow execution of none/tests/mips32/round_fpu64 test if it is built with
-mfpxx. It gets us more coverage eventually.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16181
2016-12-09 18:35:37 +00:00
Mark Wielaard
2608a8da6a Fix none/tests/pth_2sig.c build with (default) -std=gnu90.
error: ‘for’ loop initial declarations are only allowed in C99 mode

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16148
2016-11-21 08:28:07 +00:00
Ivo Raisr
b25f61d6ff Fix test none/tests/pth_2sig on Solaris.
When signal SIGINT was used, it got propagated to the parent shell
and therefore the regression test suite was terminated.
With SIGTERM only the parent exits, as is supposed.
Verified that this changed test case still reproduces the original problem
on Linux and Solaris, when r16140 is temporarily undone.
Follow up to r16140 and r16143 and BZ#372600.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16147
2016-11-20 15:06:08 +00:00
Philippe Waroquiers
d513fcfe77 xtree: some documentation and --help-debug fine tuning
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16146
2016-11-20 11:41:25 +00:00
Ivo Raisr
bd60092f11 Disable test none/tests/pth_2sig on Solaris for now until
it is investigated why it messes so badly with the regression test suite.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16143
2016-11-19 23:28:18 +00:00