Commit Graph

52 Commits

Author SHA1 Message Date
Mark Wielaard
219f3152bc Bug #359503 continued. adjtimex syscall missing on arm64.
Enable adjtimex syscall on arm64 and fix bug if argument is a bad pointer.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15953
2016-09-14 11:47:26 +00:00
Mark Wielaard
6b8c5dfb75 Bug 363680 add renameat2() support
Patch written by Jann Horn <jannhorn@googlemail.com>.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15889
2016-05-31 12:16:15 +00:00
Mark Wielaard
958ea4cb5b Bug #363705 arm64 missing syscall name_to_handle_at and open_by_handle_at
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15887
2016-05-30 14:17:25 +00:00
Mark Wielaard
d4ec6d9870 Bug 359503 - Add missing syscalls for aarch64 (arm64)
Enable more arm64 syscalls. ioprio_set, ioprio_get, preadv, pwritev,
vmsplice, splice, tee, waitid, clock_nanosleep and perf_event_open.
Reported and patch (mostly) by Marcin Juszkiewicz.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15826
2016-03-09 16:18:37 +00:00
Mark Wielaard
a848da57ad Add arm64 scalar test. Enable tested syscalls.
The new memcheck/tests/arm64-linux/scalar test is based on the
memcheck/tests/x86-linux/scalar test and contains all syscalls
that are also available on arm64. To make comparison of exp results
easier the order of the tested syscalls is the same as on x86.
This enables a couple extra arm64 syscalls. Part of the fix for
bug #359503 - Add missing syscalls for aarch64 (arm64).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15825
2016-03-09 16:18:36 +00:00
Ivo Raisr
912bede3dd Sanitize signal mask in ppoll and pselect syscalls
Reported and Linux patch contributed by Steven Smith <sos22@archy.org.uk>
Fixes BZ#359871



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15823
2016-03-08 09:04:48 +00:00
Mark Wielaard
3d7da7a718 Bug 353084 arm64 doesn't support sigpending system call.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15676
2015-09-23 12:15:36 +00:00
Mark Wielaard
3d33343cb7 Bug 353083 arm64 doesn't implement various xattr system calls.
This enables setxattr, lsetxattr, fsetxattr, fgetxattr, removexattr,
lremovexattr, fremovexattr, listxattr, llistxattr and flistxattr on
arm64-linux.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15675
2015-09-23 11:51:47 +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
bbb480bad2 Fix format string confusion that was somehow related to r15510.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15556
2015-08-16 11:54:38 +00:00
Mark Wielaard
a398bfb863 Bug #351140 arm64 syscalls setuid (146) and setresgid (149) not implemented.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15517
2015-08-09 22:37:52 +00:00
Florian Krohm
9a3883bf3d Fix printf format inconsistencies as pointed out by gcc -Wformat-signedness.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15510
2015-08-08 21:45:33 +00:00
Florian Krohm
7a474c9455 Fix typos in source code. Patch by Dmitriy (olshevskiy87@bk.ru).
Fixes BZ #349874


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15394
2015-07-05 21:53:33 +00:00
Tom Hughes
2799d8f88a Add support for the syncfs system call.
Based on patch from j@eckel.me on BZ#347389.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15191
2015-05-07 18:54:31 +00:00
Florian Krohm
8d5672dbd6 Remove a few unneeded header files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15111
2015-04-18 17:45:34 +00:00
Mark Wielaard
795a4f2d37 Bug #344307 2 unhandled syscalls on aarch64/arm64: umount2(39), mount (40)
Reporter: Branislav Blaskovic, bblaskov@redhat.com
Patch: Robin Hack, rhack@redhat.com
Test: Miloš Prchlík, mprchlik@redhat.com

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14944
2015-02-18 14:23:17 +00:00
Mark Wielaard
06a9351cd8 Bug #344295 syscall recvmmsg on arm64 (243) and ppc32/64 (343) unhandled
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14940
2015-02-17 19:50:45 +00:00
Mark Wielaard
6951c3aba9 Bug #344279 syscall sendmmsg on arm64 (269) and ppc32/64 (349) unhandled.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14939
2015-02-17 16:04:09 +00:00
Mark Wielaard
0279de2d80 Bug #344007 accept4 syscall unhandled on arm64 (242) and ppc64 (344)
ppc64 might fall back to socketcall in some cases, but arm64 always uses
accept4 syscall directly. Some (confusing) background on when/how glibc
(wrongly) decides to use a direct accept4 or the socketcall system call:
https://sourceware.org/ml/libc-alpha/2013-12/msg00014.html

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14926
2015-02-10 13:39:04 +00:00
Mark Wielaard
1c42cad510 Bug 343733 Unhandled syscall 187 (msgctl and related) on aarch64
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14917
2015-02-07 22:58:51 +00:00
Mark Wielaard
997880f80c Bug 343732 - Unhandled syscall 144 (setgid) on aarch64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14916
2015-02-07 22:36:48 +00:00
Julian Seward
8f2dab4d99 Enable sys_mbind, sys_get_mempolicy, sys_set_mempolicy on arm64-linux.
Patch from Hideaki Kimura (hideaki.kimura@gmail.com).  Fixes #342038.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14907
2015-02-05 15:28:28 +00:00
Tom Hughes
6504fa50c3 Handle the memfd_create system call.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14875
2015-01-19 21:52:44 +00:00
Florian Krohm
a9aa079113 Change most remaining use of Addr64 in coregrind and the tools to Addr.
Tracking VEX r3056.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14846
2015-01-04 17:20:45 +00:00
Florian Krohm
f1fde81e7d Fix a few VG_(message) invocations. The function does not add a
newline character under the covers.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14796
2014-11-29 17:50:10 +00:00
Julian Seward
065a14f0ab Enable sys_flock on arm64-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14777
2014-11-24 16:19:48 +00:00
Mark Wielaard
560e558b88 Bug 340922 arm64: unhandled getgroups/setgroups syscalls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14716
2014-11-13 13:03:25 +00:00
Tom Hughes
b8308dd756 Add support for the getrandom system call. BZ#340788.
Requires r14705 for updated system call lists.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14709
2014-11-10 09:55:59 +00:00
Mark Wielaard
a83732ca72 Bug 340630 arm64: fchmod (52) and fchown (55) syscalls not recognized.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14686
2014-11-04 13:43:21 +00:00
Julian Seward
2bf85a3929 Bug 340236 - 4 unhandled syscalls on aarch64/arm64:
mknodat (33), fchdir (50), chroot (51), fchownat (54)
Patch from Miroslav Franc (mfranc@redhat.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14677
2014-10-30 14:28:14 +00:00
Julian Seward
9d5584da64 Bug 340028 - unhandled syscalls for arm64 (msync, pread64, setreuid
and setregid)
Patch from dimitry@google.com.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14676
2014-10-30 14:11:32 +00:00
Julian Seward
640fd43da7 Bug 339940 - (arm64/aarch64) unhandled syscall: 83 (sys_fdatasync) + patch
Patch from David Abdurachmanov <davidlt@cern.ch>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14675
2014-10-30 13:54:24 +00:00
Mark Wielaard
b57b59207f Bug 339855 arm64 unhandled getsid/setsid syscalls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14617
2014-10-10 21:33:39 +00:00
Mark Wielaard
139476d494 Bug 339853 arm64 times syscall unknown.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14616
2014-10-10 21:13:28 +00:00
Julian Seward
f226136959 arm64-linux: enable sys_mlock, sys_mlockall. Fixes #337766.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14456
2014-09-04 11:22:31 +00:00
Julian Seward
cd529fcc23 Remove unused variable.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14402
2014-09-01 08:41:43 +00:00
Philippe Waroquiers
51c6c85e22 The semantic of the stack bounds is not consistent or is not described.
At various places, there were either some assumption that the 'end'
boundary (highest address) was either not included, included,
or was the highest addressable word, or the highest addressable byte.
This e.g. was very visible when doing:
  ./vg-in-place -d -d ./helgrind/tests/tc01_simple_race|&grep regi
giving
  --24040:2:stacks     register 0xBEDB4000-0xBEDB4FFF as stack 0
  --24040:2:stacks     register 0x402C000-0x4A2C000 as stack 1
showing that the main stack end was (on x86) not the highest word
but the highest byte, while for the thread 1, the registered end
was a byte not part of the stack.

The attached patch ensures that stack bounds semantic are documented and
consistent. Also, some of the stack handling code is factorised.

The convention that the patch ensures and documents is:
start is the lowest addressable byte, end is the highest addressable byte.
(the words 'min' and 'max' have been kept when already used, as this wording is 
consistent with the new semantic of start/end).

In various debug log, used brackets [ and ] to make clear that
both bounds are included.

The code to guess and register the client stack was duplicated
in all the platform specific syswrap-<plat>-<os>.c files.
Code has been factorised in syswrap-generic.c

The patch has been regression tested on
   x86, amd64, ppc32/64, s390x.
It has been compiled and one test run on arm64.
Not compiled/not tested on darwin, android, mips32/64, arm


More in details, the patch does the following:

coregrind/pub_core_aspacemgr.h
include/valgrind.h
include/pub_tool_machine.h
coregrind/pub_core_scheduler.h
coregrind/pub_core_stacks.h
  - document start/end semantic in various functions
 also in pub_tool_machine.h:
  - replaces unclear 'bottommost address' by 'lowest address'
    (unclear as stack bottom is or at least can be interpreted as
     the 'functional' bottom of the stack, which is the highest
      address for 'stack growing downwards').
coregrind/pub_core_initimg.h
  replace unclear clstack_top by clstack_end
coregrind/m_main.c
  updated to clstack_end

coregrind/pub_core_threadstate.h
  renamed client_stack_highest_word to client_stack_highest_byte
coregrind/m_scheduler/scheduler.c
  computes client_stack_highest_byte as the highest addressable byte
  Update comments in call to VG_(show_sched_status)
coregrind/m_machine.c
coregrind/m_stacktrace.c
  updated to client_stack_highest_byte, and switched 
    stack_lowest/highest_word to stack_lowest/highest_byte accordingly

coregrind/m_stacks.c
  clarify semantic of start/end,
  added a comment to indicate why we invert start/end in register call
  (note that the code find_stack_by_addr was already assuming that
  end was included as the checks were doing e.g.
    sp >= i->start && sp <= i->end

coregrind/pub_core_clientstate.h
coregrind/m_clientstate.c
  renames Addr  VG_(clstk_base) to Addr  VG_(clstk_start_base)
    (start to indicate it is the lowest address, base suffix kept
     to indicate it is the initial lowest address).

coregrind/m_initimg/initimg-darwin.c
   updated to  VG_(clstk_start_base)
   replace unclear iicii.clstack_top by iicii.clstack_end
   updated clstack_max_size computation according to both bounds included.

coregrind/m_initimg/initimg-linux.c
   updated to  VG_(clstk_start_base)
   updated VG_(clstk_end) computation according to both bounds included.
   replace unclear iicii.clstack_top by iicii.clstack_end

coregrind/pub_core_aspacemgr.h
  extern Addr VG_(am_startup) : clarify semantic of the returned value
coregrind/m_aspacemgr/aspacemgr-linux.c
   removed a copy of a comment that was already in pub_core_aspacemgr.h
     (avoid double maintenance)
   renamed unclear suggested_clstack_top to suggested_clstack_end
    (note that here, it looks like suggested_clstack_top was already
     the last addressable byte)

* factorisation of the stack guessing and registration causes
  mechanical changes in the following files:
      coregrind/m_syswrap/syswrap-ppc64-linux.c
      coregrind/m_syswrap/syswrap-x86-darwin.c
      coregrind/m_syswrap/syswrap-amd64-linux.c
      coregrind/m_syswrap/syswrap-arm-linux.c
      coregrind/m_syswrap/syswrap-generic.c
      coregrind/m_syswrap/syswrap-mips64-linux.c
      coregrind/m_syswrap/syswrap-ppc32-linux.c
      coregrind/m_syswrap/syswrap-amd64-darwin.c
      coregrind/m_syswrap/syswrap-mips32-linux.c
      coregrind/m_syswrap/priv_syswrap-generic.h
      coregrind/m_syswrap/syswrap-x86-linux.c
      coregrind/m_syswrap/syswrap-s390x-linux.c
      coregrind/m_syswrap/syswrap-darwin.c
      coregrind/m_syswrap/syswrap-arm64-linux.c
 Some files to look at more in details:
  syswrap-darwin.c : the handling of sysctl(kern.usrstack) looked
    buggy to me, and has probably be made correct by the fact that
     VG_(clstk_end) is now the last addressable byte. However,unsure
    about this, as I could not find any documentation about 
    sysctl(kern.usrstack). I only find several occurences on the web,
    showing that the result of this is page aligned, which I guess
    means it must be 1+ the last addressable byte.
  syswrap-x86-darwin.c and syswrap-amd64-darwin.c
   I suspect the code that was computing client_stack_highest_word
   was wrong, and the patch makes it correct.
  syswrap-mips64-linux.c
    not sure what to do for this code. This is the only code
    that was guessing the stack differently from others.
    Kept (almost) untouched. To be discussed with mips maintainers.

coregrind/pub_core_libcassert.h
coregrind/m_libcassert.c
  * void VG_(show_sched_status):
     renamed Bool valgrind_stack_usage to Bool stack_usage
     if stack_usage, shows both the valgrind stack usage and
     the client stack boundaries
coregrind/m_scheduler/scheduler.c
coregrind/m_gdbserver/server.c
coregrind/m_gdbserver/remote-utils.c
   Updated comments in callers to VG_(show_sched_status)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14392
2014-08-29 22:53:19 +00:00
Julian Seward
32cf31c0d8 Enable sys_fchmodat.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13997
2014-06-04 23:22:29 +00:00
Julian Seward
e5d979564f arm64-linux: enable sys_sched_setaffinity, sys_linkat.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13974
2014-05-16 15:02:09 +00:00
Julian Seward
8b72a31ca9 Enable: sys_add_key, sys_keyctl, apparently needed by glibc-2.19.90 on
arm64-linux.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13972
2014-05-15 16:47:56 +00:00
Julian Seward
20f47d4181 Enable syscalls:
sys_readv sys_signalfd4 sys_utimensat sys_timerfd_create
sys_timerfd_settime sys_timerfd_gettime sys_capget sys_syslog
sys_sched_yield sys_sigaltstack sys_rt_sigqueueinfo
sys_mq_timedsend sys_mq_timedreceive sys_mq_notify
sys_mq_getsetattr sys_mremap



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13892
2014-04-07 14:47:23 +00:00
Julian Seward
da3d709fb7 Enable syscalls: sys_inotify_init1 sys_inotify_add_watch
sys_inotify_rm_watch sys_fallocate sys_quotactl sys_pwrite64
sys_sysinfo sys_shmctl wrap_sys_shmat sys_shmdt



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13857
2014-03-08 20:34:45 +00:00
Julian Seward
a6f3590485 Enable the following syscalls: sys_eventfd2 sys_symlinkat sys_renameat
sys_fstatfs sys_fsync sys_clock_getres sys_sched_getaffinity
sys_shmget sys_fadvise64


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13855
2014-03-07 22:48:50 +00:00
Julian Seward
12f983e5dc Enable sys_epoll_create1, sys_epoll_ctl, sys_epoll_pwait, sys_prctl.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13849
2014-03-02 12:49:52 +00:00
Julian Seward
1ffe03c510 Enable the following syscalls, which are needed to make regtests
in none/ work:
sys_ftruncate
sys_setitimer
sys_rt_sigsuspend
sys_rt_sigtimedwait
sys_mq_open
sys_mq_unlink
sys_semget
sys_semctl
sys_semtimedop
sys_semop
sys_listen
sys_accept
sys_process_vm_readv
sys_process_vm_writev



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13845
2014-03-01 11:24:42 +00:00
Julian Seward
686ec53b47 Enable a few more syscalls:
sys_setpriority, sys_getpriority, sys_getresuid,
sys_getresgid, sys_recvfrom, sys_readahead


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13840
2014-02-27 11:14:19 +00:00
Julian Seward
b1b41a45d8 * fix a bug in sys_clone that was causing threads to hang at exit
* enable enough syscalls to be able to run ssh and bash


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13826
2014-02-21 14:51:14 +00:00
Julian Seward
40469b7085 Enable sys_ppoll, sys_kill, sys_socketpair.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13824
2014-02-20 23:20:08 +00:00
Julian Seward
c1cd47aae4 First attempt at supporting sys_clone.
Also enable: sys_exit, sys_nanosleep, sys_madvise.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13822
2014-02-20 17:36:56 +00:00
Tom Hughes
6ef2cbe59d Add support for the clock_adjtime system call.
Based on a patch from Stefan Sørensen on BZ#330469.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13785
2014-01-30 22:33:02 +00:00