Commit Graph

494 Commits (76b94245507881a0621c5bb3b144c3c19dcbcb4d)

Author SHA1 Message Date
Wim Vander Schelden 76b9424550 linux-user: added fake open() for /proc/self/cmdline
Signed-off-by: Wim Vander Schelden <wim@fixnum.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-06-29 14:19:58 +03:00
Christophe Lyon e8efd8e71f Add support for MAP_NORESERVE mmap flag.
mmap_flags_tbl contains a list of mmap flags, and how to map them to
the target. This patch adds MAP_NORESERVE, which was missing to the
list.

Signed-off-by: Christophe Lyon <christophe.lyon@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-06-29 14:19:58 +03:00
Petar Jovanovic d279279e2b target-mips: implement UserLocal Register
From MIPS documentation (Volume III):

UserLocal Register (CP0 Register 4, Select 2)
Compliance Level: Recommended.

The UserLocal register is a read-write register that is not interpreted by
the hardware and conditionally readable via the RDHWR instruction.

This register only exists if the Config3-ULRI register field is set.

Privileged software may write this register with arbitrary information and
make it accessible to unprivileged software via register 29 (ULR) of the
RDHWR instruction. To do so, bit 29 of the HWREna register must be set to a
1 to enable unprivileged access to the register.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2014-06-18 18:10:47 +02:00
Ed Swierk 480eda2eda linux-user: Return correct errno for unsupported netlink socket
This fixes "Cannot open audit interface - aborting." when the
EAFNOSUPPORT errno differs between the target and host
architectures (e.g. mips target and x86_64 host).

Signed-off-by: Ed Swierk <eswierk@skyportsystems.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-06-17 09:21:41 +03:00
Peter Maydell be3bd286bc linux-user: Don't overrun guest buffer in sched_getaffinity
If the guest's "long" type is smaller than the host's, then
our sched_getaffinity wrapper needs to round the buffer size
up to a multiple of the host sizeof(long). This means that when
we copy the data back from the host buffer to the guest's
buffer there might be more than we can fit. Rather than
overflowing the guest's buffer, handle this case by returning
EINVAL or ignoring the unused extra space, as appropriate.

Note that only guests using the syscall interface directly might
run into this bug -- the glibc wrappers around it will always
use a buffer whose size is a multiple of 8 regardless of guest
architecture.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-06-17 09:21:41 +03:00
Petar Jovanovic a39fb273bd linux-user: fix getrusage and wait4 failures with invalid rusage struct
Implementations of system calls getrusage and wait4 have not previously
handled correctly cases when incorrect address of struct rusage is
passed.
This change makes sure return values are correctly set for these cases.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-05-05 15:21:05 +03:00
Riku Voipio 6d30db19ca linux-user: move uname functions to uname.c
Make syscall.c slightly smaller by moving uname-related
functions to uname.c.

Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-05-02 21:59:36 +03:00
Riku Voipio 18cb008865 linux-user: rename cpu-uname -> uname
To move more uname related functions out of syscall.c,
rename cpu-uname.{c,h} to uname.{c.h}

Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-05-02 21:59:36 +03:00
Natanael Copa 34d6086236 linux-user: avoid using glibc internals in _syscall5 and in definition of target_sigevent struct
Use the public sigset_t instead of the glibc specific internal
__sigset_t in _syscall.

Calculate the sigevent pad size is calculated in similar way as kernel
does it instead of using glibc internal field _pad.

This is needed for building with musl libc.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2014-05-02 21:59:28 +03:00
James Hogan a29e5ba21f linux-user: Handle arches with llseek instead of _llseek
Recently merged kernel ports (such as OpenRISC and Meta) have an llseek
system call instead of _llseek. This is handled for the host
architecture by defining __NR__llseek as __NR_llseek, but not for the
target architecture.

Handle it in the same way for these architectures, defining
TARGET_NR__llseek as TARGET_NR_llseek.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Riku Voipio <riku.voipio@iki.fi>
Cc: Jia Liu <proljc@gmail.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-05-02 21:59:28 +03:00
Huw Davies 4bc2975698 linux-user: Add support for SCM_CREDENTIALS.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-05-02 21:59:28 +03:00
Huw Davies 52b6549442 linux-user: Move if-elses to a switch statement.
This makes adding more message types cleaner.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-05-02 21:59:27 +03:00
Maxim Ostapenko aa07f5ecf9 linux-user: Add /proc/self/exe open forwarding
QEMU already supports /proc/self/{maps,stat,auxv} so addition of
/proc/self/exe is rather trivial.

Fixes https://bugs.launchpad.net/qemu/+bug/1299190

Signed-off-by: Maxim Ostapenko <m.ostapenko@partner.samsung.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-05-02 21:59:27 +03:00
Petar Jovanovic d25295d4ef linux-user: pass correct host flags to accept4()
Flags NONBLOCK and CLOEXEC can have different values on the host and the
guest, so set correct host values before calling accept4().

This fixes several issues with accept4 system call and user-mode of QEMU.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-04-01 09:17:19 +03:00
Peter Maydell ec864874bd linux-user: Fix build if headers don't define _LINUX_CAPABILITY_VERSION_1
Older kernel headers don't define _LINUX_CAPABILITY_VERSION_1.
Switch to using the older _LINUX_CAPABILITY_VERSION; newer headers
still define this for source compatibility.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Acked-by: Riku Voipio <riku.voipio@iki.fi>
2014-03-19 18:19:57 +00:00
Peter Maydell e0eb210ec0 linux-user: Implement capget, capset
Implement the capget and capset syscalls. This is useful because
simple programs like 'ls' try to use it in AArch64, and otherwise
we emit a lot of noise about it being unimplemented.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-03-17 15:26:58 +02:00
Alex Barcelo 1c275925bf signal: added a wrapper for sigprocmask function
Create a wrapper for signal mask changes initiated by the guest;
(this includes syscalls and also the sigreturns from signal.c)
this will give us a place to put code which prevents the guest
from changing the handling of signals used by QEMU itself
internally.

The wrapper is called from all the guest-initiated sigprocmask, but
is not called from internal qemu sigprocmask calls.

Signed-off-by: Alex Barcelo <abarcelo@ac.upc.edu>
[PMM: Added calls to wrapper for sigprocmask uses in signal.c
when setting the signal mask on entry and exit from signal
handlers, since these also are guest-provided signal masks.]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-03-17 11:44:32 +02:00
Andreas Schwab 8d5d30046b linux-user: implement F_[GS]ETOWN_EX
F_GETOWN is replaced by F_GETOWN_EX inside the glibc fcntl wrapper

Signed-off-by: Andreas Schwab <schwab@suse.de>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-03-17 11:44:31 +02:00
Peter Maydell 3b899ea7d4 linux-user: Don't return uninitialized value for atomic_barrier syscall
QEMU's implementation of the m68k atomic_barrier syscall, like the kernel's,
is just a no-op. However we still need to return a result code from it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-03-17 11:44:31 +02:00
Andreas Färber 0429a97195 cpu: Move opaque field from CPU_COMMON to CPUState
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13 19:20:47 +01:00
Petar Jovanovic 974a196d7f linux-user: translate signal number on return from sigtimedwait
On success, sigtimedwait() returns a signal number that needs to be
translated from a host value to a target value.

This change also fixes issues with sigwait (that is implemented using
sigtimedwait()).

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-03 23:08:14 +02:00
Alexander Graf f19e00d776 linux-user: Implement sendmmsg syscall
Glibc when built for newer kernels assumes that the sendmmsg syscall is
available. Without it, dns resolution simply fails to work.

Wrap the syscall with existing infrastructure so that we don't have a host
dependency on sendmmsg.

To avoid locking the same area of guest memory twice (which will break if
DEBUG_REMAP is defined) we pull the lock/unlock part of do_sendrecvmsg()
out into its own function so the actual implementation can be shared.

Signed-off-by: Alexander Graf <agraf@suse.de>
[PMM: add recvmmsg support;
 handle errors (which also implies support for non-blocking operations);
 cap the vector length as the kernel implementation does;
 don't lock guest memory twice;
 support MSG_WAITFORONE flag]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
2014-03-03 23:08:09 +02:00
Peter Maydell 76ca310a19 linux-user: Fix getresuid, getresgid if !USE_UID16
The size of the UID/GID types depends on whether USE_UID16 is
defined. Define a new put_user_id() which writes a uid/gid
type to guest memory. This fixes getresuid and getresgid, which
were always storing 16 bits even if the uid type was 32 bits.

Reported-by: Michael Matz <matz@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Richard Henderson <rth@twiddle.net>
2014-03-03 23:03:31 +02:00
Peter Maydell 69d4c703a5 linux-user: Fix error handling in target_to_host_semarray()
Fix two issues in error handling in target_to_host_semarray():
 * don't leak the host_array buffer if lock_user fails
 * return an error if malloc() fails

v2: added missing * -Riku Voipio

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-02-19 12:29:23 +02:00
Andreas Färber fff8c539bd linux-user: Implement BLKPG ioctl
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-02-19 12:29:23 +02:00
Peter Maydell 501bb4b0cb linux-user: Fix error handling in lock_iovec()
In lock_iovec() if lock_user() failed we were doing an unlock_user
but not a free(vec), which is the wrong way round. We were also
assuming that free() and unlock_user() don't touch errno, which
is not guaranteed. Fix both these problems.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-02-18 16:54:06 +02:00
Michael Tokarev 62dc90c668 linux-user: refactor do_socketcall()
Refactor do_socketcall() to do argument conversion/checking first,
according to a lookup table (which call has how many args) and
by calling the right function second with ready-to-go arguments.

This ensures that all arguments are handled as abi_long, according
to socketcall prototype, and simplifies argument handling alot too.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2014-02-15 16:10:25 +04:00
Pavel Zbitskiy a39ca6a124 linux-user: fixed recvfrom() addrlen
addrlen parameter of recvfrom() of type socklen_t* was read into
variable of type socklen_t, that caused zeroing out of upper 4 bytes
when running s390x on top of x86_64. This patch changes addrlen type
to abi_ulong.

Signed-off-by: Pavel Zbitskiy <pavel.zbitskiy@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-01-15 23:36:13 +04:00
Pavel Zbitskiy fe54b24930 linux-user: fixed getsockopt() optlen
optlen parameter of getsockopt() of type socklen_t* was read into
variable of type socklen_t, that caused zeroing out of upper 4 bytes
when running s390x on top of x86_64. This patch changes optlen type
to abi_ulong.

Signed-off-by: Pavel Zbitskiy <pavel.zbitskiy@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-01-15 23:36:03 +04:00
André Hentschel b9d36eb2c7 linux-user: Support the accept4 socketcall
Cc: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-01-10 08:51:36 +02:00
Petar Jovanovic a29267846a linux-user: pass correct parameter to do_shmctl()
Fix shmctl issue by passing correct parameter buf to do_shmctl().

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-11-29 11:42:14 +02:00
Petar Jovanovic 55a2b1631f linux-user: create target_structs header to place ipc_perm and shmid_ds
Creating target_structs header in linux-user/$arch/ and making
target_ipc_perm and target_shmid_ds its first inhabitants.
The struct defintions may/should be further fine-tuned by arch maintainers.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-11-29 11:42:04 +02:00
Erik de Castro Lopo f4f1e10a58 linux-user: Implement handling of 5 POSIX timer syscalls.
Implement timer_create, timer_settime, timer_gettime, timer_getoverrun
and timer_delete.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-11-29 10:58:16 +02:00
Stefan Weil 20d155bc90 linux-user: Fix stat64 syscall for SPARC64
Some targets use a stat64 structure for the stat64 syscall while others
use a stat structure. SPARC64 used the wrong kind.

Instead of extending the conditional compilation in syscall.c, now a
macro TARGET_HAS_STRUCT_STAT64 is defined whenever a target has a
target_stat64.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-11-07 07:02:44 +01:00
Edgar E. Iglesias 53d09b761f linux-user: Handle SOCK_CLOEXEC/NONBLOCK if unavailable on host
If the host lacks SOCK_CLOEXEC, bail out with -EINVAL.
If the host lacks SOCK_ONONBLOCK, try to emulate it with fcntl()
and O_NONBLOCK.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-09-24 10:47:07 +03:00
Riku Voipio 89aaf1a6ad [v2] linux-user: implement m68k atomic syscalls
With nptl enabled, atomic_cmpxchg_32 and atomic_barrier
system calls are needed. This patch enabled really dummy
versions of the system calls, modeled after the m68k
kernel code.

With this patch I am able to execute m68k binaries
with qemu linux-user (busybox compiled for coldfire).

[v2] que an segfault instead of returning a EFAULT
to keep in line with kernel code.

Cc: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-09-24 10:47:07 +03:00
Petar Jovanovic dbf4f7965a linux-user: correct how SOL_SOCKET is converted from target to host and back
Previous implementation does not take into account that SOL_SOCKET constant
can be arch specific. This change fixes some issues with sendmsg/recvmsg.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-09-24 10:47:07 +03:00
Laurent Vivier 0d78b3b5b1 linux-user: add some IPV6 commands in setsockop()
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-09-24 10:47:07 +03:00
Laurent Vivier f57d419241 linux-user: Add setsockopt(SO_ATTACH_FILTER)
This is needed to be able to run dhclient.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-09-24 10:47:06 +03:00
Laurent Vivier de6b993377 linux-user: convert /proc/net/route when endianess differs
This patch allows to have IP addresses in correct order
in the case of "netstat -nr" when the endianess of the
guest differs from one of the host.

For instance, an m68k guest on an x86_64 host:

WITHOUT this patch:

$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         1.3.0.10        0.0.0.0         UG        0 0          0 eth0
0.3.0.10        0.0.0.0         0.255.255.255   U         0 0          0 eth0
$ cat /proc/net/route
Iface	Destination	Gateway 	Flags	RefCnt	Use	Metric	Mask	MTU	Window	IRTT

eth0	00000000	0103000A	0003	0	0	0	000000000	0	0
eth0	0003000A	00000000	0001	0	0	0	00FFFFFF0	0	0

WITH this patch:

$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.0.3.1        0.0.0.0         UG        0 0          0 eth0
10.0.3.0        0.0.0.0         255.255.255.0   U         0 0          0 eth0
$ cat /proc/net/route
Iface	Destination	Gateway 	Flags	RefCnt	Use	Metric	Mask	MTU	Window	IRTT
eth0	00000000	0a000301	0003	0	0	0	000000000	0	0
eth0	0a000300	00000000	0001	0	0	0	ffffff000	0	0

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-09-24 10:47:06 +03:00
Richard Henderson 8070e7be8b alpha-linux-user: Fix umount syscall numbers
It has been pointed out on LKML that the alpha umount syscall numbers
are named wrong, and a patch to rectify that has been posted for 3.11.

Glibc works around this by treating NR_umount as NR_umount2 if
NR_oldumount exists.  That's more complicated than we need in QEMU,
given that we control linux-user/*/syscall_nr.h.

This is the last instance of TARGET_NR_oldumount, so delete that from
the strace.list.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-09-24 10:47:06 +03:00
Peter Maydell 4a24a75810 linux-user: Allow targets to specify a minimum uname release
For newer target architectures, glibc can be picky about the kernel
version: for example, it will not run on an aarch64 system unless
the kernel reports itself as at least 3.8.0. Accommodate this by
enhancing the existing support for faking the kernel version so
that each target can optionally specify a minimum version: if
the user doesn't force a specific fake version then we will override
with the minimum required version only if the real host kernel
version is insufficient.

Use this facility to let aarch64 report a minimum of 3.8.0.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1378235544-22290-21-git-send-email-peter.maydell@linaro.org
2013-09-10 19:11:29 +01:00
Alexander Graf 09701199f6 linux-user: Fix up AArch64 syscall handlers
Some syscall handlers have special code for ARM enabled that we don't
need on AArch64. Exclude AArch64 in those cases. In other places we
can share struct definitions with other targets or have to provide our
own.

With this patch applied, most syscall definitions in linux-user should
be sound for AArch64.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: John Rigby <john.rigby@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1378235544-22290-16-git-send-email-peter.maydell@linaro.org
Message-id: 1368505980-17151-9-git-send-email-john.rigby@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-09-10 19:11:28 +01:00
Andreas Färber bdc44640cb cpu: Use QTAILQ for CPU list
Introduce CPU_FOREACH(), CPU_FOREACH_SAFE() and CPU_NEXT() shorthand
macros.

Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-09-03 12:25:55 +02:00
Peter Maydell 95c1eb19ea linux-user: Return success from m68k set_thread_area syscall
The m68k set_thread_area syscall implementation failed to set the
return value. Correctly set it zero, since this syscall will always
succeed.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375093909-13653-1-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-29 19:56:52 -05:00
Alexander Graf b24c882b94 linux-user: Reset copied CPUs in cpu_copy() always
When a new thread gets created, we need to reset non arch specific state to
get the new CPU into clean state.

However this reset should happen before the arch specific CPU contents get
copied over. Otherwise we end up having clean reset state in our newly created
thread.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-07-23 17:28:28 +03:00
Peter Maydell 82f05b69e6 linux-user: Fix pipe syscall return for SPARC
SPARC is one of the CPUs which has a funny syscall ABI for the
pipe syscall; add it to the set of special cases in do_pipe().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-07-23 17:28:28 +03:00
Peter Maydell 24cb36a61c configure: Make NPTL non-optional
Now all linux-user targets support building with NPTL, we can make it
mandatory. This is a good idea because:
 * NPTL is no longer new and experimental; it is completely standard
 * in practice, linux-user without NPTL is nearly useless for
   binaries built against non-ancient glibc
 * it allows us to delete the rather untested code for handling
   the non-NPTL configuration

Note that this patch leaves the CONFIG_USE_NPTL ifdefs in the
bsd-user codebase alone. This makes no change for bsd-user, since
our configure test for NPTL had a "#include <linux/futex.h>"
which means bsd-user would never have been compiled with
CONFIG_USE_NPTL defined, and it still is not.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-07-22 21:54:52 +03:00
Peter Maydell 2667e71c3d linux-user: Enable NPTL for x86-64
Add x86-64 implementation of cpu_set_tls() (like the kernel, we
just have to call do_arch_prctl() to set FS); this allows us to
enable NPTL.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-07-22 21:54:46 +03:00
Alexander Graf bc22eb447c linux-user: Add i386 TLS setter
We can easily set the TLS on i386. Add code to do so.

Signed-off-by: Alexander Graf <agraf@suse.de>
[PMM: also remove "target_nptl=no" line from configure, for
 consistency with other patches in this series]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-07-22 21:54:42 +03:00