Enable wrappers on mips64 for the following calls:
- dup3
- accept4
- epoll_create1
- timerfd_settime
- newfstatat
Also, allow additional flock64 values in sys_fcntl for mips64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13358
Almost mechanical transformation, removes > 1000 SLOC.
Compiled and regtested on amd64/x86/mips32
Compiled and (somewhat) tested on mips64
Compiled on arm
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13302
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
sys_socketcall was duplicated in syswrap-{ppc64|ppc32|arm|mips32|s390x}-linux.c
=>
* Similarly for what was done for sys_ipc, factorise the code in syswrap-linux.c
* re-enabled PRE_MEM_READ for VKI_SYS_SENDMSG and VKI_SYS_RECVMSG
(PRE_MEM_READ calls were commented out around 2003, for what
was supposed a glibc bug.
The PRE_MEM_READ calls were already re-enabled in s390x)
* s390x also had some more checking to verify the addressibility of
the args and fail the syscall with EFAULT if not addressable
=> same checks are now done for all platforms.
(tested on x86/amd64/mips32/s390x/ppc32/ppc64,
compiled for arm-android-emulator)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13104
Additional refinement in PRE(sys_ipc) on which arguments to check for the call.
This is still a simplistic check, yet it should resolve additional cases.
One of the resolved cases is memcheck/tests/sem on MIPS.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13084
Depending on the semctl command (arg3), arg4 might or might not be needed.
The PRE(sys_ipc) multiplexed syscall for semctl was always checking
all 4 args.
The fix consists in dereferencing the 4th arg (which in sys_ipc is ARG5)
only if the semctl syscall cmd implies 4 arguments.
This avoids the false positive on linux x86.
Note that PRE(sys_ipc) is still too simplistic as it assumes
that 6 args are always read, which is not the case.
This seems to cause false positive on mips:
memcheck on none/tests/sem gives:
Syscall param ipc(fifth) contains uninitialised byte(s)
It would be nice to implement the multiplexed PRE(sys_ipc) by
calling the PRE(sys_xxxx) similar PRE, depending on ARG1 of sys_ipc.
This would then avoid the simplistic PRE(sys_ipc) logic without duplicating
the logic in PRE(sys_semctl) (and all other sys_ipc multiplexed syscalls).
However, I found no easy way to do that.
With the current fix, some logic about semctl is partially duplicated between
the PRE(sys_ipc) (for platforms such as x86 having a multiplexed sys call)
and PRE(sys_semctl) (for platforms such as amd64, having a direct sys call)
to fix the false positive encountered on x86.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13082
Rev 13078 removed a PRE call (for SEMCTL) in the POST(sys_ipc).
This commit adds the correct POST call for SEMCTL in POST(sys_ipc).
(note: some tests are missing in this area, as removing PRE
and adding POST did not cause any test result to change).
This is the last patch to restructure the sys_ipc code.
After this patch, should be able to do the real fix
for 23837 (semctl GETVAL false positive)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13079
Now that the PRE/POS(sys_ipc) code is not duplicated anymore,
fix two strange things in this code:
* PRE(sys_ipc) : add missing ; after the call PRE_REG_READ6
(strange that this was compiling without it ???)
* POST(sys_ipc) : it seems there was a copy/paste of
the PRE(sys_ipc) code for VKI_SEMCTL.
Cannot understand why we would need to call again
deref_Addr and ML_(generic_PRE_sys_semctl) in the POST(sys_ipc).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13078
From: Ian Campbell <Ian.Campbell@citrix.com>
Under Xen the toolstack is responsible for managing the domains in
the system, e.g. creating, destroying, and otherwise manipulating
them.
To do this it uses a number of ioctls on the /proc/xen/privcmd
device. Most of these (the MMAPBATCH ones) simply set things up such
that a subsequenct mmap call will map the desired guest memory. Since
valgrind has no way of knowing what the memory contains we assume
that it is all initialised (to do otherwise would require valgrind to
be observing the complete state of the system and not just the given
process).
The most interesting ioctl is XEN_IOCTL_PRIVCMD_HYPERCALL which
allows the toolstack to make arbitrary hypercalls. Although the
mechanism here is specific to the OS of the guest running the
toolstack the hypercalls themselves are defined solely by the
hypervisor. Therefore I have split support for this ioctl into a part
in syswrap-linux.c which handles the ioctl itself and passes things
onto a new syswrap-xen.c which handles the specifics of the
hypercalls themselves. Porting this to another OS should just be a
matter of wiring up syswrap-$OS.c to decode the ioctl and call into
syswrap-xen.c. In the future we may want to split this into
syswrap-$ARCH-xen.c but for now this is x86 only.
The hypercall coverage here is pretty small but is enough to get
reasonable(-ish) results out of the xl toolstack when listing,
creating and destroying domains.
One issue is that the hypercalls which are exlusively used by the
toolstacks (as opposed to those used by guest operating systems) are
not considered a stable ABI, since the hypervisor and the lowlevel
tools are considered a matched pair. This covers the sysctl and
domctl hypercalls which are a fairly large chunk of the support
here. I'm not sure how to solve this without invoking a massive
amount of duplication. Right now this targets the Xen unstable
interface (which will shortly be released as Xen 4.2), perhaps I can
get away with deferring this problem until the first change .
On the plus side the vast majority of hypercalls are not of interest
to the toolstack (they are used by guests) so we can get away without
implementing them.
Note: a hypercall only reads as many words from the ioctl arg
struct as there are actual arguments to that hypercall and the
toolstack only initialises the arguments which are used. However
there is no space in the DEFN_PRE_TEMPLATE prototype to allow this to
be communicated from syswrap-xen.c back to syswrap-linux.c. Since a
hypercall can have at most 5 arguments I have hackily stolen ARG8 for
this purpose.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12963
Glibc deliberately passes random value for the sixth parameter when calling
FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME. This is a regular case of using the
Futex API, so V should not complain that "Syscall param futex(val3) contains
uninitialised byte(s)", if the futex does not have a specified value initially.
For more info, see function pthread_initialize_minimal_internal at:
glibc/nptl/nptl-init.c.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12773
Allow Valgrind to run on android emulator.
+ added README.android_emulator giving some details about versions used.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12710
Removing a warning of 'implicit declaration of function vgPlain_get_SP' when
compiled for MIPS. Done by including an appropriate header file.
Also, minor style issue correction for #define PSRAn_BE(n,s,t,a) macro.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12707
This patch fixes incorrect handling of sys_shmdt for MIPS. Linux wrappers have
been added for sys_sigprocmask, sys_timerfd_create, sys_timerfd_gettime, and
sys_timerfd_settime on MIPS.
The bug has been reported at https://bugs.kde.org/show_bug.cgi?id=270777 as
sh_mat issue, and it can be reproduced with shmat-sample.c from
https://bugs.kde.org/show_bug.cgi?id=222545.
The change also fixes sigprocmask from memcheck tests.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12658
* manual-core.xml : fix a typo
* include/pub_tool_inner.h : new file, defining macros for inner annotation
include/Makefile.am : reference this new file.
* syswrap-linux.c : when ENABLE_INNER, register the stacks for the outer.
(otherwise, nothing works properly).
* m_redir.c : avoid inner interpreting the outer vgpreload instructions.
* sema.c : annotate the semaphore with RWLOCK annotations for helgrind
* ticket-lock-linux.c : similar.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12414
* initial support for Pandaboard/Linaro
* on Android/ARM, ask for non-executable stacks in the executables
* disable Memcheck's strcasestr intercept; its use of tolower()
causes the dynamic linker to fail.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12234