Commit Graph

16512 Commits

Author SHA1 Message Date
Philippe Waroquiers
fe9c80daa2 Add option -T to vgdb to output timestamps in vgdb information/error messages
Also cleanup some trailink blanks.
2020-02-08 13:01:24 +01:00
Andreas Arnez
e83c28e10c Bug 416301 - s390x: Support "compare and signal" instructions
Add VEX support for the s390x "compare and signal" instructions KEBR,
KDBR, KXBR, KEB, and KDB.  For now, let them behave exactly like their
non-signalling counterparts.  Enhance the bfp-4 test case to cover these
instructions as well.  Update the list of supported instructions in
s390-opcodes.csv.  Add a disclaimer to README.s390, explaining that FP
signalling is not handled accurately on s390x at the moment.
2020-02-06 12:28:19 +01:00
Rhys Kidd
82da9c1006 Update .gitignore with none/tests/x86/bswapw
Add
  none/tests/x86/bswapw

to .gitignore.

Fixes: 6e0573777 ("Bug 415757 - vex x86->IR: unhandled instruction bytes: 0x66 0xF 0xCE (bswapw).")
2020-01-29 23:57:07 +11:00
Khem Raj
92fcf75d6d drd/tests/pth_detached3: Make pthread_detach() call portable across platforms
pthread_t is opaque type therefore we can not apply simple arithmetic to
variables of pthread_t type this test needs to pass a invalid pthread_t
handle, typcasting to uintptr_t works too and is portable across glibc and
musl

Fixes
| pth_detached3.c:24:25: error: invalid use of undefined type 'struct __pthread'
|    24 |   pthread_detach(thread + 8);
|       |                         ^

[ bvanassche: reformatted patch description and fixed up line numbers ]
2020-01-28 20:38:04 -08:00
Carl Love
4f70aa4fb0 PPC64: Fix assembler constraints.
The PPC64 assembler constraints "ws", "wa" and "ww" have changed to "wa"
in GCC 10.  Update the ppc64 tests test_isa_2_07_part1.c and test_isa_3_0.c.
2020-01-28 12:17:16 -06:00
Rhys Kidd
d5e3b38f72 Fix non-glibc build of the test suite with s390x_features
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")
2020-01-28 19:33:03 +11:00
Andreas Arnez
dcceae252a s390x: Fix some typos in s390-opcodes.csv
Some lines in s390-opcodes.csv contain entries that look like this:

    ...,"arch12"implemented",...

They are probably introduced by some cut-and-paste error.  This is fixed.
2020-01-27 16:46:20 +01:00
Julian Seward
2052837a3e Update bug status. 2020-01-26 16:40:40 +01:00
Mark Wielaard
fe6805efc1 x86 and amd64 tests: Use .text and .previous around all top-level asm.
GCC10 defaults to -fno-common which exposes some latent bugs in
some of the top-level asm code in various .c test files. Some of the
tests started to segfault (even if not run under valgrind). Such code
needs to be wrapped inside a .text and a .previous asm statement to
make sure the code is generated in the .text code section and to
make sure the compiler doesn't lose track of the section currently
being used to generate data or code in. Without it code might be
generated inside a data section or the other way around.
2020-01-25 18:34:58 +01:00
Mark Wielaard
a9cad5d133 Revert accidentially added changes in commit ce094ba912
These changes were part of my local testing of bug 416667
gcc10 ppc64le impossible constraint in 'asm' in test_isa
And shouldn't have been committed yet before review.
2020-01-25 17:44:55 +01:00
Mark Wielaard
ce094ba912 none/tests/amd64/avx_estimate_insn.vgtest: Add missing prereq.
This test only works when the processor actually implements AVX.
2020-01-25 17:19:18 +01:00
Mark Wielaard
2d040ce2c7 arm: Hook up preadv2 and pwritev2 syscalls.
They work the same as on other linux architectures.
2020-01-25 15:10:26 +01:00
Mark Wielaard
6cbd9ad1a1 guest_generic_bb_to_IR.c (stmt_is_guardable): Handle Ist_LoadG.
Triggers on Fedora 31 armv7hl with glibc 2.30 in _dl_relocate_object.
2020-01-25 15:00:32 +01:00
Mark Wielaard
2dab324986 Fix tests/x86/incdec_alt.c asm for GCC10.
Thanks to Jakub Jelinek. The test is broken. It blindly assumes the
toplevel inline asm is placed into some sensible section, but that is
a wrong assumption. The right thing is to start the inline asm with
.text directive and end with .previous. The reason gcc 10 breaks it
is the -fno-common default, the int r1, ... vars are emitted into .bss
section and that is the section that is current when the inline asm is
emitted previously they were in .common at the end of the assembly file.
2020-01-24 11:43:10 +01:00
Julian Seward
4c39fd9a00 Work around apparently-bogus warning from gcc 10. 2020-01-24 11:02:53 +01:00
Mark Wielaard
ee18ab11dd Fix GCC10 issue in guest_s390_defs.h typedef enum type s390x_vec_op_t.
GCC10 defaults to -fno-common which produces this error:

  guest_s390_defs.h:291: multiple definition of `s390x_vec_op_t

This is because GCC10 detects there are multiple definitions of the
variable s390x_vec_op_t. We don't want to define a variable though.
We had wanted to define a type (one that currently isn't used).
Fix this by making it a typedef enum.

https://bugzilla.redhat.com/show_bug.cgi?id=1794482
2020-01-23 21:30:59 +01:00
Stefan Maksimovic
0baeea7813 mips: update none/tests/mips32/msa_fpu.c
Guard withinEpsOf[FD] within none/tests/mips32/msa_fpu.c

Enclose the recently introduced functions with preprocessor guards,
much like the rest of the code is inside the main function.
Also mark the functions as static.
Minor code formatting.
2020-01-23 13:32:56 +00:00
Julian Seward
9dcd3ab1f6 Fix some spelling errors found by Lintian. Patch from Alessandro Ghedini <ghedo@debian.org>. 2020-01-23 10:53:36 +01:00
Julian Seward
16eb4436e2 iselV128Expr_wrk: handle Iex_ITE. This is needed by the recent 'grail' changes. n-i-bz. 2020-01-22 11:39:53 +01:00
Julian Seward
c82d35f6d6 arm64 front end: add support for 'dc civac', handling it the same as 'dc cvau'.
This partially fixes #412377.
2020-01-22 11:21:53 +01:00
Julian Seward
dad7f1d717 Enable sys_adjtimex() on arm-linux. Fixes #412408. 2020-01-22 11:03:54 +01:00
Julian Seward
c88133141a Bug 407376 - Update Xen support to 4.12 (4.13, actually) and add more coverage.
Patch from Tamas K Lengyel (tamas@tklengyel.com).
2020-01-22 10:55:33 +01:00
Julian Seward
685247b67a Bug 416464 - Handle ioctl PR_CAPBSET_READ/DROP.
Patch from Stefan Bruens (stefan.bruens@rwth-aachen.de).
2020-01-22 10:45:40 +01:00
Julian Seward
3542be5bdc Bug 385386 - Assertion failed "szB >= CACHE_ENTRY_SIZE" on m_debuginfo/image.c:517.
Patch from Reimar Doeffinger (kde@reimardoeffinger.de).
2020-01-22 10:32:31 +01:00
Julian Seward
6e0573777c Bug 415757 - vex x86->IR: unhandled instruction bytes: 0x66 0xF 0xCE (bswapw).
Implement bswapw, even though the instruction does not officially exist.  Patch
from Alex Henrie (alexhenrie24@gmail.com).
2020-01-22 09:31:57 +01:00
Julian Seward
95a44677c1 Update bug lists. 2020-01-22 09:08:54 +01:00
Mark Wielaard
f12114be23 Add bugs 416239 and 416387 to NEWS.
commit 58fc707804
416239  valgrind crashes when handling clock_adjtime

commit 7d4071fe85
416387  finit_module and bpf syscalls are unhandled on arm64
2020-01-18 02:09:49 +01:00
Alexandra Hajkova
7d4071fe85 arm64: hook up finit_module and bpf syscalls
This fixes "WARNING: unhandled arm64-linux syscall" in
delete_module01 and bpf_prog01 tests in the LTP test suite.
2020-01-18 01:44:33 +01:00
Stefan Maksimovic
0483f86aac mips64: fix assert in host_mips_defs.c for Malu_MADD
Mark the immediate as signed for Iex_Get and Ist_Put for Ity_V128 on BE.

The Malu_MADD case in emit_MIPSInst in VEX/priv/host_mips_defs.c expects a
signed immediate, hence the change.

This fixes an assert in host_mips_defs.c.
2020-01-17 13:19:44 +00:00
Stefan Maksimovic
3e0e34aecd mips64: rework math tests to take into account allowed approximation
Change the math tests to check whether the results are approximate to the
expected values instead of checking for exact matches since the calculations
in question are allowed to be approximate.

This fixes
  /none/tests/mips64/test_math and
  /none/tests/mips64/msa_fpu

on mips64r6.
2020-01-17 12:58:07 +00:00
Bart Van Assche
d6efbcb0b5 drd/tests/std_mutex: Add a unit test for std::mutex 2020-01-15 20:01:40 -08:00
Bart Van Assche
bb8c57ec64 drd: Fix 'conflicting load' error on std::mutex::lock() 2020-01-15 20:00:06 -08:00
Bart Van Assche
2d8192a2a7 drd/tests/Makefile.am: Fix indentation 2020-01-15 19:55:47 -08:00
Mark Wielaard
6f9a8d619d priv/guest_generic_bb_to_IR.c stmt_is_guardable(): Add Ist_Dirty.
This might happen when the source contains something like
if (something_involving_pcmpxstrx && foo) { .. }
which might use amd64g_dirtyhelper_PCMPxSTRx.
2020-01-15 18:11:24 +01:00
Alexandra Hájková
58fc707804 syswrap-linux.c: fix clock_adjtime handling
Not checking whether valgrind can dereference timex pointer
casues VALGRIND INTERNAL ERROR while handling clock_adjtime.
2020-01-15 16:01:12 +01:00
Petar Jovanovic
8b809cdbba mips: Implement Iex_CCall for nanoMIPS
Implement Iex_CCall for nanoMIPS.

This fixes none/tests/nestedfns.

Patch by Stefan Maksimovic.
2020-01-14 17:45:00 +00:00
Petar Jovanovic
3501c118df mips: Fix BEQC[16] and BNEC[16] instructions for nanoMIPS
Instruction decoding was not correct. In some cases, BEQC has been decoded
as BNEC and vice versa.

It caused problems with musl malloc() function.

Patch by Stefan Maksimovic.
2020-01-14 17:37:21 +00:00
Aleksandar Rikalo
d7b2a29718 mips: Fix return from syscall mechanism for nanoMIPS
- Restore guest sigmask in VG_(sigframe_destroy)
- Use "syscall[32]" asm idiom instead of "syscall" with immediate parameter
  in VG_(nanomips_linux_SUBST_FOR_rt_sigreturn)
- Call ML_(fixup_guest_state_to_restart_syscall) from PRE(sys_rt_sigreturn)
- Tiny code refactor of sigframe-nanomips-linux.c

This fixes none/tests/thread-exits.
2020-01-14 17:24:29 +00:00
Petar Jovanovic
8557d21928 mips: Add membarrier syscall for nanoMIPS
This fixes none/tests/linux/membarrier.
2020-01-14 12:43:13 +00:00
Petar Jovanovic
ab8807ee53 mips: Add Iop_ROTX for nanoMIPS
Implement Iop_ROTX and use it for ROTX instruction.
Fixes libvexmultiarch_test and libvex_test.

Patch by: Aleksandra Karadzic and Nikola Milutinovic.
2020-01-14 12:40:09 +00:00
Aleksandar Rikalo
8b7a3a2107 mips: Fix UASWM and UALWM instructions for nanoMIPS
UASWM and UALWM have not been implemented correctly.
Code used to implement SWM and LWM has been reused without making all of
the required adjustments.

This fixes memcpy() and memset() libc functions.
2020-01-14 12:09:18 +00:00
Aleksandar Rikalo
0fb2f59f57 mips: Change client request convention for nanoMIPS
Use a7/t0 register pair for for client requests. The same convention is
used throughout the rest of the code, as well as for mips32/64.
2020-01-14 12:07:11 +00:00
Aleksandar Rikalo
d4d92fe5db mips: Fix Ist_CAS for nanoMIPS
This code portion introduced a SEGFAULT:

-  if (&i->NMin.Cas.sz){
+  if (i->NMin.Cas.sz == 8) {

The implementation of Ist_Cas has been fixed and missing logging has been
added as well.
2020-01-14 12:04:31 +00:00
Aleksandar Rikalo
43c90db16f mips: Fix SAVE instruction for nanoMIPS
During a save (push) instruction adjusting the SP is required before doing
a store, otherwise Memcheck reports warning because of a write operation
outside of the stack area.
2020-01-14 11:54:15 +00:00
Petar Jovanovic
6eb5b451d3 mips: Fix BRSC and BALRSC instructions for nanoMIPS
Basic blocks should be terminated after detecting branch instruction.
2020-01-14 09:48:56 +00:00
Petar Jovanovic
1d3a772034 mips: Fix clone syscall for nanoMIPS
- Reset syscall return register (a0) in clone_new_thread()
- Use "syscall[32]" asm idiom instead of "syscall" with immediate parameter
  in ML_ (call_on_new_stack_0_1)()
- Optimize stack usage in ML_ (call_on_new_stack_0_1)()
- Code refactor of ML_ (call_on_new_stack_0_1)()

It partially fixes all tests which use clone system call, e.g. none/tests/pth_atfork1.

Patch by Aleksandar Rikalo.
2020-01-14 09:31:48 +00:00
Petar Jovanovic
3e48ab0803 mips: add IOP_And1 and Iop_Or1 for nanoMIPS
Support IOP_And1 and Iop_Or1 in iselWordExpr_R_wrk().
2020-01-09 18:28:57 +00:00
Petar Jovanovic
f6ce74cd7b mips: Implement Iop_CmpNEZ32, Iop_CmpNEZ64, Iop_And1 and Iop_Or1
Implement Iop_CmpNEZ32, Iop_CmpNEZ64, Iop_And1 and Iop_Or1
and fix broken Memcheck for mips32/64.
2020-01-09 19:05:07 +01:00
Petar Jovanovic
cb62332c32 mips: update NEWS and README.mips
Patches from Bug #400872 (Add nanoMIPS support to Valgrind) have been
merged.

Update README.mips with a correct configure line applicable for the latest
nanomips toolchain package in public.
2020-01-06 16:51:37 +00:00
Petar Jovanovic
9acc066ffc mips: Add tests for nanoMIPS instruction set
Patch by Tamara Vlahovic, Aleksandar Rikalo and Dimitrije Nikolic.

Related KDE issue: #400872.
2020-01-03 17:31:35 +00:00