1079 Commits

Author SHA1 Message Date
Rhys Kidd
c5cf91fc5d ioctl handling needs to do POST handling on generic ioctls and needs to handle BPF ioctls
bz#312989

Patch by Guy Harris <guy@alum.mit.edu>

On OS X 10.10

Before:

== 593 tests, 214 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

After:

== 593 tests, 214 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15451
2015-07-25 07:57:55 +00:00
Florian Krohm
021a3ef28b Remove command line options --db-attach and --db-command which were
deprecated in 3.10.0


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15445
2015-07-24 11:50:12 +00:00
Rhys Kidd
e2dfee078f Fix valgrind 3.9.0 build fails on Mac OS X 10.6.8
bz#327745

Patch by Mark H <mh8928@yahoo.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15444
2015-07-24 10:23:34 +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
2ac4c69401 Fix "346411 MIPS: SysRes::_valEx handling is incorrect"
Specialise type SysRes for mips{32,64}-linux to enable 
meaningful equality comparisons.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15404
2015-07-08 17:08:23 +00:00
Rhys Kidd
0fcd971d15 Preliminary support for OS X 10.11 (El Capitan). Refer BZ#348909 for ongoing work.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15403
2015-07-08 13:46:57 +00:00
Bart Van Assche
6ae9001870 xen: Drop bogus port field from vki_xen_ioctl_evtchn_bind_virq
This ioctl argument struct has never had such a member.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15386
2015-06-28 16:57:48 +00:00
Bart Van Assche
a914bcf7f5 xen: Implement physdev_op and map_pirq
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15385
2015-06-28 16:57:10 +00:00
Bart Van Assche
b64fedcf91 xen: Implement the xsm_op hypercall
More recent Xen toolstacks use this for the SID_TO_CONTEXT operation
only, even when XSM is not in use.

XSM is actually an abstraction layer, of which the only current
implementation is FLASK. So this blindly assumes that the backend is
FLASK. Should another XSM backend be invented then we will have to
sort of detecting the correct one.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15384
2015-06-28 16:55:45 +00:00
Bart Van Assche
31229b7020 xen: syswrap XEN_SCHEDOP_remote_shutdown
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15383
2015-06-28 16:53:58 +00:00
Bart Van Assche
3adbf40a38 Follow-up for r15381
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15382
2015-06-28 16:52:49 +00:00
Bart Van Assche
d2a0392539 xen: Basic syswrap infrastructure for XEN_sched_op hypercalls
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15381
2015-06-28 16:48:22 +00:00
Bart Van Assche
7a8a964019 xen: syswrap XENMEM_machphys_compat_mfn_list
XENMEM_machphys_compat_mfn_list is functionally identical to
XENMEM_machphys_mfn_list but returns a different list from Xen.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15379
2015-06-28 16:46:30 +00:00
Bart Van Assche
b51ec07994 xen: syswrap XEH_HVMOP_set_pci_intx_level
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15377
2015-06-28 16:44:21 +00:00
Bart Van Assche
56e19e386d xen: syswrap XEN_HVMOP_track_dirty_vram
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15376
2015-06-28 16:43:14 +00:00
Bart Van Assche
04c609b998 xen: implement VKI_XEN_DOMCTL_irq_permission
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15375
2015-06-28 16:42:38 +00:00
Bart Van Assche
278a3d1df5 xen: support for XEN_DOMCTL_iomem_permission
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15374
2015-06-28 16:42:05 +00:00
Bart Van Assche
e93aa3706d xen: Handle XEN_DOMCTL_{test_assign,assign,deassign}_device
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15373
2015-06-28 16:41:06 +00:00
Bart Van Assche
8269099b13 xen: syswrap XEN_DOMCTL_pin_mem_cacheattr
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15371
2015-06-28 16:38:40 +00:00
Bart Van Assche
10d6d0a7ad xen: syswrap XEN_DOMCTL_[gs]et_vcpu_msrs
The XEN_DOMCTL_[gs]et_vcpu_msrs work simiarly to the other get/set pairs,
taking a vcpu, buffer and size.  A query with a buffer of NULL is a request
for the maximum size.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15370
2015-06-28 16:37:54 +00:00
Bart Van Assche
7806d251be xen: syswrap XEN_DOMCTL_[gs]et_ext_vcpustate
The VKI_XEN_DOMCTL_[gs]et_ext_vcpucontext hypercalls have had interface
changes, but are largly just extentions of the existing structure.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15369
2015-06-28 16:36:30 +00:00
Bart Van Assche
b1e2a3e6a1 xen: Add domctl interface version 0x0000000a
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15366
2015-06-28 16:33:04 +00:00
Bart Van Assche
c35715d20a xen: Add support for new sysctl and domctl interface versions
The change causing the sysctl bump is not in an implemented subop yet, so no
change is required.  The change causing the domctl bump is in an implemented
subop, but has also been reverted in favor of a different way of performing
the same actions.  Therefore, there is no net difference.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15365
2015-06-28 16:31:54 +00:00
Christian Borntraeger
c2baee9b7b add KVM_S390_MEMOP ioctl handling
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15334
2015-06-12 10:54:12 +00:00
Julian Seward
eed8fbcd80 Bug 348102 - Patch updating v4l2 API support (edit)
Patch from Hans Verkuil (hverkuil@xs4all.nl) 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15313
2015-06-05 11:23:35 +00:00
Rhys Kidd
11f675de8b Fix unhandled syscall: mach:41 (_kernelrpc_mach_port_guard_trap)
bz#344337

Before:

== 591 tests, 220 stderr failures, 14 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

After:

== 591 tests, 220 stderr failures, 14 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15297
2015-05-30 08:59:46 +00:00
Rhys Kidd
9351332329 Signal handler ucontext_t not filled out correctly on OS X
bz#341419

Before:

== 589 tests, 220 stderr failures, 15 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

After:

== 591 tests, 220 stderr failures, 15 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15296
2015-05-28 12:49:00 +00:00
Florian Krohm
b804dd161f Fix a comment. Do not enumerate segment kinds as all segments
have an extent ... including SkShmC segments.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15278
2015-05-22 15:14:04 +00:00
Philippe Waroquiers
b09ffd9fb9 Have the hash table 'gen' functions comparing the key instead of the
cmp function.
Document this in the cmp function comment in pub_tool_hashtable.h



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15263
2015-05-20 15:08:09 +00:00
Rhys Kidd
2a3a28aecf Fix unhandled syscall: unix:473 (readlinkat) on OS X 10.10
bz#344936

Before:

== 595 tests, 229 stderr failures, 23 stdout failures, 1 stderrB failure, 1 stdoutB failure, 30 post failures ==

After:

== 595 tests, 228 stderr failures, 23 stdout failures, 1 stderrB failure, 1 stdoutB failure, 30 post failures ==


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15260
2015-05-20 13:31:02 +00:00
Philippe Waroquiers
435d51c1c9 This patch reduces the memory needed for the linesF.
Currently, each SecMap has an array of linesF, referenced by the linesZ
of the secmap that needs a lineF, via an index stored in dict[1].
When the array is full, its size is doubled.
The linesF array of a secmap is freed when the SecMap is GC-ed.
The above strategy has the following consequences:
  A. in average, 25% of the LinesF are unused.
  B. if a SecMap has 'temporarily' a need for linesF, but afterwards,
     these linesF are converted to normal lineZ representation, the linesF
     will not be recuperated unless the SecMap is GC-ed (i.e. fully marked
     no access).

The patch replaces the linesF array private per SecMap
by a pool allocator of LinesF shared between all SecMap.
A lineZ that needs a lineF will directly point to its lineF (using a pointer
stored in dict[1]), instead of having in dict[1] the index in the SecMap
linesF array.
When a lineZ needs a lineF, it is allocated from the pool allocator.
When a lineZ does not need anymore a lineF, it is returned back to the
pool allocator.

On a firefox startup, the above strategy reduces the memory for linesF
by about 42Mb. It seems that the more firefox is used (e.g. to visit
a few websites), the bigger the memory gain.
After opening the home page of valgrind, wikipedia and google, the memory
gain is about 94Mb:
trunk:
  linesF:    392,181 allocd ( 203,934,120 bytes occupied) (   173,279 used)
patch:
  linesF:    212,966 allocd ( 109,038,592 bytes occupied) (   170,252 used)

There is also less alloc/free operations in core arena with the patch:
trunk:
  core    :   810,680,320/  802,291,712 max/curr mmap'd, 17/19 unsplit/split sb unmmap'd,    759,441,224/  703,191,896 max/curr,    40631760/16376828248 totalloc-blocks/bytes,   188015696 searches 8 rzB
patch:
  core    :   701,628,416/  690,753,536 max/curr mmap'd, 12/29 unsplit/split sb unmmap'd,    643,041,944/  577,793,712 max/curr,    32050040/14056017712 totalloc-blocks/bytes,   174097728 searches 8 rzB


In terms of performance, no CPU impact detected on Firefox startup.
Note we have no representative reproducible (and preferrably small)
perf test that uses extensively linesF. Firefox is a good heavy lineF
user but is far to be reproducible, and is very far to be small.

Theoretically, in terms of CPU performance, the patch might have some
small benefits here and there for read operations, as the lineF pointer
is directly retrieved from the lineZ, rather than retrieved via an indirection
in the linesF array.
For write operations, the patch might need a little bit more CPU,
as we replace an
  assignment to lineF inUse boolean to False (and then probably back to True
  when the cacheline is written back)
by 
  a call to pool allocator VG_(freeEltPA) (and then probably a call to
  VG_(allocEltPA) when the cacheline is written back).
These PA functions are small, so cost should be ok.
We might however still maintain in clear_LineF_of_Z the last cleared lineF
and re-use it in alloc_LineF_for_Z. Not sure how many calls to the PA functions
would be avoided by this '1 elt cache' (and the needed 'if elt == NULL'
check in both clear_LineF_of_Z and alloc_LineF_for_Z.
This possible optimisationwill be looked at later.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15253
2015-05-17 19:32:42 +00:00
Florian Krohm
e197c8e00d Changes for tilegx: Use VKI_AT_FDCWD not AT_FDCWD.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15227
2015-05-13 21:26:46 +00:00
Philippe Waroquiers
4256a17920 This patch adds a function that allows to directly properly size an xarray
when the size is known in advance.

3 places identified where this function can be used trivially.

The result is a reduction of 'realloc' operations in core
arena, and a small reduction in ttaux arena
(it is the nr of operations that decreases, the memory usage itself
stays the same (ignoring some 'rounding' effects).

E.g. for perf/bigcode 0, we change from
  core 1085742/ 216745904 totalloc-blocks/bytes,     1085733 searches
  ttaux 5348/   6732560 totalloc-blocks/bytes,        5326 searches
to
  core 712666/ 190998592 totalloc-blocks/bytes,      712657 searches
  ttaux 5319/   6731808 totalloc-blocks/bytes,        5296 searches

For bz2, we switch from
  core 50285/  32383664 totalloc-blocks/bytes,       50256 searches
  ttaux 670/    245160 totalloc-blocks/bytes,         669 searches
to
  core 32564/  29971984 totalloc-blocks/bytes,       32535 searches
  ttaux 605/    243280 totalloc-blocks/bytes,         604 searches

Performance wise, on amd64, this improves memcheck performance
on perf tests by 0.0, 0.1 or 0.2 seconds depending on the test.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15173
2015-05-01 16:46:38 +00:00
Philippe Waroquiers
d6c0fde7fe Move a comment useful to the caller to the .h, rather than keeping it
in the .c



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15127
2015-04-21 20:56:49 +00:00
Bart Van Assche
44609129ea Add support for LL_IOC_PATH2FID and LL_IOC_GETPARENT Lustre ioctls
From: Frank Zago <fzago@cray.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15123
2015-04-21 17:46:52 +00:00
Florian Krohm
fd55c4421f Remove SysRes::_valEx from common code as it is specific to mips.
ifdef'ed accordingly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15117
2015-04-20 21:02:18 +00:00
Florian Krohm
a9b8e1e789 Remove function sr_ResHI from Linux specific code.
Add function VG_(sr_as_string).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15116
2015-04-20 20:42:42 +00:00
Zhi-Gang Liu
48fab8613a Add TILEGX arch. specific syscall #245, __NR_cacheflush
By:Zhi-Gang Liu


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15096
2015-04-15 03:22:17 +00:00
Philippe Waroquiers
da3a839f90 Remove useless arguments in sparsewa, that were inheritated from WordFM
These arguments are not needed for sparsewa, as they can only
return the key given in input.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15083
2015-04-11 11:42:22 +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
Florian Krohm
e70d5a57f1 The linux launcher showed some odd behaviour. When given a shell script
named 'now' with this contents:

#!
/bin/date

the platform selection logic does this:

--11196:1:launcher no tool requested, defaulting to 'memcheck'
--11196:2:launcher   selecting platform for './now'
--11196:2:launcher   selecting platform for './now'
--11196:2:launcher   opened './now'
--11196:2:launcher   read 13 bytes from './now'
--11196:2:launcher   selecting platform for ''
--11196:2:launcher   selecting platform for '/home/florian/bin/'
--11196:2:launcher   opened '/home/florian/bin/'
--11196:2:launcher   selected platform 'unknown'
--11196:1:launcher no platform detected, defaulting platform to 'amd64-linux'

That is not quite right. Instead the platform should be determined by
examining the default shell.
Additionally, define VKI_BINPRM_BUF_SIZE because on linux only that many
characters are considered on a #! line. C.f. <linux>/fs/binfmt_script.c
m_ume/* needs to be adapted as well but that is a different patch.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15068
2015-04-06 14:29:45 +00:00
Florian Krohm
87a05e65b1 Tweak STATIC_ASSERT such that there is no warning about an unused
variable when used at block scope.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15066
2015-04-04 18:43:00 +00:00
Florian Krohm
17913a5d5d Fix function sr_EQ which compares two SysRes values. On Linux it was
forgotten to compare SysRes::_valEx.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15060
2015-04-01 19:20:16 +00:00
Rhys Kidd
537b3dfeeb Fix Darwin: -v does not show kernel version
bz#201435

Before:

== 590 tests, 237 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

After:

== 590 tests, 237 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15056
2015-04-01 12:15:49 +00:00
Florian Krohm
f39011b8b6 Add STATIC_ASSERT and use it.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15047
2015-03-28 18:36:01 +00:00
Florian Krohm
2055aa80cf Simplify expression.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15035
2015-03-23 20:04:14 +00:00
Julian Seward
37f7ddaea7 PRE(sys_prctl): handle PR_SET_SECCOMP.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14994
2015-03-10 11:05:10 +00:00
Florian Krohm
ec19425185 Include pub_core_aspacemgr.h only where needed.
Also fixes BZ #344235.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14966
2015-02-26 17:48:07 +00:00
Mark Wielaard
5fa9a30cea Bug #344318 socketcall should wrap recvmmsg and sendmmsg
Some architectures, e.g. s390, don't have dedicated recvmmsg and sendmmsg
system calls, but use the socketcall multiplexing system call with
SYS_RECVMMSG or SYS_SENDMMSG (just like the accept4 systemcall can also
be called through socketcall). Create separate helpers for recvmmsg and
sendmmsg helpers that can be used by either the direct syscall or the
socket call.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14964
2015-02-25 14:00:14 +00:00
Rhys Kidd
f3c4b1a67a Fix OS X 10.10 (Yosemite) - missing system calls and fcntl code, courtesy of Bill Zissimopoulos
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14951
2015-02-21 12:24:18 +00:00