1346 Commits

Author SHA1 Message Date
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
Philippe Waroquiers
d208bc934b Fix 372504 Hanging on exit_group
Note that it is unclear if the PRE syscall for rt_sigsuspend
is properly setting up a temporary mask in the thread state
tmp_sig_mask:  if an handler is called while a thread is
calling sigsuspend, the mask during the handler run must be
the temporary mask set by sigsuspend.
It is not clear if/where the valgrind sigframe builder/handler
sets the tmp_sig_mask to the value as expected by the user
(i.e. the value of the temporary mask which was given to
the sigsuspend syscall)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16141
2016-11-19 14:54:44 +00:00
Philippe Waroquiers
4e139bdead Fix Bug 372600 - process loops forever when fatal signals are arriving quickly
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16140
2016-11-19 13:51:41 +00:00
Mark Wielaard
2fb506df7a Cleanup none/tests/nocwd.vgtest tmp dirs.
The none/tests/nocwd creates a really deep temporary directory structure
that is also inaccessible after the test. This causes issues with some
build wrappers like koji which fail to cleanup such deep subdirectories.
So explicitly cleanup the directory after the test.

https://bugzilla.redhat.com/show_bug.cgi?id=1390282

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16134
2016-11-12 19:51:51 +00:00
Philippe Waroquiers
907b31a9e0 Addition of the options --xtree-memory and --xtree-memory-file
Option is added, parsed, explained in --help
but is not used yet by any other code.
So, apart of the --help, no functional effect.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16124
2016-11-11 14:15:45 +00:00
Carl Love
d752f54716 Fix PPC BE in 32-bit mode.
The 64-bit compares are not supported in 32-bit mode.  Change the 64-bit
compares to 32-bit compares when doing byte compares.  Add routine for
doing V128 GT compare using 32-bit compares.

The clean caller support was missing for 32-bit mode

Update the expected output file jm_vec_isa_2_07.stdout.exp

Bugzilla 371128      VEX commit 3271


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16072
2016-10-18 15:56:55 +00:00
Petar Jovanovic
802aefb211 mips32: add the test cases for luxc1/suxc1 instructions
Add the tests cases (in none/tests/mips32/vfp.c) that expose the error
with luxc1/suxc1 that was fixed by VEX r3262.

Patch by Aleksandra Karadzic.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16040
2016-10-12 18:58:36 +00:00
Petar Jovanovic
ed74dc8a27 mips: allow Valgrind to be compiled for soft-float
Force "hardfloat" mode for inline assembly that uses FPU instructions,
but pop original mode at the end of the assembly. Unhandled FPU
instructions will be handled by the signal handler (env_unsup_insn).

Skip MIPS specific tests for FPU if the code gets compiled for soft-
float.

This should allow Valgrind to be compiled as a soft-float binary, but
that executable should be used for soft-float systems only.

Related VEX change - r3261.
Related issue - BZ#351282.

Patch by Aleksandar Rikalo.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16039
2016-10-12 15:13:27 +00:00
Petar Jovanovic
517d43c278 mips: clear fcc bits in fcsr after calling printf()
Clear floating point condition codes in the test after calling external
function (in this case printf), as it might have clobbered fcc bits in
fcsr.

This resolves  none/tests/mips64/round.c failure on some systems.

Patch by Aleksandra Karadzic.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16038
2016-10-12 14:16:08 +00:00
Carl Love
c45ae57a04 Power configure fixes.
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
2016-10-10 18:09:01 +00:00
Carl Love
eeaa5eae76 ISA 3.0 BE testsuite fixes
In testing issues with the new ISA 3.0 instructions in BE mode, it was          
found that we needed some more unique values in the operands to catch           
various errors.  The issue is a sigle 32-bit value was replicated four          
times for a V128 operand.  The result is testing loads and stores where         
the word or half word order was swizzled couln't be detected because            
they were the same.  By making the 32-bit chunks unique we were able            
to catch additional errors.   

The VEX instruction fixes was committed in VEX commit 3260.

Bugzilla 369175

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16032
2016-10-07 23:08:02 +00:00
Christian Borntraeger
207e7a39ab actually test high-word by providing the plumbing...
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16029
2016-10-07 07:20:08 +00:00
Christian Borntraeger
3e9fc3a456 s390/highword fix compile warning with some compilers
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16028
2016-10-07 07:13:24 +00:00
Christian Borntraeger
8f5ee3d3cc s390: support RISBLG/RISBHG, MVCIN, LDE/LDER
patch by Andreas Arnez <arnez@linux.vnet.ibm.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16027
2016-10-07 07:09:40 +00:00
Petar Jovanovic
a3d6829d04 mips64: support for prctl(GET/SET_FP_MODE) syscalls
Adding a program (change_fp_mode) to test correct fpu emulation and
fp mode switch using prctl syscalls.

Patch by Aleksandar Rikalo.
Related bug - BZ #366079.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16004
2016-10-04 15:25:27 +00:00
Petar Jovanovic
a1d8c2ac15 mips32: test for syscalls prctl(GET/SET_FP_MODE)
MIPS32 test for syscalls prctl(GET/SET_FP_MODE).
Patch by Aleksandar Rikalo.

Related Bugzilla issue #366079.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16001
2016-10-04 13:07:36 +00:00
Mark Wielaard
be052139d6 Don't require the current working directory to exist. Bug #369209.
At startup valgrind fetches the current working directory and stashes
it away to be used later (in debug messages, read config files or create
log files). But if the current working directory didn't exist (or there
was some other error getting its path) then valgrind would go in an
endless loop. This was caused by assuming that any error meant a larger
buffer needed to be created to store the cwd path (ERANGE). However
there could be other reasons calling getcwd failed.

Fix this by only looping and resizing the buffer when the error is
ERANGE. Any other error just means we cannot fetch and store the current
working directory. Fix all callers to check get_startup_wd() returns
NULL. Only abort startup if a relative path needs to be used for
user supplied relative log files. Debug messages will just show
"<NO CWD>". And skip reading any config files from the startup_wd
if it doesn't exist.

Also add a new testcase that tests executing valgrind in a deep,
inaccessible and/or non-existing directory (none/tests/nocwd.vgtest).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15989
2016-10-01 11:54:38 +00:00
Philippe Waroquiers
eaefbe1f25 Fix 361615 - Inconsistent termination for multithreaded process terminated by signal
Test program by earl_chew



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15982
2016-09-24 12:06:34 +00:00
Mark Wielaard
45dc581a53 Fix none/tests/amd64/Makefile.am typo s/AM_CFKAGS/AM_CFLAGS/
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15980
2016-09-23 20:52:30 +00:00
Ivo Raisr
b21c19ffb3 Use proper compiler flags on Solaris for fma4 test.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15978
2016-09-23 14:10:55 +00:00
Carl Love
3c751e88ac Powerpc big endian, fix the expected output file for
none/tests/ppc64/jm_int_isa_2_07.stdout.exp

By convention the file jm_int_isa_2_07.stdout.exp is the big endian reuslts.
If the little endian results differ, the file has -LE appended to it.
This patch replaces the little endian results that are currenttly in
none/tests/ppc64/jm_int_isa_2_07.stdout.exp with the correct the big
endian results.

Bugzilla 369169


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15977
2016-09-22 15:37:57 +00:00
Mark Wielaard
87b9c5b125 Add a feature check for tests that use -march=armv8-a+crc.
Older gcc versions for arm64 don't support the crc arch feature.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15971
2016-09-20 17:57:00 +00:00
Christian Borntraeger
bcef0a5407 fix for bugzilla 361253 [s390x] ex_clone.c:42: undefined reference to `pthread_create'
Fix provides by Dann Frazier



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15970
2016-09-20 12:31:49 +00:00
Mark Wielaard
23615e5bb3 Add none/tests/ppc64/ppc64_helpers.h to noinst_HEADERS.
Makes sure that the header file will be included in the dist tar.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15968
2016-09-19 22:03:34 +00:00
Mark Wielaard
c5556b2094 Testcases for fma4 instructions. Bug #369000.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15961
2016-09-19 12:41:38 +00:00
Julian Seward
5ec46ea778 Connect up the v8 memory insn tests to the build system, and arrange
for both ARM and Thumb encodings to be tested.

Modify the existing v8 crypto tests so that both ARM and Thumb encodings
are tested.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15943
2016-09-01 15:19:07 +00:00
Julian Seward
6ce2e83f67 Enable test cases for arm32 v8 insns: LDAEX{,B,H,D}, STLEX{,B,H,D}
(load-acquire exclusive, store-release exclusive)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15942
2016-09-01 13:10:55 +00:00