Statistics
| Branch: | Revision:

root / linux-user @ 0b959cf5

# Date Author Comment
0b959cf5 11/29/2013 08:48 pm Richard Henderson

linux-user: Use qemu_getauxval for AT_EXECFD

Reviewed-by: Peter Maydell <>
Signed-off-by: Richard Henderson <>

664d2c44 11/29/2013 08:45 pm Richard Henderson

util: Use qemu_getauxval in linux qemu_cache_utils_init

With this we no longer pass down envp, and thus all systems can have
the same void prototype. So also eliminate a useless thunk.

Reviewed-by: Peter Maydell <>
Signed-off-by: Richard Henderson <>

b6a3e690 11/29/2013 08:45 pm Richard Henderson

osdep: Create qemu_getauxval and qemu_init_auxval

Abstract away dependence on a system implementation of getauxval.

Signed-off-by: Richard Henderson <>

20d155bc 11/07/2013 08:02 am Stefan Weil

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...

51fb256a 10/07/2013 12:48 pm Andreas Färber

cpu: Drop cpu_model_str from CPU_COMMON

Since this is only read in cpu_copy() and linux-user has a global
cpu_model, drop the field from generic code.

Signed-off-by: Andreas Färber <>

30ba0ee5 10/07/2013 12:48 pm Andreas Färber

cpu: Move cpu_copy() into linux-user

It is only used there and is deemed very fragile if not incorrect in its
current memcpy() form. Moving it into linux-user will allow to move
parts into target_cpu.h headers and only copy what the ABI mandates.

Signed-off-by: Andreas Färber <>

bd00c74c 09/24/2013 10:47 am Laurent Vivier

linux-user: allow use of TIOCGSID

Signed-off-by: Laurent Vivier <>
Reviewed-by: Peter Maydell <>
Signed-off-by: Riku Voipio <>

0d78b3b5 09/24/2013 10:47 am Laurent Vivier

linux-user: add some IPV6 commands in setsockop()

Signed-off-by: Laurent Vivier <>
Reviewed-by: Peter Maydell <>
Signed-off-by: Riku Voipio <>

03cfd8fa 09/24/2013 10:47 am Laurent Vivier

linux-user: add support of binfmt_misc 'O' flag

The binfmt_misc module can calculate the credentials and security
token according to the binary instead of to the interpreter if the
'C' flag is enabled.

To be able to execute non-readable binaries, this flag implies 'O'...

dbf4f796 09/24/2013 10:47 am Petar Jovanovic

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 <>...

1308c464 09/24/2013 10:47 am Kwok Cheung Yeung

linux-user: Check type of microMIPS break instruction

microMIPS instructions that cause breakpoint exceptions come in
16-bit and 32-bit variants. When handling exceptions caused by
such instructions, the instruction type needs to be taken into
account when extracting the break code....

89aaf1a6 09/24/2013 10:47 am Riku Voipio

[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...

53d09b76 09/24/2013 10:47 am Edgar E. Iglesias

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 <>...

8070e7be 09/24/2013 10:47 am Richard Henderson

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,...

868e34d7 09/24/2013 10:47 am Richard Henderson

mips-linux-user: Adjust names in mips_syscall_args

The name field of MIPS_SYS isn't actually used; it's just documentation.
But adjust the umount entries to match mips/syscall_nr.h anyway.

Signed-off-by: Richard Henderson <>
Signed-off-by: Riku Voipio <>

de6b9933 09/24/2013 10:47 am Laurent Vivier

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:
...

f57d4192 09/24/2013 10:47 am Laurent Vivier

linux-user: Add setsockopt(SO_ATTACH_FILTER)

This is needed to be able to run dhclient.

Signed-off-by: Laurent Vivier <>
Reviewed-by: Peter Maydell <>
Signed-off-by: Riku Voipio <>

41d1af4d 09/20/2013 07:09 pm Stefan Weil

*-user: Fix typo in comment (ulocking -> unlocking)

Signed-off-by: Stefan Weil <>
Reviewed-by: Peter Maydell <>
Signed-off-by: Michael Tokarev <>

6f20f55b 09/20/2013 07:09 pm Stefan Weil

*-user: Improve documentation for lock_user function

Add a missing "function" and replace "and" by "any".
BSD and Linux use the same documentation here, so fix both.

Signed-off-by: Stefan Weil <>
Reviewed-by: Peter Maydell <>...

e2cea499 09/10/2013 09:11 pm Alexander Graf

linux-user: Implement cpu_set_tls() and cpu_clone_regs() for AArch64

Signed-off-by: Alexander Graf <>
Signed-off-by: John Rigby <>
Signed-off-by: Peter Maydell <>
Message-id: ...

af89c7db 09/10/2013 09:11 pm Alexander Graf

linux-user: Add AArch64 termbits.h definitions

Add the AArch64 termbits.h with all the target's termios related
constants and structures.

Signed-off-by: Alexander Graf <>
Signed-off-by: John Rigby <>
Signed-off-by: Peter Maydell <>...

4a24a758 09/10/2013 09:11 pm Peter Maydell

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...

99033cae 09/10/2013 09:11 pm Alexander Graf

linux-user: Add AArch64 support

This patch adds support for AArch64 in all the small corners of
linux-user (primarily in image loading and startup code).

Signed-off-by: Alexander Graf <>
Signed-off-by: John Rigby <>
Signed-off-by: Peter Maydell <>...

067d9831 09/10/2013 09:11 pm Alexander Graf

linux-user: Don't treat AArch64 cpu names specially

32-bit ARM has a lot of different names for different types of CPUs it supports.
On AArch64, we don't have this, so we really don't want to execute the 32-bit
logic. Stub it out for AArch64 linux-user guests....

1861c454 09/10/2013 09:11 pm Peter Maydell

linux-user: Add cpu loop for AArch64

Add the main linux-user cpu loop for AArch64. Since AArch64
has a different system call interface, doesn't need to worry
about FPA emulation and may in the future keep the prefetch/data
abort information in different system registers, it's simplest...

c7907301 09/10/2013 09:11 pm Alexander Graf

linux-user: Add syscall number definitions for AArch64

The AArch64 syscall definitions are all publicly available in the Linux
kernel. Let's add them to our linux-user emulation target, so that we
can easily handle AArch64 syscalls.

Signed-off-by: Alexander Graf <>...

09701199 09/10/2013 09:11 pm Alexander Graf

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....

1744aea1 09/10/2013 09:11 pm Andreas Schwab

linux-user: Add signal handling for AArch64

This patch adds signal handling for AArch64. The code is based on the
respective source in the Linux kernel.

Signed-off-by: Andreas Schwab <>
Signed-off-by: Alexander Graf <>
Signed-off-by: John Rigby <>...

848d72cd 09/10/2013 09:11 pm Peter Maydell

linux-user: Make sure NWFPE code is 32 bit ARM only

On ARM, linux-user emulation includes NWFPE support for emulating the
ancient FPA floating point coprocessor. This has long since been
superseded by VFP and is only required for legacy binaries. The
AArch64 linux-user target doesn't compile in NWFPE support, so make...

bdc44640 09/03/2013 01:25 pm Andreas Färber

cpu: Use QTAILQ for CPU list

Introduce CPU_FOREACH(), CPU_FOREACH_SAFE() and CPU_NEXT() shorthand
macros.

Signed-off-by: Andreas Färber <>

b04636f8 07/30/2013 03:56 am Peter Maydell

linux-user/signal.c: PPC: Silence clang uninitialized-use warning

Silence a clang warning in a PPC signal return function:

/home/petmay01/linaro/qemu-from-laptop/qemu/linux-user/signal.c:4611:9: error: variable 'sr_addr' is used
uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]...

978fae9f 07/30/2013 03:56 am Peter Maydell

linux-user/signal.c: Avoid using uninitialized data in ARM sigreturn

Rephrase code used in ARM sigreturn functions to avoid using
uninitialized variables. This fixes one genuine problem ('frame'
would not be initialized if we took the error-exit path because...

95c1eb19 07/30/2013 03:56 am Peter Maydell

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 <>...

b0932e06 07/29/2013 01:37 am Petar Jovanovic

linux-user: correct argument number for sys_mremap and sys_splice

sys_mremap missed 5th argument (new_address), which caused examples that
remap to a specific address to fail.
sys_splice missed 5th and 6th argument which caused different examples to
fail....

0ac46af3 07/27/2013 12:05 am Andreas Färber

linux-user: Avoid redundant ENV_GET_CPU()

This fixes a mismerge in 874ec3c5b3821bb964f9f37b2f930f2a9ce51652.

Acked-by: Riku Voipio <>
Signed-off-by: Andreas Färber <>

874ec3c5 07/25/2013 11:56 pm Anthony Liguori

Merge remote-tracking branch 'riku/linux-user-for-upstream' into staging

  • riku/linux-user-for-upstream: (21 commits)
    linux-user: Handle compressed ISA encodings when processing MIPS exceptions
    linux-user: Unlock mmap_lock when resuming guest from page_unprotect...
a0333817 07/23/2013 05:31 pm Kwok Cheung Yeung

linux-user: Handle compressed ISA encodings when processing MIPS exceptions

Decode trap instructions during the handling of an EXCP_BREAK or EXCP_TRAP
according to the current ISA mode.

Signed-off-by: Kwok Cheung Yeung <>
Signed-off-by: Riku Voipio <>

c7819dfb 07/23/2013 05:28 pm Peter Maydell

linux-user: Fix target_stat and target_stat64 for OpenRISC

OpenRISC uses the asm-generic versions of target_stat and
target_stat64, but it was incorrectly using the x86/ARM/etc version
due to a misplaced defined(TARGET_OPENRISC). The previously unused
OpenRISC section of the ifdef ladder also defined an incorrect...

82f05b69 07/23/2013 05:28 pm Peter Maydell

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 <>
Signed-off-by: Riku Voipio <>

ddaa7e5a 07/23/2013 05:28 pm Alexander Graf

linux-user: Fix epoll on ARM hosts

The epoll emulation uses data structures without packing them, so the
compiler might choose to add padding inside.

This patch makes the most offending one (target_epoll_event) a packed
structure to make sure we don't pad it by accident. ARM would pad it,...

b24c882b 07/23/2013 05:28 pm Alexander Graf

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...

db6b81d4 07/23/2013 03:41 am Andreas Färber

gdbstub: Change gdb_handlesig() argument to CPUState

Prepares for changing GDBState::c_cpu to CPUState.

Signed-off-by: Andreas Färber <>

6f152e9b 07/23/2013 03:41 am Andreas Färber

linux-user: Use X86CPU property to retrieve CPUID family

Avoids duplicating the calculation.

Reviewed-by: Igor Mammedov <>
Signed-off-by: Andreas Färber <>

885a73f7 07/22/2013 10:08 pm Andreas Färber

linux-user: Avoid conditional cpu_reset()

Some CPUs reset as part of cpu_init(), some others were reset
afterwards, some not at all. While some targets didn't implement a
cpu_[state_]reset() function, QOM cpu_reset() is always available.
There's nothing wrong with resetting twice on startup, so drop...

24cb36a6 07/22/2013 09:54 pm Peter Maydell

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...

2667e71c 07/22/2013 09:54 pm Peter Maydell

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 <>
Signed-off-by: Riku Voipio <>

bc22eb44 07/22/2013 09:54 pm Alexander Graf

linux-user: Add i386 TLS setter

We can easily set the TLS on i386. Add code to do so.

Signed-off-by: Alexander Graf <>
[PMM: also remove "target_nptl=no" line from configure, for
consistency with other patches in this series]
Signed-off-by: Peter Maydell <>...

4ce6243d 07/22/2013 09:54 pm Peter Maydell

linux-user: Clean up handling of clone() argument order

Linux manages to have three separate orderings of the arguments to
the clone() syscall on different architectures. In the kernel these
are selected via CONFIG_CLONE_BACKWARDS and CONFIG_CLONE_BACKWARDS2....

d312bbe1 07/22/2013 09:54 pm Peter Maydell

linux-user: Add missing 'break' in i386 get_thread_area syscall

The i386 code for the get_thread_area syscall was missing a
'break' which meant it would have fallen through into the
implementation of the following syscall; add it.

Signed-off-by: Peter Maydell <>...

1ccd9374 07/22/2013 09:54 pm Peter Maydell

linux-user: Enable NPTL for m68k

For m68k, per-thread data is a purely kernel construct with no
CPU level support. Implement it via a field in the TaskState structure,
used by cpu_set_tls() and the set_thread_area/get_thread_area
syscalls. This allows us to enable compilation with NPTL....

f5147c93 07/22/2013 09:54 pm Peter Maydell

linux-user: Enable NPTL for SPARC targets

Provide the missing cpu_set_tls(), and resolve the FIXME in
cpu_clone_regs() by clearing the carry flag for the child.
This allows us to turn on building with NPTL for SPARC.

Signed-off-by: Peter Maydell <>...

442a59c8 07/22/2013 09:54 pm Peter Maydell

linux-user: Enable NPTL for OpenRISC

The OpenRISC kernel ignores CLONE_SETTLS in its copy_thread()
implementation, so a cpu_set_tls() implementation is a no-op.
cpu_clone_regs() was setting the syscall return value in the
wrong register -- it is gpr11, not gpr2. With these two...

dfeab06c 07/22/2013 09:54 pm Peter Maydell

linux-user: Move includes of target-specific headers to end of qemu.h

The target-specific headers (target_cpu.h and target_signal.h)
might need to use the target-independent structure and function
definitions of qemu.h; so include them only at the bottom of...

43be1343 07/19/2013 11:52 am Petar Jovanovic

linux-user: declare sys_futex to have 6 arguments

sys_futex has 6 arguments, and all of these need to be copied. Fix incorrect
declaration in the mips_syscall_args array.

This change fixes the cases where the 5th and 6th arguments have non-zero
value and have importance. An example is a Linux implementation of...

51455c59 07/10/2013 06:54 pm Anthony Liguori

Merge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging

QOM CPUState refactorings

  • Fix for OpenRISCCPU subclasses
  • Fix for gdbstub CPU selection
  • Move linux-user CPU functions into new header
  • CPUState part 10 refactoring: first_cpu, next_cpu, cpu_single_env et al....
a0762859 07/09/2013 10:33 pm Andreas Färber

log: Change log_cpu_state[_mask]() argument to CPUState

Since commit 878096eeb278a8ac1ccd6667af73e026f29b4cf5 (cpu: Turn
cpu_dump_{state,statistics}() into CPUState hooks) CPUArchState is no
longer needed.

Add documentation and make the functions available through qemu/log.h...

a2247f8e 07/09/2013 10:33 pm Andreas Färber

linux-user: Change thread_env to CPUState

Signed-off-by: Andreas Färber <>

182735ef 07/09/2013 10:32 pm Andreas Färber

cpu: Make first_cpu and next_cpu CPUState

Move next_cpu from CPU_COMMON to CPUState.
Move first_cpu variable to qom/cpu.h.

gdbstub needs to use CPUState::env_ptr for now.
cpu_copy() no longer needs to save and restore cpu_next.

Acked-by: Paolo Bonzini <>...

6291ad77 07/09/2013 10:20 pm Peter Maydell

linux-user: Move cpu_clone_regs() and cpu_set_tls() into linux-user

The functions cpu_clone_regs() and cpu_set_tls() are not purely CPU
related -- they are specific to the TLS ABI for a a particular OS.
Move them into the linux-user/ tree where they belong....

9b056fcc 07/09/2013 10:20 pm Andreas Färber

linux-user: Clean up do_syscall() Coding Style for TARGET_NR_exit

In particular fix 6-/10-char indentation.

Signed-off-by: Andreas Färber <>

463d8e73 07/05/2013 03:45 pm Andreas Schwab

linux-user: handle /proc/$$ like /proc/self

Some applications use /proc/$$/... (where $$ is the own pid) instead of
/proc/self/... to refer to their own proc files. Extend the interception
for open and readlink to handle this case. Also, do the same interception...

7ff7b666 07/05/2013 03:45 pm Laurent Vivier

linux-user: add SIOCADDRT/SIOCDELRT support

This allows to pass the device name.

You can test this with the "route" command.

WITHOUT this patch:

$ sudo route add -net default gw 10.0.3.1 eth0
SIOCADDRT: Bad address
$ netstat -nr
Kernel IP routing table...

167c50d8 07/05/2013 03:45 pm Andreas Schwab

linux-user: fix signal number range check

When translating between host and target signal numbers keep negative
numbers unchanged, avoiding access beyond array bounds.

Signed-off-by: Andreas Schwab <>
Reviewed-by: Peter Maydell <>...

1acae9f2 07/05/2013 03:45 pm Peter Maydell

linux-user: Fix sys_utimensat (would not compile on old glibc)

Commit c0d472b12e accidentally dropped the definition of
__NR_SYS_utimensat even though its use is guarded by
CONFIG_UTIMENSAT, not CONFIG_ATFILE. Some older glibc don't
have utimensat() (even if they have the other *at() functions)....

f651e6ae 07/05/2013 03:45 pm Petar Jovanovic

linux-user: improve target_to_host_sock_type conversion

Previous implementation has failed to take into account different value of
SOCK_NONBLOCK on target and host, and existence of SOCK_CLOEXEC.
The same conversion has to be applied both for do_socket and do_socketpair,...

8384274e 07/05/2013 03:45 pm Jürg Billeter

linux-user: Do not ignore mmap failure from host

File mapping may fail with EACCES.

Signed-off-by: Jürg Billeter <>
Message-id:
Reviewed-by: Peter Maydell <>

60a3e17a 06/28/2013 02:25 pm Andreas Färber

cpu: Change cpu_exit() argument to CPUState

It no longer depends on CPUArchState, so move it to qom/cpu.c.

Prepares for changing GDBState::c_cpu to CPUState.

Signed-off-by: Andreas Färber <>

878096ee 06/28/2013 02:25 pm Andreas Färber

cpu: Turn cpu_dump_{state,statistics}() into CPUState hooks

Make cpustats monitor command available unconditionally.

Prepares for changing kvm_handle_internal_error() and kvm_cpu_exec()
arguments to CPUState.

Signed-off-by: Andreas Färber <>

2e59915d 06/14/2013 05:33 pm Paolo Bonzini

main: use TARGET_ARCH only for the target-specific #define

Everything else needs to match the executable name, which is
TARGET_NAME.

Before:
$ sh4eb-linux-user/qemu-sh4eb --help
usage: qemu-sh4 [options] program [arguments...]
Linux CPU emulator (compiled for sh4 emulation)...

3307e236 06/12/2013 06:20 pm Peter Maydell

linux-user: Allow getdents to be provided by getdents64

Newer architectures may only implement the getdents64 syscall, not
getdents. Provide an implementation of getdents in terms of getdents64
so that we can run getdents-using targets on a getdents64-only host....

c0d472b1 06/12/2013 06:20 pm Peter Maydell

linux-user: Drop direct use of openat etc syscalls

The linux-user syscall emulation layer currently supports the
openat family of syscalls via two mechanisms: simply calling
the corresponding libc functions, and making direct syscalls.
Since glibc has supported these functions since at least glibc...

d2d6b857 06/01/2013 01:25 pm Lei Li

linux-user: Fix typo in comment

Signed-off-by: Lei Li <>
Reviewed-by: Stefan Weil <>
Signed-off-by: Michael Tokarev <>

95de21a4 05/22/2013 04:22 pm Anthony Liguori

Merge remote-tracking branch 'mjt/trivial-patches' into staging

  1. By Christophe Lyon (1) and others
  2. Via Michael Tokarev
    • mjt/trivial-patches:
      target-moxie: replace target_phys_addr_t with hwaddr
      Rename hexdump to avoid FreeBSD libutil conflict
      remove some double-includes...
ea3164aa 05/20/2013 07:16 pm Kwok Cheung Yeung

linux-user: Fix MIPS ISA transitions during signal handling

Processors supporting the MIPS16 or microMIPS ISAs set bit 0 in target
addresses to indicate that the target is written using a compressed ISA.

During signal handling, when jumping to or returning from a signal...

1239b472 05/20/2013 07:16 pm Kwok Cheung Yeung

linux-user: Save the correct resume address for MIPS signal handling

The current ISA mode needs to be saved in bit 0 of the resume address.
If the current instruction happens to be in a branch delay slot, then
the address of the preceding jump instruction should be stored instead....

e24fed4e 05/18/2013 03:35 pm Christophe Lyon

fix /proc/self/maps output

Add a space at end of line when there is no filename to print, to
conform to linux kernel format (see show_map_vma() in
fs/proc/task_mmu.c).

Signed-off-by: Christophe Lyon <>
Reviewed-by: Peter Maydell <>...

0514ef2f 05/02/2013 01:27 am Eduardo Habkost

target-i386: Replace cpuid_*features fields with a feature word array

This replaces the feature-bit fields on both X86CPU and x86_def_t
structs with an array.

With this, we will be able to simplify code that simply does the same
operation on all feature words (e.g. kvm_check_features_against_host(),...

7edd2cf1 04/26/2013 12:52 pm Peter Maydell

linux-user: fix compile error due to stray colon at end of #ifdef line

Remove a stray colon from the end of a #ifdef line. Some versions
of gcc complain about this:
linux-user/syscall.c: In function ‘do_syscall’:
linux-user/syscall.c:7606:28: error: extra tokens at end of #ifdef directive [-Werror]...

c7128c9f 04/19/2013 10:48 am Petar Jovanovic

linux-user: change do_semop to return target errno when unsuccessful

do_semop() is called from two places, and one of these fails to convert
return error to target errno when semop fails. This patch changes the
function to always return target errno in case of an unsuccessful call....

9ab709be 04/19/2013 10:48 am Andreas Schwab

linux-user: fix undefined shift in copy_to_user_fdset

If TARGET_ABI_BITS is bigger than 32 we shift by more than the size of int.

Signed-off-by: Andreas Schwab <>
Reviewed-by: Peter Maydell <>
Signed-off-by: Riku Voipio <>

03903ffc 04/19/2013 10:48 am Andreas Schwab

linux-user: fix setgroups/getgroups for non-UID16 archs

Don't assume target_id is a short.

Signed-off-by: Andreas Schwab <>
Signed-off-by: Riku Voipio <>

ca98ac83 04/18/2013 03:12 pm Paolo Bonzini

elfload: fix size of ABI-dependent fields in core dumps

Some fields in core dumps are 32-bit in 32-or-64 environments (ppc64abi32,
sparc32plus). Use abi_long/ulong for those.

Also, the fields of target_elf_siginfo are ints. Use tswap32 to convert them....

a29f998d 04/18/2013 03:12 pm Paolo Bonzini

elfload: fix size of registers for N32

Registers are 64-bit in size for the MIPS n32 ABI. Define
target_elf_greg_t accordingly, and use the correct function
to do endian swaps.

Reviewed-by: Peter Maydell <>
Signed-off-by: Paolo Bonzini <>...

86cd7b2d 04/18/2013 03:12 pm Paolo Bonzini

elfload: use tswapreg consistently in elf_core_copy_regs

Reviewed-by: Peter Maydell <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Edgar E. Iglesias <>

1ddd592f 04/18/2013 03:12 pm Paolo Bonzini

elfload: use abi_short/ushort instead of target_short/ushort

The alignment is a characteristic of the ABI, not the CPU.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Edgar E. Iglesias <>

f8fd4fc4 04/18/2013 03:12 pm Paolo Bonzini

elfload: use abi_int/uint instead of target_int/uint

The alignment is a characteristic of the ABI, not the CPU.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Edgar E. Iglesias <>

918fc54c 04/18/2013 03:12 pm Paolo Bonzini

elfload: use abi_llong/ullong instead of target_llong/ullong

The alignment is a characteristic of the ABI, not the CPU.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Edgar E. Iglesias <>

5947c697 04/12/2013 03:33 pm Petar Jovanovic

linux-user: pass correct host flags to eventfd2 call

This change makes conversion of TARGET_O_NONBLOCK and TARGET_O_CLOEXEC flags
to host flags before calling eventfd for TARGET_NR_eventfd2.

Signed-off-by: Petar Jovanovic <>
Reviewed-by: Peter Maydell <>...

abe20840 04/05/2013 03:40 pm Peter Maydell

linux-user: Don't omit comma for strace of rt_sigaction()

Pass the 'last' parameter of print_signal() through to
print_raw_param(); this fixes a problem where we weren't printing
the comma separator for strace of rt_sigaction() when the signal
was an unnamed (ie realtime) one:...

e9a970a8 03/11/2013 02:35 pm Peter Maydell

linux-user/syscall.c: Don't warn about unimplemented get_robust_list

The nature of the kernel ABI for the get_robust_list and set_robust_list
syscalls means we cannot implement them in QEMU. Make get_robust_list
silently return ENOSYS rather than using the default "print message and...

a94b4987 03/11/2013 02:34 pm Peter Maydell

linux-user: Implement accept4

Implement the accept4 syscall (which is identical to accept
but has an additional flags argument).

Signed-off-by: Peter Maydell <>
Reviewed-by: Richard Henderson <>
Signed-off-by: Riku Voipio <>

a8fd1aba 03/11/2013 02:34 pm Peter Maydell

linux-user: Implement sendfile and sendfile64

Implement the sendfile and sendfile64 syscalls. This implementation
passes all the LTP test cases for these syscalls.

Signed-off-by: Peter Maydell <>
Reviewed-by: Richard Henderson <>...

dfae8e00 03/11/2013 02:34 pm Peter Maydell

linux-user: make bogus negative iovec lengths fail EINVAL

If the guest passes us a bogus negative length for an iovec, fail
EINVAL rather than proceeding blindly forward. This fixes some of
the error cases tests for readv and writev in the LTP.

Signed-off-by: Peter Maydell <>...

63ec54d7 03/11/2013 02:33 pm Peter Maydell

linux-user: Fix layout of usage table to account for option text

The linux-user usage message attempts to line up the columns in
its table by calculating the maximum width of any item in them.
However for the 'Argument' column it was only accounting for the...

0d95fda8 03/11/2013 01:05 pm Dillon Amburgey

linux-user: Add more sparc syscall numbers

Signed-off-by: Dillon Amburgey <>
Signed-off-by: Riku Voipio <>

f2b79ce9 03/11/2013 01:05 pm Dillon Amburgey

linux-user: Support setgroups syscall with no groups

Signed-off-by: Dillon Amburgey <>
Reviewed-by: Peter Maydell <>
Signed-off-by: Riku Voipio <>

bfb669f3 03/11/2013 01:05 pm John Rigby

linux-user: fix futex strace of FUTEX_CLOCK_REALTIME

Handle same as existing FUTEX_PRIVATE_FLAG.

Signed-off-by: John Rigby <>
Signed-off-by: Riku Voipio <>

cce246e0 03/11/2013 01:04 pm John Rigby

linux-user/syscall.c: handle FUTEX_WAIT_BITSET in do_futex

Upstream libc has recently changed to start using
FUTEX_WAIT_BITSET instead of FUTEX_WAIT and this
is causing do_futex to return -TARGET_ENOSYS.

Pass bitset in val3 to sys_futex which will be
ignored by kernel for the FUTEX_WAIT case....

d95ec14f 03/11/2013 01:04 pm Laurent Vivier

linux-user: improve print_fcntl()

Signed-off-by: Laurent Vivier <>
Signed-off-by: Riku Voipio <>

ec00b51a 03/11/2013 01:04 pm Dillon Amburgey

linux-user: Add Alpha socket constants

Without these, some networking programs will not work

Signed-off-by: Dillon Amburgey <>
Reviewed-by: Richard Henderson <>
Signed-off-by: Riku Voipio <>