]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
5 years agomips: Fix return from syscall mechanism for nanoMIPS
Aleksandar Rikalo [Tue, 14 Jan 2020 17:24:29 +0000 (17:24 +0000)] 
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.

5 years agomips: Add membarrier syscall for nanoMIPS
Petar Jovanovic [Tue, 14 Jan 2020 12:43:13 +0000 (12:43 +0000)] 
mips: Add membarrier syscall for nanoMIPS

This fixes none/tests/linux/membarrier.

5 years agomips: Add Iop_ROTX for nanoMIPS
Petar Jovanovic [Tue, 14 Jan 2020 12:40:09 +0000 (12:40 +0000)] 
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.

5 years agomips: Fix UASWM and UALWM instructions for nanoMIPS
Aleksandar Rikalo [Tue, 14 Jan 2020 12:09:18 +0000 (12:09 +0000)] 
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.

5 years agomips: Change client request convention for nanoMIPS
Aleksandar Rikalo [Tue, 14 Jan 2020 12:07:11 +0000 (12:07 +0000)] 
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.

5 years agomips: Fix Ist_CAS for nanoMIPS
Aleksandar Rikalo [Tue, 14 Jan 2020 12:04:31 +0000 (12:04 +0000)] 
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.

5 years agomips: Fix SAVE instruction for nanoMIPS
Aleksandar Rikalo [Tue, 14 Jan 2020 11:54:15 +0000 (11:54 +0000)] 
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.

5 years agomips: Fix BRSC and BALRSC instructions for nanoMIPS
Petar Jovanovic [Tue, 14 Jan 2020 09:48:56 +0000 (09:48 +0000)] 
mips: Fix BRSC and BALRSC instructions for nanoMIPS

Basic blocks should be terminated after detecting branch instruction.

5 years agomips: Fix clone syscall for nanoMIPS
Petar Jovanovic [Tue, 14 Jan 2020 09:31:48 +0000 (09:31 +0000)] 
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.

5 years agomips: add IOP_And1 and Iop_Or1 for nanoMIPS
Petar Jovanovic [Thu, 9 Jan 2020 18:28:57 +0000 (18:28 +0000)] 
mips: add IOP_And1 and Iop_Or1 for nanoMIPS

Support IOP_And1 and Iop_Or1 in iselWordExpr_R_wrk().

5 years agomips: Implement Iop_CmpNEZ32, Iop_CmpNEZ64, Iop_And1 and Iop_Or1
Petar Jovanovic [Thu, 9 Jan 2020 18:05:07 +0000 (19:05 +0100)] 
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.

5 years agomips: update NEWS and README.mips
Petar Jovanovic [Mon, 6 Jan 2020 16:51:37 +0000 (16:51 +0000)] 
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.

5 years agomips: Add tests for nanoMIPS instruction set
Petar Jovanovic [Fri, 3 Jan 2020 17:29:11 +0000 (17:29 +0000)] 
mips: Add tests for nanoMIPS instruction set

Patch by Tamara Vlahovic, Aleksandar Rikalo and Dimitrije Nikolic.

Related KDE issue: #400872.

5 years agosys_statx: don't complain if both |filename| and |buf| are NULL.
Julian Seward [Thu, 2 Jan 2020 13:27:24 +0000 (14:27 +0100)] 
sys_statx: don't complain if both |filename| and |buf| are NULL.

So as to work around the Rust library's dubious use of statx.

5 years agoamd64 insn selector: improved handling of Or1/And1 trees.
Julian Seward [Thu, 2 Jan 2020 08:32:19 +0000 (09:32 +0100)] 
amd64 insn selector: improved handling of Or1/And1 trees.

This splits function iselCondCode into iselCondCode_C and iselCondCode_R, the
former of which is the old one that computes boolean expressions into an amd64
condition code, but the latter being new, and computes boolean expressions
into the lowest bit of an integer register.  This enables much better code
generation for Or1/And1 trees, which now result quite commonly from the new
&&-recovery machinery in the front end.

5 years agoamd64 back end: generate 32-bit shift instructions for 32-bit IR shifts.
Julian Seward [Thu, 2 Jan 2020 08:23:46 +0000 (09:23 +0100)] 
amd64 back end: generate 32-bit shift instructions for 32-bit IR shifts.

Until now these have been handled by possibly widening the value to 64 bits,
if necessary, followed by a 64-bit shift.  That wastes instructions and code
space.

5 years agoEnable expensive handling of CmpEQ64/CmpNE64 for amd64 by default.
Julian Seward [Thu, 2 Jan 2020 08:10:06 +0000 (09:10 +0100)] 
Enable expensive handling of CmpEQ64/CmpNE64 for amd64 by default.

This has unfortunately become necessary because optimising compilers are
generating 64-bit equality comparisons on partially defined values on this
target.  There will shortly be two followup commits which partially mitigate
the resulting performance loss.

5 years agoFold Iop_CmpEQ32x8(x,x) to all-1s ..
Julian Seward [Thu, 2 Jan 2020 07:00:07 +0000 (08:00 +0100)] 
Fold Iop_CmpEQ32x8(x,x) to all-1s ..

    .. hence treating it as a dependency-breaking idiom.  Also handle the
    resulting IRConst_V256(0xFFFFFFFF) in the amd64 insn selector.

(dup of 96de5118f5332ae145912ebe91b8fa143df74b8d from 'grail')

Possibly fixes #409429.

5 years ago'grail' fixes for MIPS:
Julian Seward [Sun, 15 Dec 2019 19:14:37 +0000 (20:14 +0100)] 
'grail' fixes for MIPS:

This isn't a good result.  It merely disables the new functionality on MIPS
because enabling it causes segfaults, even with --tool=none, the cause of
which are not obvious.  It is only chasing through conditional branches that
is disabled, though.  Chasing through unconditional branches (jumps and calls
to known destinations) is still enabled.

* guest_generic_bb_to_IR.c bb_to_IR(): Disable, hopefully temporarily, the key
  &&-recovery transformation on MIPS.

* VEX/priv/host_mips_isel.c iselWordExpr_R_wrk(), iselCondCode_wrk():

  - add support for Iop_And1, Iop_Or1, and IRConst_U1.  This code is my best
    guess about what is correct, but is #if 0'd for now.

  - Properly guard some Iex_Binop cases that lacked a leading check that the
    expression actually was a Binop.

5 years ago'grail' fixes for s390x:
Julian Seward [Sun, 1 Dec 2019 06:01:20 +0000 (07:01 +0100)] 
'grail' fixes for s390x:

This isn't a good result.  It merely disables the new functionality on s390x,
for the reason stated below.

* guest_generic_bb_to_IR.c bb_to_IR(): Disable, hopefully temporarily, the key
  &&-recovery transformation on s390x, since it causes Memcheck to crash for
  reasons I couldn't figure out.  It also exposes some missing Iex_ITE cases
  in the s390x insn selector, although those shouldn't be a big deal to fix.

  Maybe it's some strangeness to do with the s390x "ex" instruction.  I don't
  exactly understand how that trickery works, but from some study of it, I
  didn't see anything obviously wrong.

  It is only chasing through conditional branches that is disabled for s390x.
  Chasing through unconditional branches (jumps and calls to known
  destinations) is still enabled.

* host_s390_isel.c s390_isel_cc(): No functional change.  Code has been added
  here to handle the new Iop_And1 and Iop_Or1, and it is somewhat tested, but
  is not needed until conditional branch chasing is enabled on s390x.

5 years ago'grail' fixes for ppc32 and ppc64:
Julian Seward [Wed, 27 Nov 2019 07:52:45 +0000 (08:52 +0100)] 
'grail' fixes for ppc32 and ppc64:

* do_minimal_initial_iropt_BB: for ppc64, flatten rather than assert flatness.
  (Kludge. Sigh.)

* priv/host_ppc_isel.c iselCondCode_wrk(): handle And1 and Or1, the
  not-particularly-optimal way

* priv/host_ppc_isel.c iselCondCode_wrk(): handle Ico_U1(0).

5 years ago'grail' fixes for arm32:
Julian Seward [Wed, 27 Nov 2019 05:37:42 +0000 (06:37 +0100)] 
'grail' fixes for arm32:

* priv/guest_generic_bb_to_IR.c expr_is_guardable(), stmt_is_guardable():
  add some missing cases

* do_minimal_initial_iropt_BB: add comment (no functional change)

* priv/host_arm_isel.c iselCondCode_wrk(): handle And1 and Or1, the
  not-particularly-optimal way

5 years ago'grail' fixes for arm64:
Julian Seward [Sun, 24 Nov 2019 14:13:54 +0000 (15:13 +0100)] 
'grail' fixes for arm64:

* guest_arm64_toIR.c: use |sigill_diag| to guard auxiliary diagnostic printing
  in case of decode failure

* guest_generic_bb_to_IR.c expr_is_guardable(), stmt_is_guardable(): handle a
  few more cases that didn't turn up so far on x86 or amd64

* host_arm64_defs.[ch]:

  - new instruction ARM64Instr_Set64, to copy a condition code value into a
    register (the CSET instruction)

  - use this to reimplement Iop_And1 and Iop_Or1

5 years agobb_to_IR(): Avoid causing spurious SIGILL-diagnostic messages ..
Julian Seward [Fri, 22 Nov 2019 18:27:43 +0000 (19:27 +0100)] 
bb_to_IR(): Avoid causing spurious SIGILL-diagnostic messages ..

.. when speculating into conditional-branch destinations.  A simple change
requiring a big comment explaining the rationale.

5 years agoImplement And1 and Or1 for the x86 insn selector.
Julian Seward [Fri, 22 Nov 2019 07:32:03 +0000 (08:32 +0100)] 
Implement And1 and Or1 for the x86 insn selector.

5 years agoTidy up ir_opt.c aspects relating to the 'grail' work. In particular:
Julian Seward [Thu, 21 Nov 2019 19:03:47 +0000 (20:03 +0100)] 
Tidy up ir_opt.c aspects relating to the 'grail' work.  In particular:

* Rewrite do_minimal_initial_iropt_BB so it doesn't do full constant folding;
  that is unnecessary expense at this point, and later passes will do it
  anyway

* do_iropt_BB: don't flatten the incoming block, because
  do_minimal_initial_iropt_BB will have run earlier and done so.  But at least
  for the moment, assert that it really is flat.

* VEX/priv/guest_generic_bb_to_IR.c create_self_checks_as_needed: generate
  flat IR so as not to fail the abovementioned assertion.

I believe this completes the target-independent aspects of this work, and also
the x86_64 specifics (of which there are very few).

5 years agoAdd statistics printing for the new trace construction algorithm.
Julian Seward [Thu, 21 Nov 2019 07:55:43 +0000 (08:55 +0100)] 
Add statistics printing for the new trace construction algorithm.

5 years agoAdd a change that should have been part of 6e4db6e9172a55a983105c8e73c89987ce97308a.
Julian Seward [Tue, 19 Nov 2019 07:20:31 +0000 (08:20 +0100)] 
Add a change that should have been part of 6e4db6e9172a55a983105c8e73c89987ce97308a.

5 years agoRationalise --vex-guest* flags in the new IRSB construction framework
Julian Seward [Mon, 18 Nov 2019 18:12:49 +0000 (19:12 +0100)] 
Rationalise --vex-guest* flags in the new IRSB construction framework

* removes --vex-guest-chase-cond=no|yes.  This was never used in practice.

* rename --vex-guest-chase-thresh=<0..99> to --vex-guest-chase=no|yes.  In
  otherwords, downgrade it from a numeric flag to a boolean one, that can
  simply disable all chasing if required.  (Some tools, notably Callgrind,
  force-disable block chasing, so this functionality at least needs to be
  retained).

5 years agoinsn_has_no_other_exits_or_PUTs_to_PC: also check Ist_PutI and Ist_Dirty for writes...
Julian Seward [Wed, 13 Nov 2019 14:45:11 +0000 (15:45 +0100)] 
insn_has_no_other_exits_or_PUTs_to_PC: also check Ist_PutI and Ist_Dirty for writes to the PC.

5 years agoanalyse_block_end: tidy this up ..
Julian Seward [Tue, 12 Nov 2019 19:16:54 +0000 (20:16 +0100)] 
analyse_block_end: tidy this up ..

.. and check more carefully for unexpected control flow in the blocks being
analysed.

5 years agoiselFltExpr_wrk: handle Iex_ITE, presumably caused by newly-created guarding machinery.
Julian Seward [Mon, 11 Nov 2019 16:06:54 +0000 (17:06 +0100)] 
iselFltExpr_wrk: handle Iex_ITE, presumably caused by newly-created guarding machinery.

5 years agoClean up machinery to do with conditionalising IRStmts:
Julian Seward [Mon, 11 Nov 2019 15:11:20 +0000 (16:11 +0100)] 
Clean up machinery to do with conditionalising IRStmts:

* document some functions

* change naming and terminology from 'speculation' (which it isn't)
  to 'guarding' (which it is)

* add a new function |primopMightTrap| so as to avoid conditionalising
  IRExprs involving potentially trappy IROps

5 years agoInitial implementation of C-source-level &&-idiom recovery
Julian Seward [Mon, 21 Oct 2019 09:19:59 +0000 (11:19 +0200)] 
Initial implementation of C-source-level &&-idiom recovery

This branch contains code which avoids Memcheck false positives resulting from
gcc and clang creating branches on uninitialised data.  For example:

   bool isClosed;
   if (src.isRect(..., &isClosed, ...) && isClosed) {

clang9 -O2 compiles this as:

   callq  7e7cdc0 <_ZNK6SkPath6isRectEP6SkRectPbPNS_9DirectionE>

   cmpb   $0x0,-0x60(%rbp)  // "if (isClosed) { .."
   je     7ed9e08           // "je after"

   test   %al,%al           // "if (return value of call is nonzero) { .."
   je     7ed9e08           // "je after"

   ..
   after:

That is, the && has been evaluated right-to-left.  This is a correct
transformation if the compiler can prove that the call to |isRect| returns
|false| along any path on which it does not write its out-parameter
|&isClosed|.

In general, for the lazy-semantics (L->R) C-source-level && operator, we have
|A && B| == |B && A| if you can prove that |B| is |false| whenever A is
undefined.  I assume that clang has some kind of interprocedural analysis that
tells it that.  The compiler is further obliged to show that |B| won't trap,
since it is now being evaluated speculatively, but that's no big deal to
prove.

A similar result holds, per de Morgan, for transformations involving the C
language ||.

Memcheck correctly handles bitwise &&/|| in the presence of undefined inputs.
It has done so since the beginning.  However, it assumes that every
conditional branch in the program is important -- any branch on uninitialised
data is an error.  However, this idiom demonstrates otherwise.  It defeats
Memcheck's existing &&/|| handling because the &&/|| is spread across two
basic blocks, rather than being bitwise.

This initial commit contains a complete initial implementation to fix that.
The basic idea is to detect the && condition spread across two blocks, and
transform it into a single block using bitwise &&.  Then Memcheck's existing
accurate instrumentation of bitwise && will correctly handle it.  The
transformation is

   <contents of basic block A>
   C1 = ...
   if (!C1) goto after
   .. falls through to ..

   <contents of basic block B>
   C2 = ...
   if (!C2) goto after
   .. falls through to ..

   after:

 ===>

   <contents of basic block A>
   C1 = ...
   <contents of basic block B, conditional on C1>
   C2 = ...
   if (!C1 && !C2) goto after
   .. falls through to ..

   after:

This assumes that <contents of basic block B> can be conditionalised, at the
IR level, so that the guest state is not modified if C1 is |false|.  That's
not possible for all IRStmt kinds, but it is possible for a large enough
subset to make this transformation feasible.

There is no corresponding transformation that recovers an || condition,
because, per de Morgan, that merely corresponds to swapping the side exits vs
fallthoughs, and inverting the sense of the tests, and the pattern-recogniser
as implemented checks all possible combinations already.

The analysis and block-building is performed on the IR returned by the
architecture specific front ends.  So they are almost not modified at all: in
fact they are simplified because all logic related to chasing through
unconditional and conditional branches has been removed from them, redone at
the IR level, and centralised.

The only file with big changes is the IRSB constructor logic,
guest_generic_bb_to_IR.c (a.k.a the "trace builder").  This is a complete
rewrite.

There is some additional work for the IR optimiser (ir_opt.c), since that
needs to do a quick initial simplification pass of the basic blocks, in order
to reduce the number of different IR variants that the trace-builder has to
pattern match on.  An important followup task is to further reduce this cost.

There are two new IROps to support this: And1 and Or1, which both operate on
Ity_I1.  They are regarded as evaluating both arguments, consistent with AndXX
and OrXX for all other sizes.  It is possible to synthesise at the IR level by
widening the value to Ity_I8 or above, doing bitwise And/Or, and re-narrowing
it, but this gives inefficient code, so I chose to represent them directly.

The transformation appears to work for amd64-linux.  In principle -- because
it operates entirely at the IR level -- it should work for all targets,
providing the initial pre-simplification pass can normalise the block ends
into the required form.  That will no doubt require some tuning.  And1 and Or1
will have to be implemented in all instruction selectors, but that's easy
enough.

Remaining FIXMEs in the code:

* Rename `expr_is_speculatable` et al to `expr_is_conditionalisable`.  These
  functions merely conditionalise code; the speculation has already been done
  by gcc/clang.

* `expr_is_speculatable`: properly check that Iex_Unop/Binop don't contain
  operatins that might trap (Div, Rem, etc).

* `analyse_block_end`: recognise all block ends, and abort on ones that can't
  be recognised.  Needed to ensure we don't miss any cases.

* maybe: guest_amd64_toIR.c: generate better code for And1/Or1

* ir_opt.c, do_iropt_BB: remove the initial flattening pass since presimp
  will already have done it

* ir_opt.c, do_minimal_initial_iropt_BB (a.k.a. presimp).  Make this as
  cheap as possible.  In particular, calling `cprop_BB_wrk` is total overkill
  since we only need copy propagation.

* ir_opt.c: once the above is done, remove boolean parameter for `cprop_BB_wrk`.

* ir_opt.c: concatenate_irsbs: maybe de-dup w.r.t. maybe_unroll_loop_BB.

* remove option `guest_chase_cond` from VexControl (?).  It was never used.

* convert option `guest_chase_thresh` from VexControl (?) into a Bool, since
the revised code here only cares about the 0-vs-nonzero distinction now.

5 years agoUpdate following recent bug-fix commits.
Julian Seward [Thu, 2 Jan 2020 05:34:52 +0000 (06:34 +0100)] 
Update following recent bug-fix commits.

5 years agomips: update tests to compile for nanoMIPS
Petar Jovanovic [Tue, 31 Dec 2019 15:56:23 +0000 (15:56 +0000)] 
mips: update tests to compile for nanoMIPS

Update the tests so they can be compiled for nanoMIPS.

Patch by Dimitrije Nikolic and Aleksandra Karadzic.

5 years agoupdate .gitignore with /none/tests/sigprocmask
Petar Jovanovic [Tue, 31 Dec 2019 12:09:34 +0000 (12:09 +0000)] 
update .gitignore with /none/tests/sigprocmask

Add
  /none/tests/sigprocmask

to .gitignore.

5 years agomips: Add nanoMIPS support to Valgrind 4/4
Petar Jovanovic [Tue, 31 Dec 2019 12:05:33 +0000 (12:05 +0000)] 
mips: Add nanoMIPS support to Valgrind 4/4

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.

5 years agomips: Add nanoMIPS support to Valgrind 3/4
Petar Jovanovic [Tue, 31 Dec 2019 09:44:42 +0000 (09:44 +0000)] 
mips: Add nanoMIPS support to Valgrind 3/4

Necessary changes to support nanoMIPS on Linux.

Part 3/4 - Coregrind and tools changes

Patch by Aleksandar Rikalo, Dimitrije Nikolic, Tamara Vlahovic,
Nikola Milutinovic and Aleksandra Karadzic.

Related KDE issue: #400872.

5 years agoBug 411451 - amd64->IR of bt/btc/bts/btr with immediate clears zero flag.
Julian Seward [Mon, 30 Dec 2019 10:43:42 +0000 (11:43 +0100)] 
Bug 411451 - amd64->IR of bt/btc/bts/btr with immediate clears zero flag.

Patch from baumratte@outlook.com.

5 years agoBug 413119 - ioctl wrapper for DRM_IOCTL_I915_GEM_MMAP.
Julian Seward [Mon, 30 Dec 2019 10:23:32 +0000 (11:23 +0100)] 
Bug 413119 - ioctl wrapper for DRM_IOCTL_I915_GEM_MMAP.

Patches from Simon Richter <Simon.Richter@hogyros.de>.

5 years agoBug 410556 - add support for BLKIO{MIN,OPT} and BLKALIGNOFF ioctls.
Julian Seward [Mon, 30 Dec 2019 10:13:13 +0000 (11:13 +0100)] 
Bug 410556 - add support for BLKIO{MIN,OPT} and BLKALIGNOFF ioctls.

Patch from Nick Black <dankamongmen@gmail.com>.

5 years agoBug 409206 - Support for Linux PPS and PTP ioctls.
Julian Seward [Mon, 30 Dec 2019 10:03:19 +0000 (11:03 +0100)] 
Bug 409206 - Support for Linux PPS and PTP ioctls.

Patches from Miroslav Lichvar <mlichvar@redhat.com>.

5 years agoComplete initial triage pass.
Julian Seward [Sat, 28 Dec 2019 19:30:39 +0000 (20:30 +0100)] 
Complete initial triage pass.

5 years agoFirst pass at creating a list of bugs reported in 3.15.0, that are as yet un-fixed.
Julian Seward [Sat, 28 Dec 2019 09:41:35 +0000 (10:41 +0100)] 
First pass at creating a list of bugs reported in 3.15.0, that are as yet un-fixed.

5 years agoCreate docs/internals/3_15_BUGSTATUS.txt, as-yet empty.
Julian Seward [Fri, 27 Dec 2019 15:22:25 +0000 (16:22 +0100)] 
Create docs/internals/3_15_BUGSTATUS.txt, as-yet empty.

5 years agosyswrap-linux.c: fix the wrapper for ioctl(SIOCETHTOOL), case ETHTOOL_GSET. n-i-bz.
Julian Seward [Fri, 27 Dec 2019 15:20:32 +0000 (16:20 +0100)] 
syswrap-linux.c: fix the wrapper for ioctl(SIOCETHTOOL), case ETHTOOL_GSET.  n-i-bz.

For the case ETHTOOL_GSET, don't insist that the whole structure is defined.
That appears to cause false positives.  All other cases remain unchanged.

5 years agoBug 413634 - ARMv8.1 arithmetic instructions are not supported
Julian Seward [Fri, 27 Dec 2019 14:30:21 +0000 (15:30 +0100)] 
Bug 413634 - ARMv8.1 arithmetic instructions are not supported

Patch from Assad Hashmi <assad.hashmi@linaro.org>.

This patch adds support for AArch64 ARMv8.1 SIMD instructions:
SQRDMLAH <V><d>, <V><n>, <V><m>
SQRDMLAH <Vd>.<T>, <Vn>.<T>, <Vm>.<T>
SQRDMLAH <V><d>, <V><n>, <Vm>.<Ts>[<index>]
SQRDMLAH <Vd>.<T>, <Vn>.<T>, <Vm>.<Ts>[<index>]
SQRDMLSH <V><d>, <V><n>, <V><m>
SQRDMLSH <Vd>.<T>, <Vn>.<T>, <Vm>.<T>
SQRDMLSH <V><d>, <V><n>, <Vm>.<Ts>[<index>]
SQRDMLSH <Vd>.<T>, <Vn>.<T>, <Vm>.<Ts>[<index>]

5 years agonone/tests: Add test for bz414565.
Alexandra Hájková [Mon, 16 Dec 2019 14:58:26 +0000 (15:58 +0100)] 
none/tests: Add test for bz414565.

Integrate the test case written by Nikola Milutinovic to the
testsuite. (https://bugs.kde.org/show_bug.cgi?id=414565)

5 years agosigprocmask should ignore HOW argument when SET is NULL.
Nikola Milutinovic [Sun, 22 Dec 2019 14:49:04 +0000 (15:49 +0100)] 
sigprocmask should ignore HOW argument when SET is NULL.

Specific use case bug found in SysRes VG_(do_sys_sigprocmask).

Fix for case when ,,set,, parameter is NULL.
In this case ,,how,, parameter should be ignored because we are
only requesting from kernel to put current signal mask into ,,oldset,,.
But instead we determine the action based on ,,how,, parameter and
therefore make the system call fail when it should pass.
Taken from linux man pages (sigprocmask).

The same is specified for POSIX.

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

5 years agomips: define PLAT_mips32_linux if __mips==32
Petar Jovanovic [Tue, 17 Dec 2019 17:08:40 +0000 (17:08 +0000)] 
mips: define PLAT_mips32_linux if __mips==32

Define PLAT_mips32_linux if __mips==32 rather than if __mips!=64.

Patch by Rosen Penev <rosenp@gmail.com>.

5 years agos390x: Fix offsets in comments to VexGuestS390XState
Andreas Arnez [Thu, 5 Dec 2019 17:22:43 +0000 (18:22 +0100)] 
s390x: Fix offsets in comments to VexGuestS390XState

Each member of the structure declaration for `VexGuestS390XState' is
commented with its offset within the structure.  But starting with
`guest_r0' and for all remaining members, these comments indicate the
wrong offsets, and the actual offsets are 8 bytes higher.  Adjust the
comments accordingly.

5 years agomips64: use generic Linux wrapper for sys_unshare
Petar Jovanovic [Wed, 27 Nov 2019 13:32:57 +0000 (13:32 +0000)] 
mips64: use generic Linux wrapper for sys_unshare

No need for mips64-specific Linux wrappers for sys_unshare.

5 years agomips: enable sloppyXcheck for mips32 and mips64
Petar Jovanovic [Wed, 27 Nov 2019 12:22:46 +0000 (12:22 +0000)] 
mips: enable sloppyXcheck for mips32 and mips64

Newer mips kernels (post 4.7.0) assign execute permissions to loadable
program segments which originally did not have them as per the
information provided in the elf file itself.

Include mips32/mips64 in the list of architectures for which the address
space manager should allow the kernel to report execute permissions in
sync_check_mapping_callback.

Patch by Stefan Maksimovic.

5 years agomips: add ld-linux-mipsn8.so.1 as a valid soname
Petar Jovanovic [Wed, 27 Nov 2019 12:00:43 +0000 (12:00 +0000)] 
mips: add ld-linux-mipsn8.so.1 as a valid soname

NaN2008 dynamic linker is named ld-linux-mipsn8.so.1.

Update include/pub_tool_redir.h by adding ld-linux-mipsn8.so.1 to the list
of sonames with an accompanying check in coregrind/m_redir.c.

Patch by Stefan Maksimovic.

5 years agoupdate .gitignore with /none/tests/amd64/avx_estimate_insn
Petar Jovanovic [Tue, 26 Nov 2019 13:33:15 +0000 (13:33 +0000)] 
update .gitignore with /none/tests/amd64/avx_estimate_insn

Add
  /none/tests/amd64/avx_estimate_insn

to .gitignore.

5 years agomips32: hook up adjtimex syscall
Petar Jovanovic [Tue, 26 Nov 2019 13:25:19 +0000 (13:25 +0000)] 
mips32: hook up adjtimex syscall

Hook up adjtimex syscall for mips32.

This fixes adjtimex01 failure in the LTP test suite.

5 years agomips32: hook up getcpu syscall
Petar Jovanovic [Tue, 26 Nov 2019 13:19:45 +0000 (13:19 +0000)] 
mips32: hook up getcpu syscall

Hook up getcpu syscall for mips32.

This fixes getcpu01 failure in the LTP test suite.

5 years agomips32: hook up waitid syscall
Petar Jovanovic [Tue, 26 Nov 2019 13:10:47 +0000 (13:10 +0000)] 
mips32: hook up waitid syscall

Hook up waitid syscall for mips32.

This fixes waitid01 failure in the LTP test suite.

5 years agomips64: ensure that either n64 or n32 ABI are set
Petar Jovanovic [Tue, 26 Nov 2019 11:51:28 +0000 (11:51 +0000)] 
mips64: ensure that either n64 or n32 ABI are set

Set the ABI to n64 or n32, in that order, in case the compiler is capable
but it is configured for o32 by default.

Patch by Stefan Maksimovic.

5 years agonone/tests/arm64/Makefile.am: Add atomics_v81 only conditionally
Mark Wielaard [Thu, 21 Nov 2019 09:32:43 +0000 (10:32 +0100)] 
none/tests/arm64/Makefile.am: Add atomics_v81 only conditionally

The atomics_v81 was added twice to check_PROGRAMS.
It should only be added when BUILD_ARMV81_TESTS is set.

5 years agoBug 369509 - ARMv8.1-a LSE instructions are not supported.
Julian Seward [Wed, 20 Nov 2019 11:43:54 +0000 (12:43 +0100)] 
Bug 369509 - ARMv8.1-a LSE instructions are not supported.

This patch adds support for AArch64 ARMv8.1 LSE instructions.

Patch from Assad Hashmi <assad.hashmi@linaro.org>.

5 years agomips64: upgrade parts of valgrind's fast cache for the n32 abi
Petar Jovanovic [Thu, 14 Nov 2019 12:32:50 +0000 (12:32 +0000)] 
mips64: upgrade parts of valgrind's fast cache for the n32 abi

Update the list of architectures to differentiate between the n32 and n64 abi
for mips64 when defining the fast cache macros in
coregrind/pub_core_transtab_asm.h.

Also amend the VG_(disp_cp_xindir) function in
coregrind/m_dispatch/dispatch-mips64-linux.S to use word-sized loads in case
of the n32 abi since the FastCacheSet structure members are now 4 bytes in
size for mips64 n32.

Patch by Stefan Maksimovic.

5 years agofix avx-1 amd64 test
Alexandra Hájková [Mon, 11 Nov 2019 13:30:26 +0000 (14:30 +0100)] 
fix avx-1 amd64 test

The estimate instructions (rcpss, rcpps, rsqrtps, rsqrtss) are, as the
name suggests, not expected to give a fully accurate result. They may
produce slighly different results on different CPU families because
their results are not defined by the IEEE standard.  This is the
reason avx-1 test fails on amd now.

This patch assumes there are only two implementations, the intel and
amd one.  It moves these estimate instructions out of avx-1 and into
their own testcase - avx_estimate_insn and creates two different .exp
files for intel and amd.

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

5 years agoRepair --px-file-backed broken due to dynamic option change.
Philippe Waroquiers [Mon, 11 Nov 2019 21:22:46 +0000 (22:22 +0100)] 
Repair --px-file-backed broken due to dynamic option change.

The commit 3a803036f7 (Allow the user to change a set of command line options
during execution) removed by mistake the code handling the option
--px-file-backed.

Add it back, and modify a trivialleak.vgtest to use the 'VEX registers'
options setting (and their synonym) to do a minimal verification that
the options and synonyms are accepted.
The options are specifying the default values, they should not influence
the result of the test.

Bug (and its origin) reported by Julian.

5 years agomips: fix configure issue with specific paths
Petar Jovanovic [Wed, 6 Nov 2019 16:55:11 +0000 (16:55 +0000)] 
mips: fix configure issue with specific paths

If configure is invoked with e.g.

CFLAGS='--sysroot=/workspace/linux-mips64/sysroot -mabi=64'

flags FLAG_M32 and FLAG_M64 are not set, because the grep search in
configure.ac mismatches the mips keyword in the path.

Update the grep patterns to anchor on non-word boundaries.

This fixes KDE #412344.

Patch by Chris Packham.

5 years agoAnnounce in NEWS the fix for 413603 - callgrind_annotate/cg_annotate truncate functio...
Philippe Waroquiers [Sun, 3 Nov 2019 16:45:27 +0000 (17:45 +0100)] 
Announce in NEWS the fix for 413603 - callgrind_annotate/cg_annotate truncate function names at '#'

5 years agocallgrind_annotate, cg_annotate: don't truncate function names at '#'
Andreas Arnez [Wed, 23 Oct 2019 18:35:50 +0000 (20:35 +0200)] 
callgrind_annotate, cg_annotate: don't truncate function names at '#'

C++ function names can contain substrings like "{lambda()#1}".  But
callgrind_annotate and cg_annotate interpret the '#'-character as a
comment marker anywhere on each input line, and thus truncate such names
there.

On the other hand, the documentation in docs/cl-format.xml, states:

  Everywhere, comments on own lines starting with '#' are allowed.

This seems to imply that a comment line must start with '#' in the first
column.  Thus skip exactly such lines in the input file and don't handle
'#' as a comment marker anywhere else.

Signed-off-by: Philippe Waroquiers <philippe.waroquiers@skynet.be>
5 years agoHave callgrind producing event: lines before events: line.
Philippe Waroquiers [Sun, 3 Nov 2019 16:09:54 +0000 (17:09 +0100)] 
Have callgrind producing event: lines before events: line.

callgrind_annotate expects the 'events:' line to be the last line
of the header of a Part.

When event: lines are after the events: line, these event: lines are
handled by the calllgrind_annotate body line logic, that does not recognises
them and generates warnings such as:
  WARNING: line 18 malformed, ignoring
      line: 'event: sysTime : sysTime (elapsed ns)'
  WARNING: line 19 malformed, ignoring
      line: 'event: sysCpuTime : sysCpuTime (system cpu ns)'

So, output event: lines before events: line.

5 years agoconfigure.ac: automatically detect xcode path
James Hilliard [Tue, 8 Oct 2019 15:54:46 +0000 (17:54 +0200)] 
configure.ac: automatically detect xcode path

This should fix build errors due to /usr/include not existing.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
5 years agoRemove some trailing whitespaces ...
Philippe Waroquiers [Sat, 19 Oct 2019 15:47:35 +0000 (17:47 +0200)] 
Remove some trailing whitespaces ...

5 years agoEnhance callgrind option --collect-system.
Philippe Waroquiers [Thu, 10 Oct 2019 19:42:01 +0000 (21:42 +0200)] 
Enhance callgrind option --collect-system.

  - The command option --collect-systime has been enhanced to specify
    the unit used to record the elapsed time spent during system calls.
    The command option now accepts the values no|yes|msec|usec|nsec,
    where yes is a synonym of msec.  When giving the value nsec, the
    system cpu time of system calls is also recorded.

Note that the nsec option is not supported on Darwin.

5 years agoxb monitor command: fix adressability for first byte of a line
Philippe Waroquiers [Sat, 28 Sep 2019 20:18:23 +0000 (22:18 +0200)] 
xb monitor command: fix adressability for first byte of a line

The addressability of the first byte of a new line was used for the first
byte of the previous line.

Fix by first outputting the line, then getting the addressability of
the first byte of the new line.

5 years agomips64: add missing syscall values for N32
Petar Jovanovic [Thu, 26 Sep 2019 15:21:34 +0000 (15:21 +0000)] 
mips64: add missing syscall values for N32

Add missing syscall values for N32.
This fixes build issue with MIPS64 N32.

5 years agomips64: fix do_syscall_WRK for N32
Petar Jovanovic [Thu, 26 Sep 2019 15:18:34 +0000 (15:18 +0000)] 
mips64: fix do_syscall_WRK for N32

Load correctly pointer to V1_A3_val on N32.

Patch by Stefan Maksimovic.

5 years agoinclude/vki: fix vki_siginfo_t definition on amd64, arm64, and ppc64
Eugene Syromyatnikov [Fri, 8 Mar 2019 03:07:00 +0000 (04:07 +0100)] 
include/vki: fix vki_siginfo_t definition on amd64, arm64, and ppc64

As it turned out, the size of vki_siginfo_t is incorrect on these 64-bit
architectures:

    (gdb) p sizeof(vki_siginfo_t)
    $1 = 136
    (gdb) ptype struct vki_siginfo
    type = struct vki_siginfo {
        int si_signo;
        int si_errno;
        int si_code;
        union {
            int _pad[29];
            struct {...} _kill;
            struct {...} _timer;
            struct {...} _rt;
            struct {...} _sigchld;
            struct {...} _sigfault;
            struct {...} _sigpoll;
        } _sifields;
    }

It looks like that for this architecture, __VKI_ARCH_SI_PREAMBLE_SIZE
hasn't been defined properly, which resulted in incorrect
VKI_SI_PAD_SIZE calculation (29 instead of 28).

    <6a9e4>   DW_AT_name        : (indirect string, offset: 0xcf59): _sifields
    <6a9ef>   DW_AT_data_member_location: 16

This issue has been discovered with strace's "make check-valgrind-memcheck",
which produced false out-of-bounds writes on ptrace(PTRACE_GETSIGINFO) calls:

    SYSCALL[24264,1](101) sys_ptrace ( 16898, 24283, 0x0, 0x606bd40 )
    ==24264== Syscall param ptrace(getsiginfo) points to unaddressable byte(s)
    ==24264==    at 0x575C06E: ptrace (ptrace.c:45)
    ==24264==    by 0x443244: next_event (strace.c:2431)
    ==24264==    by 0x443D30: main (strace.c:2845)
    ==24264==  Address 0x606bdc0 is 0 bytes after a block of size 144 alloc'd

(Note that the address passed is 0x606bd40 and the address reported is
0x606bdc0).

After the patch, no such errors observed.

* include/vki/vki-amd64-linux.h [__x86_64__ && __ILP32__]
(__vki_kernel_si_clock_t): New typedef.
[__x86_64__ && __ILP32__] (__VKI_ARCH_SI_CLOCK_T,
__VKI_ARCH_SI_ATTRIBUTES): New macros.
[__x86_64__ && !__ILP32__] (__VKI_ARCH_SI_PREAMBLE_SIZE): New macro,
define to 4 ints.
* include/vki/vki-arm64-linux.h (__VKI_ARCH_SI_PREAMBLE_SIZE): Likewise.
* include/vki/vki-ppc64-linux.h [__powerpc64__] (__VKI_ARCH_SI_PREAMBLE_SIZE):
Likewise.
* include/vki/vki-linux.h [!__VKI_ARCH_SI_CLOCK_T]
(__VKI_ARCH_SI_CLOCK_T): New macro, define to vki_clock_t.
[!__VKI_ARCH_SI_ATTRIBUTES] (__VKI_ARCH_SI_ATTRIBUTES): New macro,
define to nil.
(struct vki_siginfo): Use __VKI_ARCH_SI_CLOCK_T type for _utime and
_stime fields.  Add __VKI_ARCH_SI_ATTRIBUTES.

Resolves: https://bugs.kde.org/show_bug.cgi?id=405201
Reported-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
5 years agoHave VG_(is_in_syscall) return False if no syscall was done yet.
Philippe Waroquiers [Tue, 10 Sep 2019 20:47:58 +0000 (22:47 +0200)] 
Have VG_(is_in_syscall) return False if no syscall was done yet.

As when no syscall was done yet, the syscallInfo pointer is still null,
we return False if this is null, rather than SEGV due to null ptr.

This can at least happen when reporting the scheduler status before
the first syscall was done.

5 years agoremove CRLF line terminators from several files
Petar Jovanovic [Tue, 3 Sep 2019 12:20:10 +0000 (12:20 +0000)] 
remove CRLF line terminators from several files

Convert from dos to unix text files:

./none/tests/amd64-linux/cet_nops_fs.c
./none/tests/amd64-linux/cet_nops_gs.c
./none/tests/mips32/mips32_dspr2.c
./none/tests/mips32/mips32_dsp.c

5 years agomips: Add nanoMIPS support to Valgrind 2/4
Petar Jovanovic [Tue, 3 Sep 2019 11:55:56 +0000 (11:55 +0000)] 
mips: Add nanoMIPS support to Valgrind 2/4

Necessary changes to support nanoMIPS on Linux.

Part 2/4 - Coregrind changes

Patch by Aleksandar Rikalo, Dimitrije Nikolic, Tamara Vlahovic and
Aleksandra Karadzic.

Related KDE issue: #400872.

5 years agoAnnounce fix 411134 Allow the user to change a set of command line options during...
Philippe Waroquiers [Sat, 31 Aug 2019 13:15:26 +0000 (15:15 +0200)] 
Announce fix 411134  Allow the user to change a set of command line options during execution

Note that the fix for 411134 contains a bunch of white space only changes.
To see the diff without the white spaces, do:
  git diff -w 3a803036^..3a803036

5 years agoAllow the user to change a set of command line options during execution.
Philippe Waroquiers [Wed, 21 Aug 2019 12:33:39 +0000 (14:33 +0200)] 
Allow the user to change a set of command line options during execution.

This patch changes the option parsing framework to allow a set of
core or tool (currently only memcheck) options to be changed dynamically.

Here is a summary of the new functionality (extracted from NEWS):
* It is now possible to dynamically change the value of many command
  line options while your program (or its children) are running under
  Valgrind.
  To have the list of dynamically changeable options, run
     valgrind --help-dyn-options
  You can change the options from the shell by using vgdb to launch
  the monitor command "v.clo <clo option>...".
  The same monitor command can be used from a gdb connected
  to the valgrind gdbserver.
  Your program can also change the dynamically changeable options using
  the client request VALGRIND_CLO_CHANGE(option).

Here is a brief description of the code changes.
* the command line options parsing macros are now checking a 'parsing' mode
  to decide if the given option must be handled or not.
  (more about the parsing mode below).

* the 'main' command option parsing code has been split in a function
  'process_option' that can be called now by:
     - early_process_cmd_line_options
        (looping over args, calling process_option in mode "Early")
     - main_process_cmd_line_options
        (looping over args, calling process_option in mode "Processing")
     - the new function VG_(process_dynamic_option) called from
       gdbserver or from VALGRIND_CLO_CHANGE (calling
        process_option in mode "Dynamic" or "Help")

* So, now, during startup, process_option is called twice for each arg:
   - once during Early phase
   - once during normal Processing
  Then process_option can then be called again during execution.

So, the parsing mode is defined so that the option parsing code
behaves differently (e.g. allows or not to handle the option)
depending on the mode.

// Command line option parsing happens in the following modes:
//   cloE : Early processing, used by coregrind m_main.c to parse the
//      command line  options that must be handled early on.
//   cloP : Processing,  used by coregrind and tools during startup, when
//      doing command line options Processing.
//   clodD : Dynamic, used to dynamically change options after startup.
//      A subset of the command line options can be changed dynamically
//      after startup.
//   cloH : Help, special mode to produce the list of dynamically changeable
//      options for --help-dyn-options.
typedef
   enum {
      cloE = 1,
      cloP = 2,
      cloD = 4,
      cloH = 8
   } Clo_Mode;

The option parsing macros in pub_tool_options.h have now all a new variant
*_CLOM with the mode(s) in which the given option is accepted.
The old variant is kept and calls the new variant with mode cloP.
The function VG_(check_clom) in the macro compares the current mode
with the modes allowed for the option, and returns True if qq_arg
should be further processed.

For example:

// String argument, eg. --foo=yes or --foo=no
   (VG_(check_clom)                                                     \
    (qq_mode, qq_arg, qq_option,                                        \
     VG_STREQN(VG_(strlen)(qq_option)+1, qq_arg, qq_option"=")) &&      \
    ({const HChar* val = &(qq_arg)[ VG_(strlen)(qq_option)+1 ];         \
      if      VG_STREQ(val, "yes") (qq_var) = True;                     \
      else if VG_STREQ(val, "no")  (qq_var) = False;                    \
      else VG_(fmsg_bad_option)(qq_arg, "Invalid boolean value '%s'"    \
                                " (should be 'yes' or 'no')\n", val);   \
      True; }))

   VG_BOOL_CLOM(cloP, qq_arg, qq_option, qq_var)

To make an option dynamically excutable, it is typically enough to replace
    VG_BOOL_CLO(...)
by
    VG_BOOL_CLOM(cloPD, ...)

For example:
-   else if VG_BOOL_CLO(arg, "--show-possibly-lost", tmp_show) {
+   else if VG_BOOL_CLOM(cloPD, arg, "--show-possibly-lost", tmp_show) {

cloPD means the option value is set/changed during the main command
Processing (P) and Dynamically during execution (D).

Note that the 'body/further processing' of a command is only executed when
the option is recognised and the current parsing mode is ok for this option.

5 years agoarm64 fixup for statx support on older kernels
Mark Wielaard [Fri, 23 Aug 2019 20:17:57 +0000 (22:17 +0200)] 
arm64 fixup for statx support on older kernels

Turns out (older) arm64 linux kernels don't have statx, but also not
stat64 and no stat syscalls.  It uses fstatat instead. The new statx
patch also added a check for stat.  So That needs a special case for
arm64.

Follow up for bug #400593.

5 years agomips: Add nanoMIPS support to Valgrind 1/4
Petar Jovanovic [Wed, 21 Aug 2019 16:08:42 +0000 (16:08 +0000)] 
mips: Add nanoMIPS support to Valgrind 1/4

Necessary changes to support nanoMIPS on Linux.

Part 1/4 - VEX changes

Patch by Aleksandar Rikalo, Dimitrije Nikolic, Tamara Vlahovic and
Aleksandra Karadzic.

nanoMIPS architecture in brief

Designed for embedded devices, nanoMIPS is a variable lengths instruction
set architecture (ISA) offering high performance in substantially reduced
code size.

The nanoMIPS ISA combines recoded and new 16-, 32-, and 48-bit instructions
to achieve an ideal balance of performance and code density.
It incorporates all MIPS32 instructions and architecture modules including
MIPS DSP and MIPS MT, as well as new instructions for advanced code size
reduction.

nanoMIPS is supported in release 6 of the MIPS architecture. It is first
implemented in the new MIPS I7200 multi-threaded multi-core processor
series. Compiler support is included in the MIPS GNU-based development
tools.

Related KDE issue: #400872.

5 years agomips32: hook up vmsplice syscall
Petar Jovanovic [Wed, 21 Aug 2019 12:47:11 +0000 (12:47 +0000)] 
mips32: hook up vmsplice syscall

Hook up vmsplice syscall for mips32.

This fixes vmsplice01 failure in the LTP test suite.

5 years agomips32: hook up vhangup syscall
Petar Jovanovic [Tue, 20 Aug 2019 13:30:45 +0000 (13:30 +0000)] 
mips32: hook up vhangup syscall

Hook up vhangup syscall for mips32.

This fixes vhangup01 in the LTP test suite.

5 years agomips32: hook up utimes syscall
Petar Jovanovic [Tue, 20 Aug 2019 13:17:02 +0000 (13:17 +0000)] 
mips32: hook up utimes syscall

Hook up utimes syscall for mips32.

This fixes utimes01 in the LTP test suite.

5 years agomips32: hook up unshare syscall
Petar Jovanovic [Tue, 20 Aug 2019 12:41:59 +0000 (12:41 +0000)] 
mips32: hook up unshare syscall

Hook up unshare syscall for mips32.

This fixes unshare02 in the LTP test suite.

5 years agomips32: hook up truncate64 syscall
Petar Jovanovic [Tue, 20 Aug 2019 12:29:57 +0000 (12:29 +0000)] 
mips32: hook up truncate64 syscall

Hook up truncate64 syscall for mips32.

This helps truncate02_64 and several other tests pass without warnings in
the LTP test suite.

5 years agomips32: hook up getitimer syscall
Petar Jovanovic [Mon, 19 Aug 2019 17:37:17 +0000 (17:37 +0000)] 
mips32: hook up getitimer syscall

Hook up getitimer syscall for mips32.

This fixes getitimer01 and several other tests in the LTP test suite.

5 years agomips32: hook up sethostname syscall
Petar Jovanovic [Mon, 19 Aug 2019 17:23:58 +0000 (17:23 +0000)] 
mips32: hook up sethostname syscall

Hook up sethostname syscall for mips32.

This fixes sethostname01 and several other tests in the LTP test suite.

5 years agoupdate NEWS with fix for #400593
Petar Jovanovic [Mon, 19 Aug 2019 14:38:34 +0000 (14:38 +0000)] 
update NEWS with fix for #400593

The KDE issue #400593 has been fixed in

  commit c6a6cf929f3e2a9bf5d7f09f334ed4d67f2d6e18
  Use statx rather than other stat system calls

5 years agoBug 400538 - vex amd64->IR: unhandled instruction bytes: 0x48 0xCF (IRETQ).
Julian Seward [Mon, 19 Aug 2019 14:03:01 +0000 (16:03 +0200)] 
Bug 400538 - vex amd64->IR: unhandled instruction bytes: 0x48 0xCF (IRETQ).

Patch from Daniel Lehman <dlehman25@gmail.com>.

5 years agoFix README_DEVELOPERS tool executable in debugging instruction examples.
Philippe Waroquiers [Sun, 18 Aug 2019 22:26:18 +0000 (00:26 +0200)] 
Fix README_DEVELOPERS tool executable in debugging instruction examples.

5 years agoFix compilation problem when __NR_preadv2 __NR_pwritev2 are undefined
Philippe Waroquiers [Sat, 17 Aug 2019 16:27:22 +0000 (18:27 +0200)] 
Fix compilation problem when __NR_preadv2 __NR_pwritev2 are undefined

check_preadv2_pwritev2.c: In function ‘main’:
check_preadv2_pwritev2.c:12:12: error: ‘__NR_preadv2’ undeclared (first use in this function)
    syscall(__NR_preadv2, 0, NULL, 0, 0, 0);
            ^
check_preadv2_pwritev2.c:12:12: note: each undeclared identifier is reported only once for each function it appears in
check_preadv2_pwritev2.c:15:12: error: ‘__NR_pwritev2’ undeclared (first use in this function)
    syscall(__NR_pwritev2, 0, NULL, 0, 0, 0);

5 years agomemcheck/tests/sys-preadv2_pwritev2: Check whether these syscalls are supported
Stefan Maksimovic [Fri, 16 Aug 2019 23:23:21 +0000 (16:23 -0700)] 
memcheck/tests/sys-preadv2_pwritev2: Check whether these syscalls are supported

[ bvanassche: changed the order of check_PROGRAMS ]

5 years agoUpdate s390x maintainership in AUTHORS
Andreas Arnez [Fri, 16 Aug 2019 18:06:53 +0000 (20:06 +0200)] 
Update s390x maintainership in AUTHORS

I have taken over maintainership of the s390x support some time ago.
Update the AUTHORS file to reflect that.

5 years agoUse statx rather than other stat system calls
Petar Jovanovic [Fri, 16 Aug 2019 15:57:50 +0000 (15:57 +0000)] 
Use statx rather than other stat system calls

*STAT* system calls other than statx are becoming deprecated.
Coregrind should use statx as the first candidate in order to achieve
"stat" functionality.

There are also systems that do not even support older "stats".

This fixes KDE #400593.

Patch by Aleksandar Rikalo.

5 years agoMake references from README_DEVELOPERS/README.solaris to README for build/install
Philippe Waroquiers [Thu, 15 Aug 2019 14:54:05 +0000 (16:54 +0200)] 
Make references from README_DEVELOPERS/README.solaris to README for build/install

If someone wants to build/install and starts in these 2 files,
a reference to the README instructions is helpful.

5 years agomips32: hook up sched_rr_get_interval syscall
Petar Jovanovic [Wed, 14 Aug 2019 15:43:10 +0000 (15:43 +0000)] 
mips32: hook up sched_rr_get_interval syscall

Hook up sched_rr_get_interval syscall for mips32.

This fixes sched_rr_get_interval01 and several other tests in the LTP test
suite.

5 years agomips32: hook up sched_setparam syscall
Petar Jovanovic [Wed, 14 Aug 2019 15:36:07 +0000 (15:36 +0000)] 
mips32: hook up sched_setparam syscall

Hook up sched_setparam syscall for mips32.

This fixes sched_setparam01 and several other tests in the LTP test suite.