F_DUPFD_CLOEXEC is not universally available
The same issue (and the same patch to the byte) was experienced/proposedby Vince Weaver.
Signed-off-by: malc <av1474@comtv.ru>
Fix Sparse warnings: add "static"
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
linux-user: fadvise64 implementation
good enough to pass all LTP fadvise64 tests
Signed-off-by: Ulrich Hecht <uli@suse.de>Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
linux-user: zero fstat buffer to initialize nsec fields
The fstat implementation does not initialize the nanosecond fields in thestat buffer; this caused funny values to turn up there, preventing, forinstance, cp -p from preserving timestamps because utimensat rejected...
linux-user: Rewrite mmap_find_vma() to work fine on 64-bit hosts with 32-bit targets
qemu's page table can be incomple if /proc/self/maps is unavailable orhost allocating a memory with mmap(), so we can't use it to find freememory area.
New version mmap_find_vma() uses mmap() without MAP_FIXED to find free...
m68k, linux-user: add setup_rt_frame
This patch implements setup_rt_frame().
Signed-off-by: Laurent Vivier <laurent@vivier.eu>Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
m68k, linux-user: enable sigaltstack()
As setup_frame() and setup_rt_frame() are now implemented we can nowenable sigaltstack().
linux-user: fix mq_* compilation problems
mqueue.h is only available if _NR_mq_open is defined. So don't includeit unconditionally. Similarly, the mq* family of syscalls depend on_NR_mq_open. Finally, the copy{from,to}_user_mq_attr functions should...
linux-user: fcntl fixes for LTP
Fixes swaps on l_pid which were pretty much of random size. ImplementsF_SETLEASE, F_GETLEASE. Now passes all LTP fcntl tests.
linux-user: enable getdents for > 32-bit systems
works perfectly fine with the example from getdents(2) and passes the LTPtests (tested with s390x on x86_64 emulation)
m68k,linux-user: add setup_frame
This patch adds signals management for linux-user.
It implements setup_frame() which allows to call the user signalhandler.
setup_rt_frame() is always unimplemented.
linux-user: add eventfd support
Straightforward implementation. This syscall is rare enough that wedon't need to support the odder cases, just disable it if host glibcis too old.
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Replace local ADDRX/PADDRX macros with TARGET_FMT_lx/plx
linux-user: compile envlist.c only once
user: compile path.c only once
Also merge bsd-user/path.c and linux-user/path.c.
Fix symfind.
this patch fixes an issue in symfind.
Assume you have the following symbols:
Address Size0045bca0 00000080 T s00045bd20 00000112 T s1
You'll notice that s1 is s0 + size.
So the current symfind will find that address 0045bd20 belongs to s0...
Sparc64: replace tsptr with helper routine
tl and tsptr of members sparc64 cpu state must be changedsimultaneously to keep trap state window in sync with currenttrap level. Currently translation of store to tl does not changetsptr, which leads to corrupt trap state on corresponding...
linux-user: make FUTEX_* calls honor timeout parameter
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>Signed-off-by: malc <av1474@comtv.ru>
linux-user: handle POWERPC_EXCP_STCX
We handle conditional stores as an exception so we can ensure that noother thread is changing memory out from underneath us.
More NULL pointer fixes
rename USE_NPTL to CONFIG_USE_NPTL
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
rename HAVE_GPROF to TARGET_GPROF
Use was not consistent, in Makefile was TARGET_GPROF and in *h HAVE_GPROF
rename WORDS_BIGENDIAN to HOST_WORDS_BIGENDIAN
Fix most warnings (errors with -Werror) when debugging is enabled
I used the following command to enable debugging:perl -p -i -e 's/^\/\/#define DEBUG/#define DEBUG/g' * /* *//*
Use correct byteswap routine for elf_note
All elf64_note structure members are Elf64_Word (which is 32bit value)hence using bswaptls to byteswap it on 64bit platforms is incorrect.
Avoid name clashes with symbols that leak from system headers
ELF codedump build failures
Rename ELF coredump types to avoid conflict with the corresponding host types.
Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Userspace guest address offsetting
Re-implement GUEST_BASE support.Offset guest ddress space by default if the guest binary containsregions below the host mmap_min_addr.Implement support for i386, x86-64 and arm hosts.
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>...
Update to a hopefully more future proof FSF address
Avoid SIGSEGV when dumping cpu state without enabled logging
consolidate user cpu_{in, out}[bwl] into ioport-user.c
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge commit 'linux-user/linux-user-for-upstream' into tmp-staging
MIPS signal handling fix
Add explicit padding to MIPS signal frame structures.
Signed-off-by: Paul Brook <paul@codesourcery.com>
MIPS atomic instructions
Implement MIPS ll/sc instructions using atomic compare+exchange.
Fix MIPS sys_clone
The clone syscall takes 6 args.
wrap path for access syscall
getrlimit conversion mix-up
Fixes getrlimit implementation that overwrote the result of the syscallinstead of converting it
pipe argument should not be signed
pipedes is an address, it should not be signed (breaks for addresses
0x80000000)
64-bit clean socketcall syscall
makes socketcall 64-bit clean so it works on 64-bit big-endian systems
linux-user: increment MAX_ARG_PAGES
There's a error When doing something like that :find / -type f -print0 | xargs -0 echo
[ done in a arm chroot with qemu-arm and linux binfmt stuff or withfind / -type f -print0 | qemu-arm -L <path> <path>/usr/bin/xargs -0...
linux-user: check some parameters for some socket syscalls.
This patch is fixing following issues :
- commit 8fea36025b9d6d360ff3b78f88a84ccf221807e8 was applied to do_getsockname instead of do_accept.- Some syscalls were not checking properly the memory addresses passed...
linux-user/syscall.c: remove warning: ‘array’ may be used uninitialized in this function
Removes the following warning
CC i386-linux-user/syscall.occ1: warnings being treated as errors/media/nfs/qemu/linux-user/syscall.c: In function ‘do_syscall’:/media/nfs/qemu/linux-user/syscall.c:2219: warning: ‘array’ may be used uninitialized in this function...
Fix missing strnlen problems
Fix missing strnlen (a GNU extension) problems by using qemu_strnlenused for user emulators also for system emulators.
microblaze: Support the latest mmu-kernel stat64 ABI.
Microblaze recently changed their ABI. The new is not backwards compatibleand there doesn't seem to be a way to distinguish old/new binaries.Let's support the latest ABI for now and hope someone figures out a way to...
linux-user: strace now handles guest stringscorrectly [v2]
On Tue, Jun 16, 2009 at 08:19:23PM -0500, Anthony Liguori wrote:
malc wrote: On my system the above line causes gcc to emit: In file included from /home/malc/x/rcs/git/qemu/linux-user/strace.c:12:...
malc wrote:
On my system the above line causes gcc to emit: In file included from /home/malc/x/rcs/git/qemu/linux-user/strace.c:12:...
On my system the above line causes gcc to emit:
In file included from /home/malc/x/rcs/git/qemu/linux-user/strace.c:12:...
RFC: fix fcntl support in linux-user - new try
Hi,
This is a new try to fix the fcntl support in linux-user. I tried toadress all comments but as the previous version is several weeks old,it's possible that I've missed some.
This patch doesn't handle linux specific fcntl flags. My plan is to get...
linux-user: initialize mmap_mutex properly
We initialize mmap_mutex in any child threads/processes, but we need tocorrectly statically initialize it for the original process.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
linux-user/syscall.c: define _ATFILE_SOURCE
Needed to make sure the xxxat() functions are available.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
linux-user: remove duplicate tswap32() from do_getsockopt()
This issue has been detected with tests/linux-tests.c:
linux-test.c:330: getsockopt
327 len = sizeof(val);328 chk_error(getsockopt(server_fd, SOL_SOCKET, SO_TYPE, &val, &len));329 if (val != SOCK_STREAM)...
linux-user: add tee, splice and vmsplice
Add support for tee, splice and vmsplice.
Originally from: vibi sreenivasan <vibi_sreenivasan@cms.com>
Riku: squashed patches together, added a test to configureand removed compliler warning by picking up correct type for...
linux-user: Added IP_ADD_MEMBERSHIP/IP_DROP_MEMBERSHIP flags to setsockopt
Signed-off-by: Lionel Landwerlin <lionel.landwerlin@openwide.fr>Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
linux-user: Added IP_(UN)BLOCK_SOURCE/IP_(ADD|DROP)_SOURCE_MEMBERSHIP flags to setsockopt
linux-user: include linux/fs.h
defines FIGETBSZ FIBMAP, allowing the respective ioctl's tobe implemented.
From: Martin Mohring <martin.mohring@opensuse.org>Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
linux-user: support private futexes
Implemented the same way as in the kernel.
add futex wake op
linux-user: update syscall list
In preparation for supporting pipe2()
linux-user: implement pipe2 [v3]
implement pipe2 syscall.
[v2] fix do_pipe on mips and sh4[v3] use pipe2 to ensure atomicity, but only when it is available.
export mmap_find_vma for shmat
Implement shm* syscalls and fix 64/32bit errors
No regressions were observed on either 64bit or 32bitIA hosts.
Patch based on original patches by: Kirill A. Shutemov <kirill@shutemov.name> - Implement shm* syscalls - Fix and cleanup IPCOP_shm* ipc calls handling...
linux-user: implemented ELF coredump support for ARM target
When target process is killed with signal (such signal thatshould dump core) a coredump file is created. This file issimilar than coredump generated by Linux (there are few exceptionsthough)....
linux-user: added x86 and x86_64 support for ELF coredump
Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
linux-user: strace now handles guest strings correctly [v2]
- to not to break strace with GUEST_BASE is set:- Strace now can load and print guest strings correctly.- Added printing support for commonly used flags in some syscalls (e.g open, creat, mmap etc.)...
linux-user: fix utimensat
The glibc function for utimensat glibc returns -EINVAL when the path is nullwhich is a different behaviour with the syscall.
path can be null because internally the glibc is using utimensat withpath null when implmenting futimens. If path is null, call futimes...
Fix struct termios host - target translation
When converting the termios structure between host and target intarget_to_host_termios and host_to_target_termios, the c_cc[] array isnever initialised.Calling memset() before using it allows to run successfully "stty echo /...
Return EOPNOTSUPP instead of ENOSYS for xattr syscalls
In current code, we're sending ENOSYS to target when a syscall for thexattrs is done. This makes applications like ls complain loudly aboutthat and breaks scripts parsing the output. Moreover, iirc, implemented...
fix gdbstub support for multiple threads in usermode, v3
When debugging multi-threaded programs, QEMU's gdb stub would report thecorrect number of threads (the qfThreadInfo and qsThreadInfo packets).However, the stub was unable to actually switch between threads (the T...
microblaze: linux-user support.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
microblaze: Add syscall, signal and termbits defs for linux-user.
Only define __llseek if it is going to be used
Avoid implicit truncation compiler warnings
support ELF_HWCAP for PPPC
linux-user: ppc signal handling
Implement setup_{,rt_}frame and do_{,rt_}sigreturn for PPC 32-bit. Usethe same TARGET_QEMU_ESIGRETURN hack as for MIPS to avoid clobberingregister state on a sigreturn.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>...
Replace gcc variadic macro extension with C99 version
Fix compiler warnings in nwfpe code.
MIPS signal handling fixes.
Also fixes a register corruption bug in do_sigreturn. When "returning" from sigreturn we are actually restoring the virtual cpu state from thesignal frame. This is actually surprisingly hard to observe in practice.
Typically an thread be blocked in a FUTEX_WAIT call when the signal arrives,...
MIPS: Raise SIGSEGV, not SIGILL when an access faults.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7193 c046a42c-6fe2-441c-8c8c-71466251a162
Fix target_siginfo ordering for MIPS.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7192 c046a42c-6fe2-441c-8c8c-71466251a162
linux-user: Linux kernel's fchmodat and faccessat have three args (no 4th arg)
In Linux kernel, fchmodat() and faccessat() take tree args.4th value <int flags> is only processed by libc.
Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>...
linux-user: fix IPCOP_sem* and implement sem*
Fix and cleanup IPCOP_sem* ipc calls handling andimplement sem* syscalls.
Riku:
1) Uglify whitespace so that diff gets smaller and easierto review
2) use __get_user in target_to_host_sembuf
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>...
linux-user: fix inotify syscalls
Configure test was broken, so the breakage of the #ifdef'dcode was not noticed.
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7134 c046a42c-6fe2-441c-8c8c-71466251a162
Translate signal values in exit status.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7131 c046a42c-6fe2-441c-8c8c-71466251a162
linux-user: fix getcwd syscall
The patch called "prefer glibc over direct syscalls" (commit 7118) hasreplaced the getcwd syscall with a call to the glibc. With this change,the syscall is returning -1 in error case and 0 otherwise.This is problematic as the sys_getcwd syscall should return the number...
linux-user: fix warnings introduced by r7118
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7120 c046a42c-6fe2-441c-8c8c-71466251a162
linux-user: proper exit code for uncaught signals
The proper exit code for dieing from an uncaught signal is -<signal>.The kernel doesn't allow exit() or _exit() to pass a negative value.To get the proper exit code we need to actually die from an uncaught signal....
linux-user: prefer glibc over direct syscalls
The openat/*at syscalls are incredibly common with modern coreutils,calling them directly via syscalls breaks for example fakeroot. Useglibc stubs whenever directly available and provide old syscallcalling for people still using older libc....
linux-user: removed unnecessary MAX_SOCK_ADDR checks for socket syscalls
- This check is not needed because kernel will check whether given buffer is too small and there is no upper limit for size of the buffer.
From: Mika Westerberg <mika.westerberg@iki.fi>...
linux-user: unix sockets - fix running dbus
dbus sends too short (according to man 7 unix) addrlen for it'sunix socket. I've been told that happens with other applicationsas well. Linux kernel doesn't appear to mind, so I guesswe whould be tolerant as well. Expand sockaddr with +1 to fit...
linux-user: add support for passing contents of argv0
Added switch -0 (zero) which can be used to pass argv0 totarget process. The main use is for a binfmt_misc wrapper whenthe "P - preserve-argv0" setting is used.
From: Mika Westerberg
linux-user: Added posix message queue syscalls except mq_notify
Signed-off-by: Lionel Landwerlin <lionel.landwerlin@openwide.fr>Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>Signed-off-by: Riku Voipio <riku.voipio@iki.fi>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>...
Enable generic accepts-anything cpu by default for usermode emulation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7051 c046a42c-6fe2-441c-8c8c-71466251a162
linux-user: fix fstatat64()/newfstatat() syscall implementation
There are two different syscall names for the same goal.
On systems with sizeof(long) 64 it calls newfstatat.On systems with sizeof(long) 32 it calls fstatat64.
linux-user: fix problems with inotify syscalls
The sys_inotify* calls are defined if the target supports them and thehost supports the necessary syscalls. But the syscalls are handled ifthe target supports them. This situation leads to compilation failures...
Add --with-pkgversion.Allows distributors to identify their builds without needing to hack thesources.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7036 c046a42c-6fe2-441c-8c8c-71466251a162
Add new command line option -singlestep for tcg single stepping.
This replaces a compile time option for some targets and addsthis feature to targets which did not have a compile time option.
Add monitor command to enable or disable single step mode.
Modify monitor command "info status" to display single step mode....
Use a dedicated function to request exit from execution loop
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6762 c046a42c-6fe2-441c-8c8c-71466251a162
The _exit syscall is used for both thread termination in NPTL applications,and process termination in legacy applications. Try to guess which we wantbased on the presence of multiple threads.
Also implement locking when modifying the CPU list.
Signed-off-by: Paul Brook <paul@codesourcery.com>...
Flush stdout after printing usage()
Fixes qemu-arm|grep cpu - with _exit() getting output from qemu --helpis a bit random. Since no atexit() handlers are registered for user modeemulation, just use exit() instead.
Fix crash caused by missing command line arguments
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6580 c046a42c-6fe2-441c-8c8c-71466251a162
Partialy fix mmap at EOF for large pagesize targets in user-mode.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6510 c046a42c-6fe2-441c-8c8c-71466251a162
linux-user: Remove incorrect break;
Reported-By: Laurent Desnogues <laurent.desnogues@gmail.com>Signed-off-by: Riku Voipio <riku.voipio@iki.fi>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6503 c046a42c-6fe2-441c-8c8c-71466251a162