135 Commits

Author SHA1 Message Date
Petar Jovanovic
4a889e881b mips: remove rt-rk email that is no longer in use
Email mips-valgrind@rt-rk.com is no longer in use.
2020-05-20 13:18:55 +00:00
Petar Jovanovic
4456279023 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.
2019-11-14 12:33:36 +00:00
Petar Jovanovic
04cc9cf07e 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.
2019-09-03 12:10:23 +00:00
Carl Love
991db2a39b PPC64, fix issues with dnormal values in the vector fp instructions.
The result of the floating point instructions vmaddfp, vnmsubfp,
vaddfp, vsubfp, vmaxfp, vminfp, vrefp, vrsqrtefp, vcmpeqfp, vcmpeqfp,
vcmpgefp, vcmpgtfp are controlled by the setting of the NJ bit in
the VSCR register.  If VSCR[NJ] = 0; then denormalized values are
handled as specified by Java and the IEEE standard.  If the bit is
a 1, then the denormalized element in the vector is replaced with
a zero.

Valgrind was not properly handling the denormalized case for these
instructions.  This patch fixes the issue.

https://bugs.kde.org/show_bug.cgi?id=406256
2019-05-28 13:49:33 -05:00
Mark Wielaard
461cc5c003 Cleanup GPL header address notices by using http://www.gnu.org/licenses/
Sync VEX/LICENSE.GPL with top-level COPYING file. We used 3 different
addresses for writing to the FSF to receive a copy of the GPL. Replace
all different variants with an URL <http://www.gnu.org/licenses/>.

The following files might still have some slightly different (L)GPL
copyright notice because they were derived from other programs:

- files under coregrind/m_demangle which come from libiberty:
  cplus-dem.c, d-demangle.c, demangle.h, rust-demangle.c,
  safe-ctype.c and safe-ctype.h
- coregrind/m_demangle/dyn-string.[hc] derived from GCC.
- coregrind/m_demangle/ansidecl.h derived from glibc.
- VEX files for FMA detived from glibc:
  host_generic_maddf.h and host_generic_maddf.c
- files under coregrin/m_debuginfo derived from LZO:
  lzoconf.h, lzodefs.h, minilzo-inl.c and minilzo.h
- files under coregrind/m_gdbserver detived from GDB:
  gdb/signals.h, inferiors.c, regcache.c, regcache.h,
  regdef.h, remote-utils.c, server.c, server.h, signals.c,
  target.c, target.h and utils.c

Plus the following test files:

- none/tests/ppc32/testVMX.c derived from testVMX.
- ppc tests derived from QEMU: jm-insns.c, ppc64_helpers.h
  and test_isa_3_0.c
- tests derived from bzip2 (with embedded GPL text in code):
  hackedbz2.c, origin5-bz2.c, varinfo6.c
- tests detived from glibc: str_tester.c, pth_atfork1.c
- test detived from GCC libgomp: tc17_sembar.c
- performance tests derived from bzip2 or tinycc (with embedded GPL
  text in code): bz2.c, test_input_for_tinycc.c and tinycc.c
2019-05-26 20:07:51 +02:00
Julian Seward
f96d131ce2 Bug 402781 - Redo the cache used to process indirect branch targets.
Implementation for x86-solaris and amd64-solaris.  This completes the
implementations for all targets.  Note these two are untested because I don't
have any way to test them.
2019-01-25 09:27:23 +01:00
Julian Seward
50bb127b1d Bug 402781 - Redo the cache used to process indirect branch targets.
[This commit contains an implementation for all targets except amd64-solaris
and x86-solaris, which will be completed shortly.]

In the baseline simulator, jumps to guest code addresses that are not known at
JIT time have to be looked up in a guest->host mapping table.  That means:
indirect branches, indirect calls and most commonly, returns.  Since there are
huge numbers of these (often 10+ million/second) the mapping mechanism needs
to be extremely cheap.

Currently, this is implemented using a direct-mapped cache, VG_(tt_fast), with
2^15 (guest_addr, host_addr) pairs.  This is queried in handwritten assembly
in VG_(disp_cp_xindir) in dispatch-<arch>-<os>.S.  If there is a miss in the
cache then we fall back out to C land, and do a slow lookup using
VG_(search_transtab).

Given that the size of the translation table(s) in recent years has expanded
significantly in order to keep pace with increasing application sizes, two bad
things have happened: (1) the cost of a miss in the fast cache has risen
significantly, and (2) the miss rate on the fast cache has also increased
significantly.  This means that large (~ one-million-basic-blocks-JITted)
applications that run for a long time end up spending a lot of time in
VG_(search_transtab).

The proposed fix is to increase associativity of the fast cache, from 1
(direct mapped) to 4.  Simulations of various cache configurations using
indirect-branch traces from a large application show that is the best of
various configurations.  In an extreme case with 5.7 billion indirect
branches:

* The increase of associativity from 1 way to 4 way, whilst keeping the
  overall cache size the same (32k guest/host pairs), reduces the miss rate by
  around a factor of 3, from 4.02% to 1.30%.

* The use of a slightly better hash function than merely slicing off the
  bottom 15 bits of the address, reduces the miss rate further, from 1.30% to
  0.53%.

Overall the VG_(tt_fast) miss rate is almost unchanged on small workloads, but
reduced by a factor of up to almost 8 on large workloads.

By implementing each (4-entry) cache set using a move-to-front scheme in the
case of hits in ways 1, 2 or 3, the vast majority of hits can be made to
happen in way 0.  Hence the cost of having this extra associativity is almost
zero in the case of a hit.  The improved hash function costs an extra 2 ALU
shots (a shift and an xor) but overall this seems performance neutral to a
win.
2019-01-25 09:14:56 +01:00
Petar Jovanovic
9a6cf7a41c mips64: add N32 ABI support
Adding MIPS N32 ABI support.

BZ issue - #345763.

Contributed and maintained by mulitple people over the years:
  Crestez Dan Leonard, Maran Pakkirisamy, Dimitrije Nikolic,
  Aleksandar Rikalo, Tamara Vlahovic.
2018-06-14 17:40:08 +00:00
Ivo Raisr
246bb0e25f Remove TileGX/Linux port.
Fixes BZ#379504.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16340
2017-05-08 17:21:59 +00:00
Ivo Raisr
38edd50c0e Update copyright end year to 2017 in preparation for 3.13 release.
n-i-bz



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16333
2017-05-04 15:09:39 +00:00
Petar Jovanovic
ddc3b67f41 mips: replace use of (d)addi with (d)addiu
Replace use of daddi/addi with daddiu/addiu.
This is more R6-friendly and we actually want to use the instructions
that do not cause integer overflow exception.

Patch by Vicente Olivert Riera.

Related issue - BZ#356112.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16018
2016-10-05 14:16:25 +00:00
Florian Krohm
fd4b1a19c1 Remove an unneeded header file. Spotted by Matthias Schwarzott.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15693
2015-09-30 20:34:32 +00:00
Florian Krohm
193f88fad4 Make sure no executable stack gets created.
Explanation by Matthias Schwarzott:

The linker will request an executable stack as soon as at least one
object file, that is linked in, wants an executable stack.
And the absence of the 
      .section .note.GNU-stack."",@progbits
is enough to tell the linker that an executable stack is needed.
So even an empty asm-file must at least contain this statement to not
force executable stacks on the whole executable.

* Define a helper macro MARK_STACK_NO_EXEC that disables the
  executable stack.
* Instantiate this macro unconditionally at the end of each asm file.

Patch by Matthias Schwarzott <zzam@gentoo.org>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15692
2015-09-30 20:30:48 +00:00
Julian Seward
9d215c1326 Bug 346185 - Fix typo saving altivec register v24.
Patch from Dave Lerner (david.lerner26@sbcglobal.net).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15579
2015-08-21 13:43:07 +00:00
Julian Seward
adc2dafee9 Update copyright dates, to include 2015. No functional change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15577
2015-08-21 11:32:26 +00:00
Julian Seward
ac60633d65 Bug 345248 - add support for Solaris OS in valgrind
Authors of this port:
    Petr Pavlu         setup@dagobah.cz
    Ivo Raisr          ivosh@ivosh.net
    Theo Schlossnagle  theo@omniti.com
            


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15426
2015-07-21 14:44:28 +00:00
Julian Seward
082f9298a1 Add a port to Linux/TileGx. Zhi-Gang Liu (zliu@tilera.com)
Valgrind aspects, to match vex r3124.

See bug 339778 - Linux/TileGx platform support to Valgrind



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15080
2015-04-10 12:30:09 +00:00
Carl Love
98908947c7 This commit is for Bugzilla 334834. The Bugzilla contains patch 2 of 3
to add PPC64 LE support.  The other two patches can be found in Bugzillas
334384 and 334836.

POWER PC, add the functional Little Endian support, patch 2 

The IBM POWER processor now supports both Big Endian and Little Endian.
The ABI for Little Endian also changes.  Specifically, the function
descriptor is not used, the stack size changed, accessing the TOC
changed.  Functions now have a local and a global entry point.  Register
r2 contains the TOC for local calls and register r12 contains the TOC
for global calls.  This patch makes the functional changes to the
Valgrind tool.  The patch makes the changes needed for the
none/tests/ppc32 and none/tests/ppc64 Makefile.am.  A number of the
ppc specific tests have Endian dependencies that are not fixed in
this patch.  They are fixed in the next patch.

Per Julian's comments renamed coregrind/m_dispatch/dispatch-ppc64-linux.S
to coregrind/m_dispatch/dispatch-ppc64be-linux.S  Created new file for LE
coregrind/m_dispatch/dispatch-ppc64le-linux.S.  The same was done for
coregrind/m_syswrap/syscall-ppc-linux.S.

Signed-off-by: Carl Love <carll@us.ibm.com>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14239
2014-08-07 23:35:54 +00:00
Carl Love
914f75de32 This commit is for Bugzilla 334384. The Bugzilla contains patch 1 of 3
to add PPC64 LE support.  The other two patches can be found in Bugzillas
334834 and 334836.  The commit does not have a VEX commit associated with it.

POWER PC, add initial Little Endian support

The IBM POWER processor now supports both Big Endian and Little Endian.
This patch renames the #defines with the name ppc64 to ppc64be for the BE
specific code.  This patch adds the Little Endian #define ppc64le to the

Additionally, a few functions are renamed to remove BE from the name if the
function is used by BE and LE. Functions that are BE specific have BE put
in the name.

The goals of this patch is to make sure #defines, function names and
variables consistently use PPC64/ppc64 if it refers to BE and LE,
PPC64BE/ppc64be if it is specific to BE, PPC64LE/ppc64le if it is LE
specific.  The patch does not break the code for PPC64 Big Endian.

The test files memcheck/tests/atomic_incs.c, tests/power_insn_available.c
and tests/power_insn_available.c are also updated to the new #define
definition for PPC64 BE.

Signed-off-by: Carl Love <carll@us.ibm.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14238
2014-08-07 23:17:29 +00:00
Julian Seward
3f6d211236 Add support for ARMv8 AArch64 (the 64 bit ARM instruction set).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13770
2014-01-12 12:54:00 +00:00
Julian Seward
dbf9b63605 Update copyright dates (20XY-2012 ==> 20XY-2013)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13658
2013-10-18 14:27:36 +00:00
Dejan Jevtic
961e487650 mips64: add extra Iop cases in VEX and fix compiler
warning.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13624
2013-10-07 10:27:31 +00:00
Petar Jovanovic
5dd4c02e39 mips: adding MIPS64LE support to Valgrind
Necessary changes to Valgrind to support MIPS64LE on Linux.
Minor cleanup/style changes embedded in the patch as well.
The change corresponds to r2687 in VEX.
Patch written by Dejan Jevtic and Petar Jovanovic.

More information about this issue:
https://bugs.kde.org/show_bug.cgi?id=313267


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13292
2013-02-27 23:17:33 +00:00
Petar Jovanovic
eab0663602 Reserve space for frame header in disp_run_translations for MIPS.
Reserve space for frame header in disp_run_translations, as some optimizations
may decide to use it. This should fix issue #307141.

Related link:
https://bugs.kde.org/show_bug.cgi?id=307141


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13080
2012-10-22 17:43:57 +00:00
Florian Krohm
5fd9d2ae08 Change script to also handle IBM's copyright notice.
Update copyright notices.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12853
2012-08-06 18:34:24 +00:00
Julian Seward
4a3633e266 Update copyright dates to include 2012.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12843
2012-08-05 15:46:46 +00:00
Julian Seward
d971e9300f Merge in a port for mips32-linux, by Petar Jovanovic and Dejan Jevtic,
mips-valgrind@rt-rk.com, Bug 270777.

Valgrind: new non-test files for mips32-linux.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12617
2012-06-07 09:23:23 +00:00
Florian Krohm
77e2a06efd tchain optimisation for s390 (valgrind bits)
Companion of VEX r2308
Move address arithmetic to recover place to patch into VEX.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12537
2012-04-22 17:39:37 +00:00
Florian Krohm
692fb9efff Followup to r12527. Use 32-bit arithmetic to increment xindir
performance counters. Remove #ifdef'ery.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12536
2012-04-22 15:37:15 +00:00
Julian Seward
00e1ebb540 Use 32-bit XIndir counter incs, instead of 64-bit, as per r12527.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12530
2012-04-21 23:37:16 +00:00
Julian Seward
3bf14f967a Use 32-bit XIndir counter incs, instead of 64-bit, as per r12527.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12529
2012-04-21 23:28:34 +00:00
Julian Seward
4deeeb4aa6 Use 32-bit XIndir counter incs, instead of 64-bit, as per r12527.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12528
2012-04-21 23:12:07 +00:00
Julian Seward
09bcae8ec8 Last optimisation for the day: change VG_(stats__n_xindirs) in such a
way that the fast-path through VG_(disp_cp_xindir) only has to
increment a 32 bit counter, saving memory bandwidth on 32 bit
platforms compared to a 64-bit inc.  The overall numbers of XIndirs
can still be 64 bit though.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12527
2012-04-21 23:05:57 +00:00
Julian Seward
9b090c6bb2 (post-tchain-merge cleanup): un-break the build on OSX by fixing up
the dispatcher code accordingly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12522
2012-04-21 13:55:28 +00:00
Julian Seward
4395ea6182 Changes needed to make t-chaining work on ppc64-linux (valgrind side).
git-svn-id: svn://svn.valgrind.org/valgrind/branches/TCHAIN@12514
2012-04-20 10:43:08 +00:00
Julian Seward
86dc56291e Fill in some more bits to do with t-chaining for ppc64
(still doesn't work) (Valgrind side)


git-svn-id: svn://svn.valgrind.org/valgrind/branches/TCHAIN@12513
2012-04-20 02:19:35 +00:00
Julian Seward
6d68ec0346 Add translation chaining support for ppc32 (tested) and to
a large extent for ppc64 (incomplete, untested) (Valgrind side)


git-svn-id: svn://svn.valgrind.org/valgrind/branches/TCHAIN@12512
2012-04-20 00:14:02 +00:00
Florian Krohm
5925ffe7f1 Translation chaining for s390. To be debugged.
git-svn-id: svn://svn.valgrind.org/valgrind/branches/TCHAIN@12502
2012-04-13 04:04:44 +00:00
Julian Seward
712ee2547b Make the return type of VG_(disp_run_translations) be void, rather
than the HWord it was claimed to be.  Inconsistency spotted by
Philippe Waroquiers.



git-svn-id: svn://svn.valgrind.org/valgrind/branches/TCHAIN@12486
2012-04-04 12:23:23 +00:00
Julian Seward
8b6f93641c Add translation chaining support for amd64, x86 and ARM
(Valgrind side).  See #296422.



git-svn-id: svn://svn.valgrind.org/valgrind/branches/TCHAIN@12484
2012-04-02 21:56:03 +00:00
Florian Krohm
9d14305592 Terminate comment correctly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12325
2012-01-02 16:12:30 +00:00
Julian Seward
0d7caa744f Get a bunch more copyright dates in the right format, 20xx-2011,
so the auto-update script will handle them correctly in future.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12207
2011-10-23 07:49:30 +00:00
Julian Seward
c96096ab24 Update all copyright dates, from 20xy-2010 to 20xy-2011.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12206
2011-10-23 07:32:08 +00:00
Florian Krohm
166c3bcd27 Remove code duplication from the dispatchers. Keep the core loop
in common.
To accomplish that without penalizing the non-profiling dispatcher
we do the stats gathering *after* the jitted code returns to the
dispatcher. For that to work properly, we need to stash away the
instruction adddress before entering the jitted code so we can use
it later. (See also VEX r2208).

Two other tweaks are included here:
(1) For the non-profiling dispatcher it is not necessary to update
    the LR in each iteration. Quite obviously the jitted code cannot
    modify the LR in its iteration because it needs it at the very end
    when it returns. So we move this step out of the core loop.
(2) Move loading the address of VG_(tt_fast) past testing for a changed
    guest state pointer. 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12044
2011-09-25 00:15:54 +00:00
Florian Krohm
ed330ac726 Tweak s390x dispatcher. Using CG elminates two load insns.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12037
2011-09-17 22:18:01 +00:00
Florian Krohm
b1d64f9231 Dispatcher tweak. Saves ALU operation. Suggested by Julian Seward.
Implemented by Christian Borntraeger (borntraeger@de.ibm.com).
See bugzilla #274378


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12036
2011-09-17 15:46:59 +00:00
Julian Seward
ad7de5b336 Delete the AIX5 port. The last release this worked for is 3.4.1,
and then only on AIX 5.2 and 5.3.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11842
2011-06-28 07:25:29 +00:00
Julian Seward
a6ffae5ac9 Un-break Darwin build following r2155/r11786 -- use dual-entry
dispatchers for x86 and amd64, and add corresponding improvements.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11788
2011-05-29 12:40:27 +00:00
Julian Seward
9b93938907 Remove a load from the s390x dispatcher loop, as per r11781.
(Florian Krohm <britzel@acm.org>).  #274378.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11787
2011-05-29 09:38:58 +00:00
Julian Seward
ffc3968ff2 Give the amd64-linux and x86-linux dispatchers two entry points, not one,
so as to avoid a GSP-changed check in the common case.  See vex r2155.
(amd64-darwin and x86-darwin are now temporarily unbuildable.)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11786
2011-05-29 09:34:30 +00:00