]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
13 years agoFix two asserts that Coverity's checker diagnosed as having side effects.
Florian Krohm [Mon, 21 Jan 2013 13:51:21 +0000 (13:51 +0000)] 
Fix two asserts that Coverity's checker diagnosed as having side effects.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13252

13 years agoxen: Add a missing break to the handling of XEN_DOMCTL_max_vcpus
Florian Krohm [Mon, 21 Jan 2013 13:46:57 +0000 (13:46 +0000)] 
xen: Add a missing break to the handling of XEN_DOMCTL_max_vcpus
found by Coverity's checker.
Also fix another missing break XEN_SYSCTL_numainfo found by via a
by-eye check. This one is at the end of the switch so it is benign.
Patch by Ian Campbell <ian.campbell@citrix.com>.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13251

13 years agoIn mc_translate a NULL guard expression is sometimes passed around
Florian Krohm [Mon, 21 Jan 2013 01:27:22 +0000 (01:27 +0000)] 
In mc_translate a NULL guard expression is sometimes passed around
functions to indicate a "true" expression. That caused some confusion
and led people to believe believe, that IRDirty::guard could be NULL.
It cannot.
This confusion was indirectly spotted by coverity's checker who figured
out that IRDirty::guard was sometimes unconditionally dereferenced
and sometimes compared against NULL.
Cleaning this up...

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13250

13 years agomips: fix link_tool_exe_linux issue for different mips architectures
Petar Jovanovic [Mon, 21 Jan 2013 01:01:13 +0000 (01:01 +0000)] 
mips: fix link_tool_exe_linux issue for different mips architectures

One issue has been reported on the mailing list by Ilya Smelykh, and the second
issue has been found in development for MIPS64.
The change modifies the way we detect target-arch by reading host_cpu from
config.log rather than asking the toolchain.

Also, for MIPS64, we use:

--section-start=.MIPS.options=$ala

while for o32 we still use:

--section-start=.reginfo=$ala

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13249

13 years agomips: fixing issues spotted by a static code analysis tool
Petar Jovanovic [Sun, 20 Jan 2013 23:13:14 +0000 (23:13 +0000)] 
mips: fixing issues spotted by a static code analysis tool

Florian ran a static code analysis tool and found the issues.
Cleaning out old cruft now.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2649

13 years agomips: additional test case for fix in VEX r2648
Petar Jovanovic [Sun, 20 Jan 2013 18:27:39 +0000 (18:27 +0000)] 
mips: additional test case for fix in VEX r2648

Test program that triggers different corner cases related to position of
branch instruction and max size of a translation block (60 instructions).
Fix for these issues has been submitted in r2648.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13248

13 years agomips: fix for mips-disassembler when branch is at block_size-2 position
Petar Jovanovic [Sun, 20 Jan 2013 18:16:45 +0000 (18:16 +0000)] 
mips: fix for mips-disassembler when branch is at block_size-2 position

Check if the last instruction in the block is a branch or jump instruction
should happen only if the disassembler was not already stopped.
Incorrect conditional led to a boundary case in which jumps/branches were not
executed when placed on "max_insns - 2" position in the block.
none/tests/mips32/block_size test will be added to Valgrind to describe the case
and check for regressions in future.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2648

13 years agoAdd documentation for VALGRIND_MONITOR_COMMAND client request
Philippe Waroquiers [Sun, 20 Jan 2013 17:46:19 +0000 (17:46 +0000)] 
Add documentation for VALGRIND_MONITOR_COMMAND client request

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13247

13 years agoImplement --merge-recursive-frames + provide VALGRIND_MONITOR_COMMAND client req.
Philippe Waroquiers [Sun, 20 Jan 2013 17:11:58 +0000 (17:11 +0000)] 
Implement --merge-recursive-frames + provide VALGRIND_MONITOR_COMMAND client req.

In a big applications, some recursive algorithms have created
hundreds of thousands of stacktraces, taking a lot of memory.

Option --merge-recursive-frames=<number> tells Valgrind to
detect and merge (collapse) recursive calls when recording stack traces.
The value is changeable using the monitor command
'v.set merge-recursive-frames'.

Also, this provides a new client request: VALGRIND_MONITOR_COMMAND
allowing to execute a gdbsrv monitor command from the client
program.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13246

13 years agoFold out an expression which is always False. Spotted by Florian using Coverity.
Julian Seward [Sun, 20 Jan 2013 11:39:52 +0000 (11:39 +0000)] 
Fold out an expression which is always False.  Spotted by Florian using Coverity.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2647

13 years agoRemove a bit of dead code, spotted by Florian using Coverity.
Julian Seward [Sun, 20 Jan 2013 11:38:43 +0000 (11:38 +0000)] 
Remove a bit of dead code, spotted by Florian using Coverity.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2646

13 years agoImprove the tree builder in IR optimisation. Allow load expressions to be
Florian Krohm [Sun, 20 Jan 2013 03:51:04 +0000 (03:51 +0000)] 
Improve the tree builder in IR optimisation. Allow load expressions to be
moved past Put/I statements and dirty helpers, when it is safe to do so.
It is safe, when the statement does not require exact memory exceptions.
New functions stmt_modifies_guest_state and dirty_helper_puts have been
added to determine the side effect on the guest state.
This optimisation enables the use of  memory-to-memory insns on
architectures that have those.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2645

13 years agos390: Fix a type mixup spotted by IBM's BEAM checker.
Florian Krohm [Sun, 20 Jan 2013 03:08:04 +0000 (03:08 +0000)] 
s390: Fix a type mixup spotted by IBM's BEAM checker.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2644

13 years agoFix buffer overrun due to copy paste from x86 to amd64.
Philippe Waroquiers [Sat, 19 Jan 2013 21:08:27 +0000 (21:08 +0000)] 
Fix buffer overrun due to copy paste from x86 to amd64.
Detected by Florian (using coverity tool).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13245

13 years agoxen: add a missing break to the handling of XEN_DOMCTL_getdomaininfo
Bart Van Assche [Sat, 19 Jan 2013 13:22:54 +0000 (13:22 +0000)] 
xen: add a missing break to the handling of XEN_DOMCTL_getdomaininfo

Thanks to Florian Krohm

From: Ian Campbell <Ian.Campbell@citrix.com>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13244

13 years agoFix warning in perm_malloc (reported by Florian)
Philippe Waroquiers [Sat, 19 Jan 2013 10:33:45 +0000 (10:33 +0000)] 
Fix warning in perm_malloc (reported by Florian)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13243

13 years agoFix a comment. Spotted by Maran.
Florian Krohm [Sat, 19 Jan 2013 02:50:41 +0000 (02:50 +0000)] 
Fix a comment. Spotted by Maran.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13242

13 years agoFix statement order. Found by Coverity's checker.
Florian Krohm [Sat, 19 Jan 2013 02:27:41 +0000 (02:27 +0000)] 
Fix statement order. Found by Coverity's checker.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13241

13 years agoImport from memcheck land, a less ludicrously inefficient
Julian Seward [Fri, 18 Jan 2013 12:51:15 +0000 (12:51 +0000)] 
Import from memcheck land, a less ludicrously inefficient
implementation of memcpy, which copies words at a time rather than
just bytes.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13240

13 years agoAdd an implementation of memset() that costs half as much on 64 bit
Julian Seward [Fri, 18 Jan 2013 11:01:53 +0000 (11:01 +0000)] 
Add an implementation of memset() that costs half as much on 64 bit
platforms.  (But why are we intercepting memset anyway?  It makes no
sense to me.)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13239

13 years agoImplement a more efficient allocation of small blocks which are never freed.
Philippe Waroquiers [Fri, 18 Jan 2013 06:19:49 +0000 (06:19 +0000)] 
Implement a more efficient allocation of small blocks which are never freed.
This generalises the "perm_malloc" function which was in ms_main.c
The new VG_(perm_malloc) is used in ms_main.c
and for execontext : when there are a lot of execontext, this
can save significant memory.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13238

13 years agoAdd a vg_alignof macro
Philippe Waroquiers [Fri, 18 Jan 2013 06:15:44 +0000 (06:15 +0000)] 
Add a vg_alignof macro

Note that this macro behaves slightly differently for some types
from the gcc __alignof__ and from the equivalent (new) standardised
alignof.

vg_alignof macro is needed for the "perm_malloc" callers (next commit)
to determine the alignment of small blocks, but might be useful
for other purposes => placed in libvex_basictypes.h, close to offsetof.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2643

13 years agoChange the size of the hash table used to cache IP -> debuginfo to a prime nr
Philippe Waroquiers [Thu, 17 Jan 2013 23:57:35 +0000 (23:57 +0000)] 
Change the size of the hash table used to cache IP -> debuginfo to a prime nr

This change is based on rumours/legends/oral transmission of experience/...
that prime nrs are good to use for hash table size :).

If someone has a (short) explanation about why this is useful,
that will be welcome.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13237

13 years agoMerge, from branches/COMEM, revisions 13139 to 13235.
Julian Seward [Thu, 17 Jan 2013 14:24:35 +0000 (14:24 +0000)] 
Merge, from branches/COMEM, revisions 13139 to 13235.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13236

13 years agoMerge, from branches/COMEM, revisions 2568 to 2641.
Julian Seward [Thu, 17 Jan 2013 14:23:53 +0000 (14:23 +0000)] 
Merge, from branches/COMEM, revisions 2568 to 2641.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2642

13 years agomips32 equivalent to r2636: fix up the mips32 back end to be in sync
Julian Seward [Wed, 16 Jan 2013 22:11:13 +0000 (22:11 +0000)] 
mips32 equivalent to r2636: fix up the mips32 back end to be in sync
with infrastructural changes w.r.t. conditional dirty helpers that
return values.  Does not actually handle such cases since the mips32
front end does not generate them.

git-svn-id: svn://svn.valgrind.org/vex/branches/COMEM@2641

13 years agoSmall comment fix: .h specifies "all frames", implementation uses 8.
Philippe Waroquiers [Wed, 16 Jan 2013 22:07:02 +0000 (22:07 +0000)] 
Small comment fix: .h specifies "all frames", implementation uses 8.
Two fixes could be done:
Either we fix the comments
or we increase N_FRAMES to be rather VG_DEEPEST_BACKTRACE.

We fix the comment for the following reason:
This is (at least for the moment) not performance critical.
as this is only called when an error is reported.
However, searching for local vars is extremely costly.
It is unlikely that an error is reported for a stack variable
which is more than 8 frames deeper than theframe in which
it is detected.

So, fix the comment, waiting for a complaint that a deeper
variable is not properly described.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13235

13 years agoFix up the s390 back end to be in sync with infrastructural changes
Julian Seward [Wed, 16 Jan 2013 21:10:01 +0000 (21:10 +0000)] 
Fix up the s390 back end to be in sync with infrastructural changes
w.r.t. conditional dirty helpers that return values.  Does not
actually handle such cases since the s390 front end does not generate
them.  Further ahead, it would be more general to redo this by
incorporating a RetLoc as part of the helper_call struct.  This change
is OK for now, though.

git-svn-id: svn://svn.valgrind.org/vex/branches/COMEM@2640

13 years agoppc32/64 equivalents to r2636: fix up the ppc back end to be in sync
Julian Seward [Wed, 16 Jan 2013 14:56:06 +0000 (14:56 +0000)] 
ppc32/64 equivalents to r2636: fix up the ppc back end to be in sync
with infrastructural changes w.r.t. conditional dirty helpers that
return values.  Does not actually handle such cases since the ppc
front end does not generate them.

git-svn-id: svn://svn.valgrind.org/vex/branches/COMEM@2639

13 years agox86 equivalent to r2636: fix up the x86 back end to be in sync with
Julian Seward [Wed, 16 Jan 2013 09:29:37 +0000 (09:29 +0000)] 
x86 equivalent to r2636: fix up the x86 back end to be in sync with
infrastructural changes w.r.t. conditional dirty helpers that return
values.  Does not actually handle such cases since the x86 front end
does not generate them.

git-svn-id: svn://svn.valgrind.org/vex/branches/COMEM@2638

13 years agoGet rid of a pointless assert, and let the isel fail in the normal
Julian Seward [Wed, 16 Jan 2013 09:22:27 +0000 (09:22 +0000)] 
Get rid of a pointless assert, and let the isel fail in the normal
way, if it wants to.

git-svn-id: svn://svn.valgrind.org/vex/branches/COMEM@2637

13 years agoFix two memory leaks. Spotted by Coverity.
Florian Krohm [Wed, 16 Jan 2013 03:18:19 +0000 (03:18 +0000)] 
Fix two memory leaks. Spotted by Coverity.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13234

13 years agoImprove error handling when vgdb cannot read process cmd line
Philippe Waroquiers [Tue, 15 Jan 2013 23:09:41 +0000 (23:09 +0000)] 
Improve error handling when vgdb cannot read process cmd line

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13233

13 years agoFix up the amd64 back end to be in sync with infrastructural changes
Julian Seward [Tue, 15 Jan 2013 22:30:39 +0000 (22:30 +0000)] 
Fix up the amd64 back end to be in sync with infrastructural changes
w.r.t. conditional dirty helpers that return values.  Does not
actually handle such cases since the amd64 front end does not generat
them.

git-svn-id: svn://svn.valgrind.org/vex/branches/COMEM@2636

13 years agoComment-only changes.
Julian Seward [Tue, 15 Jan 2013 17:26:33 +0000 (17:26 +0000)] 
Comment-only changes.

git-svn-id: svn://svn.valgrind.org/vex/branches/COMEM@2635

13 years agoAnnounce bug fix.
Florian Krohm [Tue, 15 Jan 2013 03:31:26 +0000 (03:31 +0000)] 
Announce bug fix.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13232

13 years agoRemove const qualifier from function return type.
Florian Krohm [Tue, 15 Jan 2013 03:25:17 +0000 (03:25 +0000)] 
Remove const qualifier from function return type.
It's not meaningful.
Patch Guy Harris (guy@alum.mit.edu). Part of fixing BZ 312980.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2634

13 years agoFix a few compiler warnings on Darwin.
Florian Krohm [Tue, 15 Jan 2013 03:19:54 +0000 (03:19 +0000)] 
Fix a few compiler warnings on Darwin.
Patch Guy Harris (guy@alum.mit.edu). Part of fixing BZ 312980.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13231

13 years agoMinor code cleanup. These cases cannot occur.
Florian Krohm [Tue, 15 Jan 2013 03:09:16 +0000 (03:09 +0000)] 
Minor code cleanup. These cases cannot occur.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13230

13 years agoTest file mode correctly in vmsplice wrapper.
Tom Hughes [Mon, 14 Jan 2013 22:14:21 +0000 (22:14 +0000)] 
Test file mode correctly in vmsplice wrapper.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13229

13 years agoAccept glibc 2.17 as valid.
Tom Hughes [Mon, 14 Jan 2013 09:48:49 +0000 (09:48 +0000)] 
Accept glibc 2.17 as valid.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13228

13 years agoComment only changes
Philippe Waroquiers [Sun, 13 Jan 2013 15:18:51 +0000 (15:18 +0000)] 
Comment only changes

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13227

13 years agono recording of execontext for track origin in brk/signal stack when track-origin=no
Philippe Waroquiers [Sun, 13 Jan 2013 15:01:21 +0000 (15:01 +0000)] 
no recording of execontext for track origin in brk/signal stack when track-origin=no

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13226

13 years agoAvoid to record execontext used for origin tracking when --trac-origins=no
Philippe Waroquiers [Sun, 13 Jan 2013 13:59:17 +0000 (13:59 +0000)] 
Avoid to record execontext used for origin tracking when --trac-origins=no
All calls to VG_(unknown_SP_update) were recording an execontext
of one IP, useful only for track origin.
This patch implements splits VG_(unknown_SP_update)
in two different functions VG_(unknown_SP_update_w_ECU)
(doing origin tracking) and VG_(unknown_SP_update)  (not doing origin tracking).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13225

13 years agoFix a comment and add one.
Florian Krohm [Sun, 13 Jan 2013 02:34:28 +0000 (02:34 +0000)] 
Fix a comment and add one.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2633

13 years agos390: Support insns to convert between DFP values and signed/unsigned
Florian Krohm [Sun, 13 Jan 2013 02:29:05 +0000 (02:29 +0000)] 
s390: Support insns to convert between DFP values and signed/unsigned
integers. Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
Part of fixing BZ 307113.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2632

13 years agoAdd memcheck support for the IROps added in VEX r2631.
Florian Krohm [Sat, 12 Jan 2013 22:04:00 +0000 (22:04 +0000)] 
Add memcheck support for the IROps added in VEX r2631.
Adapt vbit-tester.
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
Part of fixing BZ 307113.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13224

13 years agoAdd 12 IROps for converting betwen DFP values and signed/unsigned integers.
Florian Krohm [Sat, 12 Jan 2013 22:02:07 +0000 (22:02 +0000)] 
Add 12 IROps for converting betwen DFP values and signed/unsigned integers.
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
Part of fixing BZ 307113.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2631

13 years agoImplement --keep-stacktraces=alloc|free|alloc-and-free|alloc-then-free|none
Philippe Waroquiers [Sat, 12 Jan 2013 19:53:08 +0000 (19:53 +0000)] 
Implement --keep-stacktraces=alloc|free|alloc-and-free|alloc-then-free|none

The option --keep-stacktraces controls which stack trace(s) to keep for
malloc'd and/or free'd blocks. This can be used to obtain more information
for 'use after free' errors or to decrease Valgrind memory and/or cpu usage
by recording less information for heap blocks.

This fixes 312913 Dangling pointers error should also report the alloc
stack trace.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13223

13 years agooutput the nr of IP in the stacktrace header produced by v.info exectxt
Philippe Waroquiers [Fri, 11 Jan 2013 23:48:28 +0000 (23:48 +0000)] 
output the nr of IP in the stacktrace header produced by v.info exectxt

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13222

13 years agoupdate a test following revision 13220
Philippe Waroquiers [Thu, 10 Jan 2013 22:35:33 +0000 (22:35 +0000)] 
update a test following revision 13220

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13221

13 years agoAddition of GDB server monitor command 'v.info execontext' that shows
Philippe Waroquiers [Thu, 10 Jan 2013 20:42:51 +0000 (20:42 +0000)] 
Addition of GDB server monitor command 'v.info execontext' that shows
information about the stack traces recorded by Valgrind.
This can be used to analyse one possible cause of Valgrind high
memory usage for some programs.

At work, a big set of regression tests crashed out of memory under Valgrind.

Two main causes for out of memory were identified:
1. big memory usage for stacktrace (exe contexts) recording by Valgrind
2. big number of partially initialised bytes.

This patch adds a gdbsrv monitor command that output (very) detailed
information about all the recorded exe context.

This has been used to analyse the problem 1. above,
showing the following identified causes for a (too) big nr of execontexts:

A. When the JIT handles an unknown SP update, even when --track-origins=no,
an execontext is (uselessly) created and recorded
to track the (never used) origin of some uninitialised stack memory.
This creates a whole bunch of 'one IP' execontexts.

B. same problem in handling some system calls (at least the brk system
 calls always records an origin, even when --track-origins=yes).

C. The Valgrind unwinder cannot properly unwind some stack traces.
  It unwinds a few frames, then go bezerk and stops at a "random" IP.
  This then causes the same "logical" stacktrace to be truncated
  and records thousands of times with this "differentiating" last IP.

For problem cause 2 above ( a lot of partially initialised bytes),
the idea is to similarly add another gdbsrv commands that will output
statistics about which stack traces are causing a lot of uninitialised bytes.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13220

13 years agos390: Add ecag.stdout.exp-zec12 to EXTRA_DIST.
Florian Krohm [Thu, 10 Jan 2013 15:44:28 +0000 (15:44 +0000)] 
s390: Add ecag.stdout.exp-zec12 to EXTRA_DIST.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13219

13 years agos390: bug fix. DFP rounding mode mixup.
Florian Krohm [Thu, 10 Jan 2013 15:41:46 +0000 (15:41 +0000)] 
s390: bug fix. DFP rounding mode mixup.
Spotted and fixed by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).

git-svn-id: svn://svn.valgrind.org/vex/trunk@2630

13 years agoadd ecag exp file for zec12
Christian Borntraeger [Wed, 9 Jan 2013 14:54:33 +0000 (14:54 +0000)] 
add ecag exp file for zec12

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13218

13 years agoremove useless undef of MYBUF_LEN
Philippe Waroquiers [Tue, 8 Jan 2013 14:30:17 +0000 (14:30 +0000)] 
remove useless undef of MYBUF_LEN

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13217

13 years agoCompanion fix to r2629: removal of specifiable default return values
Julian Seward [Tue, 8 Jan 2013 14:11:25 +0000 (14:11 +0000)] 
Companion fix to r2629: removal of specifiable default return values
in conditional dirty helper calls.

git-svn-id: svn://svn.valgrind.org/valgrind/branches/COMEM@13216

13 years agoGet rid of selectable default (return) values in conditional dirty
Julian Seward [Tue, 8 Jan 2013 14:09:04 +0000 (14:09 +0000)] 
Get rid of selectable default (return) values in conditional dirty
calls, as introduced in r2594.  It is overkill -- unnecessary
complexity.  Instead have a pre-assumed default bit pattern of 0101010
(0x55..) to be returned in such cases.

git-svn-id: svn://svn.valgrind.org/vex/branches/COMEM@2629

13 years agoRemove unused function.
Julian Seward [Mon, 7 Jan 2013 11:17:43 +0000 (11:17 +0000)] 
Remove unused function.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2628

13 years agoThe call to set the rounding mode for DFP iops: Iop_AddD128, Iop_SubD128,
Carl Love [Thu, 3 Jan 2013 23:34:18 +0000 (23:34 +0000)] 
The call to set the rounding mode for DFP iops: Iop_AddD128, Iop_SubD128,
Iop_MulD128, Iop_DivD128, and Iop_D128toI64 is wrong. The call being used is
set_FPU_rounding_mode(). This call is used to set the two rounding mode bits
for the Floating point instructions. The call set_FPU_DFP_rounding_mode()
should have been used to set the three rounding mode bits for the DFP
instructions.

This patch changes the call to the correct function to set the DFP
rounding mode bits.

The patch must be applied from the VEX directory.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2627

13 years agos390: Add testcases for DFP "shift significant" insns.
Florian Krohm [Tue, 1 Jan 2013 22:20:12 +0000 (22:20 +0000)] 
s390: Add testcases for DFP "shift significant" insns.
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
Part of fixing BZ 307113.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13215

13 years agos390: Add support for DFP "shift significant" insns.
Florian Krohm [Tue, 1 Jan 2013 22:19:24 +0000 (22:19 +0000)] 
s390: Add support for DFP "shift significant" insns.
Based on patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
Part of fixing BZ 307113.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2626

13 years agoImprove handling of dirty helper calls when building trees in ado_treebuild_BB.
Florian Krohm [Sun, 30 Dec 2012 18:17:18 +0000 (18:17 +0000)] 
Improve handling of dirty helper calls when building trees in ado_treebuild_BB.
This function took an overly conservative approach and always assumed
that calling a dirty helper would modify both guest state and memory. This
patch introduces two new functions dirty_helper_stores and dirty_helper_puts,
to determine the actual side effets of a helper call. Using these functions
increases precision and allows the tree builder to move a GET past a dirty
helper call.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2625

13 years agos390: Add testcase for "test data class/group" insns.
Florian Krohm [Fri, 28 Dec 2012 15:54:23 +0000 (15:54 +0000)] 
s390: Add testcase for "test data class/group" insns.
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
This is part of fixing BZ 307113.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13214

13 years agoImprovements to the built-in profiling infrastructure:
Julian Seward [Fri, 28 Dec 2012 09:12:14 +0000 (09:12 +0000)] 
Improvements to the built-in profiling infrastructure:

--profile-flags=00000000 now prints summary statistics, one line per
profiled block, but with no translation details.  Previously it had
no effect.

--profile-interval=<number> is a new flag that causes the profile data
to be dumped and zeroed every <number> event checks.  This makes it
possible to get profile data without waiting for runs to end, and to
get profile data which depends on the current workload etc.  If
--profile-interval=0 or is unset, the profile is printed only once, at
the end of the run, as before.

--profile-flags=XXXXXXXX (for at least one nonzero X) prints the
summary lines both at the start and end of the profile, so you don't
have to scroll back up to the top to see the summary.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13213

13 years agoShow the guest->host code expansion ratio when debug-printing
Julian Seward [Fri, 28 Dec 2012 09:01:59 +0000 (09:01 +0000)] 
Show the guest->host code expansion ratio when debug-printing
translations.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2624

13 years agoIndentation only change.
Florian Krohm [Thu, 27 Dec 2012 20:59:43 +0000 (20:59 +0000)] 
Indentation only change.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2623

13 years agos390: Add testcases for ESDTR and EXDTR.
Florian Krohm [Thu, 27 Dec 2012 20:17:32 +0000 (20:17 +0000)] 
s390: Add testcases for ESDTR and EXDTR.
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
Part of fixing BZ #307113.

[ r13211 was also implemented by Maran. ]

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13212

13 years agos390: Support the "test data class/group" and "extract significance"
Florian Krohm [Thu, 27 Dec 2012 20:14:03 +0000 (20:14 +0000)] 
s390: Support the "test data class/group" and "extract significance"
insns. Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
This is part of fixing BZ 307113.

[ revision 2621 was also implemented by Maran. ]

git-svn-id: svn://svn.valgrind.org/vex/trunk@2622

13 years agovalgrind-side support for Iop_ExtractSigD64 and Iop_ExtractSigD128.
Florian Krohm [Thu, 27 Dec 2012 20:06:18 +0000 (20:06 +0000)] 
valgrind-side support for Iop_ExtractSigD64 and Iop_ExtractSigD128.
See also companion patch VEX r2621.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13211

13 years agoNew IROps: Iop_ExtractSigD64 and Iop_ExtractSigD128. These are needed to
Florian Krohm [Thu, 27 Dec 2012 20:01:13 +0000 (20:01 +0000)] 
New IROps: Iop_ExtractSigD64 and Iop_ExtractSigD128. These are needed to
implement s390's "extract significance" insns.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2621

13 years agoTeach DRD about IRLoadG and IRStoreG. Includes small bug fix from
Julian Seward [Thu, 27 Dec 2012 17:47:09 +0000 (17:47 +0000)] 
Teach DRD about IRLoadG and IRStoreG.  Includes small bug fix from
trunk r13209.

git-svn-id: svn://svn.valgrind.org/valgrind/branches/COMEM@13210

13 years agois_stack_access: don't iterate over possibly non-existent stmts. This
Julian Seward [Thu, 27 Dec 2012 17:46:10 +0000 (17:46 +0000)] 
is_stack_access: don't iterate over possibly non-existent stmts.  This
has been observed to cause the JIT to segfault when using DRD on ARM.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13209

13 years agoUpdate list of ignored files.
Florian Krohm [Thu, 27 Dec 2012 17:21:46 +0000 (17:21 +0000)] 
Update list of ignored files.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13208

13 years agoRemove Makefile-icc which has been broken for a long time.
Florian Krohm [Thu, 27 Dec 2012 17:19:12 +0000 (17:19 +0000)] 
Remove Makefile-icc which has been broken for a long time.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2620

13 years agoTeach Helgrind about IRLoadG and IRStoreG.
Julian Seward [Thu, 27 Dec 2012 13:37:36 +0000 (13:37 +0000)] 
Teach Helgrind about IRLoadG and IRStoreG.

git-svn-id: svn://svn.valgrind.org/valgrind/branches/COMEM@13207

13 years agoTeach Callgrind about IRLoadG and IRStoreG.
Julian Seward [Thu, 27 Dec 2012 12:02:15 +0000 (12:02 +0000)] 
Teach Callgrind about IRLoadG and IRStoreG.

git-svn-id: svn://svn.valgrind.org/valgrind/branches/COMEM@13206

13 years agovbit-tester: In test_ternary_op return number of tests executed.
Florian Krohm [Thu, 27 Dec 2012 03:00:49 +0000 (03:00 +0000)] 
vbit-tester: In test_ternary_op return number of tests executed.
I don't recall gcc complaining about this. But clang did.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13205

13 years agos390: Do not waste a register when assigning a constant to a memory
Florian Krohm [Thu, 27 Dec 2012 00:59:43 +0000 (00:59 +0000)] 
s390: Do not waste a register when assigning a constant to a memory
location. If available, use MVHI and friends. If those are not available,
load the constant value into register r0 and store that. r0 is not visible
to register allocation and therefore using it does not increase register
pressure.
Remove S390_INSN_MZERO and replace it with S390_INSN_MIMM. Assigning zero
is just a special case..
Saves between 0.9% and 2.4% of insns as measured with the perf regression
bucket.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2619

13 years agos390: Remove a forgotten debug print statement.
Florian Krohm [Thu, 27 Dec 2012 00:44:30 +0000 (00:44 +0000)] 
s390: Remove a forgotten debug print statement.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2618

13 years agoRemove a fixme.
Florian Krohm [Wed, 26 Dec 2012 21:12:07 +0000 (21:12 +0000)] 
Remove a fixme.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13204

13 years agovalgrind side changes to support Iop_CmpExpD64 and Iop_CmpExpD128.
Florian Krohm [Wed, 26 Dec 2012 17:48:46 +0000 (17:48 +0000)] 
valgrind side changes to support Iop_CmpExpD64 and Iop_CmpExpD128.
VEX buddy patch is r2617.
Enhance testcase for CEDTR and CEXTR. Adapt vbit tester.
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
This is part of fixing BZ 307113.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13203

13 years agos390x: Support "compare biased exponent" insns CEDTR, CEXTR.
Florian Krohm [Wed, 26 Dec 2012 17:47:19 +0000 (17:47 +0000)] 
s390x: Support "compare biased exponent" insns CEDTR, CEXTR.
To do that properly, two new IROps are needed: Iop_CmpExpD64 and
Iop_CmpExpD128. It might seem that extracting the exponents using
Iop_ExtractExpD64/D128 and comparing the values could be used here.
But that only works for finite DFP values. Hence, the new IROps.

Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
This is part of fixing BZ 307113.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2617

13 years agoAvoid compiler warning on ppc32.
Florian Krohm [Mon, 24 Dec 2012 15:10:19 +0000 (15:10 +0000)] 
Avoid compiler warning on ppc32.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13202

13 years agonone/tests/process_vm_readv_writev: Avoid that compilation of this test program trigg...
Bart Van Assche [Mon, 24 Dec 2012 11:14:08 +0000 (11:14 +0000)] 
none/tests/process_vm_readv_writev: Avoid that compilation of this test program triggers a compiler warning

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13201

13 years agodrd/tests/pth_cond_destroy_busy: Correct expected output
Bart Van Assche [Mon, 24 Dec 2012 10:43:15 +0000 (10:43 +0000)] 
drd/tests/pth_cond_destroy_busy: Correct expected output

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13200

13 years agodrd/tests/pth_cond_destroy_busy: Add
Bart Van Assche [Mon, 24 Dec 2012 10:23:16 +0000 (10:23 +0000)] 
drd/tests/pth_cond_destroy_busy: Add

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13199

13 years agodrd: Handle pthread_cond_destroy() failure properly
Bart Van Assche [Mon, 24 Dec 2012 10:22:14 +0000 (10:22 +0000)] 
drd: Handle pthread_cond_destroy() failure properly

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13198

13 years agoFix VEX standalone build with Makefile-gcc. This has been bit-rotting
Florian Krohm [Mon, 24 Dec 2012 00:25:34 +0000 (00:25 +0000)] 
Fix VEX standalone build with Makefile-gcc. This has been bit-rotting
for a while.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2616

13 years agoUpdated for s390_defs.h.
Florian Krohm [Mon, 24 Dec 2012 00:16:23 +0000 (00:16 +0000)] 
Updated for s390_defs.h.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13197

13 years agos390: New file s390_defs.h to contain definitions that are
Florian Krohm [Mon, 24 Dec 2012 00:14:31 +0000 (00:14 +0000)] 
s390: New file s390_defs.h to contain definitions that are
neither guest nor host specific, but just s390 specific. These
definitions formerly resided in host_s390_defs.h

git-svn-id: svn://svn.valgrind.org/vex/trunk@2615

13 years agos390: Add testcases for CDTR, CXTR, LDETR. LXDTR, LEDTR, LDXTR.
Florian Krohm [Sun, 23 Dec 2012 16:17:18 +0000 (16:17 +0000)] 
s390: Add testcases for CDTR, CXTR, LDETR. LXDTR, LEDTR, LDXTR.
This is part of fixing BZ 307113.
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13196

13 years agos390: Simplify the optimisation for PUTs to tracked registers.
Florian Krohm [Sun, 23 Dec 2012 01:09:16 +0000 (01:09 +0000)] 
s390: Simplify the optimisation for PUTs to tracked registers.

There is no need to treat the guest IA register specially. The first
assignment in a SB to any tracked register will always assign the full value
and not do an incremental update. Therefore, maintaining
env->first_IA_assignment is redundant. Interestingly, the old code
forgot to mark the tracking state as valid when first_IA_assignment was
true, resulting in an inefficiency (in the order of 0.8% of insns).

Also, when a tracked register already contains the value that it is
being assigned, there is not need to
(a) check whether that register requires precise memory exceptions and
(b) if so, assign the new value.
By definition, the register is up-to-date and reassigning the new value
which is also the old value is meaningless. No idea, what I was thinking
at the time.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2614

13 years agos390: Reduce the size of an s390_insn from 48 bytes to 32 bytes by
Florian Krohm [Sat, 22 Dec 2012 15:01:04 +0000 (15:01 +0000)] 
s390: Reduce the size of an s390_insn from 48 bytes to 32 bytes by
- adding one level of indirection for CDAS and DFP binops
- rearranging and tweaking the variant for helper calls
- using seperate insns kinds for signed and unsigned multiplication
  and division.
Add an assert to make sure the size stays at 32 bytes.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2613

13 years agos390: Fix a silly mistake causing an infinite loop.
Florian Krohm [Sat, 22 Dec 2012 14:50:41 +0000 (14:50 +0000)] 
s390: Fix a silly mistake causing an infinite loop.
Spotted by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).

git-svn-id: svn://svn.valgrind.org/vex/trunk@2612

13 years agos390: Generalise S390_INSN_GADD which only worked on the guest
Florian Krohm [Sat, 22 Dec 2012 02:28:25 +0000 (02:28 +0000)] 
s390: Generalise S390_INSN_GADD which only worked on the guest
state to S390_INSN_MADD which works for any memory location
addressable with base reg + 20-bit displacement.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2611

13 years agos390: Fix an assert.
Florian Krohm [Sat, 22 Dec 2012 02:09:40 +0000 (02:09 +0000)] 
s390: Fix an assert.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2610

13 years agos390: Rename s390_conv_t to s390_bfp_conv_t. Purely mechanical.
Florian Krohm [Fri, 21 Dec 2012 21:43:00 +0000 (21:43 +0000)] 
s390: Rename s390_conv_t to s390_bfp_conv_t. Purely mechanical.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2609

13 years agos390: Distinguish between conversion to/from IRCmpFxxResult and
Florian Krohm [Fri, 21 Dec 2012 21:05:17 +0000 (21:05 +0000)] 
s390: Distinguish between conversion to/from IRCmpFxxResult and
IRCmpDxxResult, even though the encodings are currently the same.
Rename convert_s390_fpcc_to_vex to convert_s390_to_vex_bfpcc.
Add convert_s390_to_vex_dfpcc and convert_vex_dfpcc_to_s390.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2608

13 years agoDefine IRCmpD64Result and IRCmpD128Result.
Florian Krohm [Fri, 21 Dec 2012 20:24:24 +0000 (20:24 +0000)] 
Define IRCmpD64Result and IRCmpD128Result.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2607