qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 3bef04: linux-user: Fix qemu-binfmt-conf.sh t


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 3bef04: linux-user: Fix qemu-binfmt-conf.sh to store confi...
Date: Wed, 08 Jun 2016 12:00:05 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 3bef0451e692966554b31e603424e7d40ba98d3a
      
https://github.com/qemu/qemu/commit/3bef0451e692966554b31e603424e7d40ba98d3a
  Author: Laurent Vivier <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M scripts/qemu-binfmt-conf.sh

  Log Message:
  -----------
  linux-user: Fix qemu-binfmt-conf.sh to store config across reboot

Original qemu-binfmt-conf.sh is only able to write configuration
into /proc/sys/fs/binfmt_misc, and the configuration is lost on reboot.

This script can configure debian and systemd services to restore
configuration on reboot. Moreover, it is able to manage binfmt
credential and to configure the path of the interpreter.

List of supported CPU is:

i386 i486 alpha arm sparc32plus ppc ppc64 ppc64le
m68k mips mipsel mipsn32 mipsn32el mips64 mips64el
sh4 sh4eb s390x aarch64

Usage: qemu-binfmt-conf.sh [--qemu-path PATH][--debian][--systemd CPU]
                     [--help][--credential yes|no][--exportdir PATH]
  Configure binfmt_misc to use qemu interpreter
  --help:       display this usage
       --qemu-path:  set path to qemu interpreter (/usr/local/bin)
       --debian:     don't write into /proc,
               instead generate update-binfmts templates
       --systemd:    don't write into /proc,
               instead generate file for systemd-binfmt.service
               for the given CPU
       --exportdir:  define where to write configuration files
               (default: /etc/binfmt.d or /usr/share/binfmts)
       --credential: if yes, credential an security tokens are
               calculated according to the binary to interpret

    To import templates with update-binfmts, use :
   sudo update-binfmts --importdir /usr/share/binfmts --import qemu-CPU

    To remove interpreter, use :
   sudo update-binfmts --package qemu-CPU --remove qemu-CPU /usr/local/bin

    With systemd, binfmt files are loaded by systemd-binfmt.service

    The environment variable HOST_ARCH allows to override 'uname' to generate
    configuration files for a different architecture than the current one.

Signed-off-by: Laurent Vivier <address@hidden>
Reviewed-by: Alexander Graf <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 6c5b5645ae0b73c052df962e18e48d87bb7385e0
      
https://github.com/qemu/qemu/commit/6c5b5645ae0b73c052df962e18e48d87bb7385e0
  Author: Laurent Vivier <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: add rtnetlink(7) support

rtnetlink is needed to use iproute package (ip addr, ip route)
and dhcp client.

Examples:

Without this patch:
    # ip link
    Cannot open netlink socket: Address family not supported by protocol
    # ip addr
    Cannot open netlink socket: Address family not supported by protocol
    # ip route
    Cannot open netlink socket: Address family not supported by protocol
    # dhclient eth0
    Cannot open netlink socket: Address family not supported by protocol
    Cannot open netlink socket: Address family not supported by protocol

With this patch:
    # ip link
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode 
DEFAULT
  link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    51: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state 
UP mode DEFAULT qlen 1000
  link/ether 00:16:3e:89:6b:d7 brd ff:ff:ff:ff:ff:ff
    # ip addr show eth0
    51: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state 
UP qlen 1000
  link/ether 00:16:3e:89:6b:d7 brd ff:ff:ff:ff:ff:ff
  inet 192.168.122.197/24 brd 192.168.122.255 scope global eth0
     valid_lft forever preferred_lft forever
  inet6 fe80::216:3eff:fe89:6bd7/64 scope link
     valid_lft forever preferred_lft forever
    # ip route
    default via 192.168.122.1 dev eth0
    192.168.122.0/24 dev eth0  proto kernel  scope link  src 192.168.122.197
    # ip addr flush eth0
    # ip addr add 192.168.122.10 dev eth0
    # ip addr show eth0
    51: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state 
UP qlen 1000
  link/ether 00:16:3e:89:6b:d7 brd ff:ff:ff:ff:ff:ff
  inet 192.168.122.10/32 scope global eth0
     valid_lft forever preferred_lft forever
    # ip route add 192.168.122.0/24 via 192.168.122.10
    # ip route
  192.168.122.0/24 via 192.168.122.10 dev eth0

Signed-off-by: Laurent Vivier <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: b265620bfbe300528247b31de54bacfd513109e8
      
https://github.com/qemu/qemu/commit/b265620bfbe300528247b31de54bacfd513109e8
  Author: Laurent Vivier <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: support netlink protocol NETLINK_KOBJECT_UEVENT

This is the protocol used by udevd to manage kernel events.

Signed-off-by: Laurent Vivier <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 5ce9bb5937aa549efb0f93ee78a06ce8bded0d50
      
https://github.com/qemu/qemu/commit/5ce9bb5937aa549efb0f93ee78a06ce8bded0d50
  Author: Laurent Vivier <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: add netlink audit

This is, for instance, needed to log in a container.

Without this, the user cannot be identified and the console login
fails with "Login incorrect".

Signed-off-by: Laurent Vivier <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 575b22b1b7a843f34f52ebc9c00fb1c967258912
      
https://github.com/qemu/qemu/commit/575b22b1b7a843f34f52ebc9c00fb1c967258912
  Author: Laurent Vivier <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M configure
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: check if NETLINK_ROUTE is available

Some IFLA_* symbols can be missing in the host linux/if_link.h,
but as they are enums and not "#defines", check in "configure" if
last known  (IFLA_PROTO_DOWN) is available and if not, disable
management of NETLINK_ROUTE protocol.

Signed-off-by: Laurent Vivier <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: eb5525013ae4eaaa3038607aeb7bc1954fff8656
      
https://github.com/qemu/qemu/commit/eb5525013ae4eaaa3038607aeb7bc1954fff8656
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  linux-user: Factor out handle_signal code from process_pending_signals()

Factor out the code to handle a single signal from the
process_pending_signals() function. The use of goto for flow control
is OK currently, but would get significantly uglier if extended to
allow running the handle_signal code multiple times.

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


  Commit: e902d588dcaaff98a2832d3a61cba2f058f50dfc
      
https://github.com/qemu/qemu/commit/e902d588dcaaff98a2832d3a61cba2f058f50dfc
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  linux-user: Move handle_pending_signal() to avoid need for declaration

Move the handle_pending_signal() function above process_pending_signals()
to avoid the need for a forward declaration. (Whitespace only change.)

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


  Commit: 7ec87e06c7371c6c574de8ce2cb6553a26c3f3de
      
https://github.com/qemu/qemu/commit/7ec87e06c7371c6c574de8ce2cb6553a26c3f3de
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  linux-user: Fix stray tab-indent

Fix a stray tab-indented linux in linux-user/signal.c.

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


  Commit: 9eede5b69fbbed46f29c7c586cf9e067f56002a6
      
https://github.com/qemu/qemu/commit/9eede5b69fbbed46f29c7c586cf9e067f56002a6
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  linux-user: Factor out uses of do_sigprocmask() from sigreturn code

All the architecture specific handlers for sigreturn include calls
to do_sigprocmask(SIGSETMASK, &set, NULL) to set the signal mask
from the uc_sigmask in the context being restored. Factor these
out into calls to a set_sigmask() function. The next patch will
want to add code which is not run when setting the signal mask
via do_sigreturn, and this change allows us to separate the two
cases.

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


  Commit: b28a1f333a5875e6f48725efd19c76fc3d27d8d1
      
https://github.com/qemu/qemu/commit/b28a1f333a5875e6f48725efd19c76fc3d27d8d1
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Define macro for size of host kernel sigset_t

Some host syscalls take an argument specifying the size of a
host kernel's sigset_t (which isn't necessarily the same as
that of the host libc's type of that name). Instead of hardcoding
_NSIG / 8 where we do this, define and use a SIGSET_T_SIZE macro.

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


  Commit: 2fe4fba115b5b9f7e6722720c57810e0fc64b9b5
      
https://github.com/qemu/qemu/commit/2fe4fba115b5b9f7e6722720c57810e0fc64b9b5
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Use safe_syscall for sigsuspend syscalls

Use the safe_syscall wrapper for sigsuspend syscalls. This
means that we will definitely deliver a signal that arrives
before we do the sigsuspend call, rather than blocking first
and delivering afterwards.

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


  Commit: 3d3efba020da1de57a715e2087cf761ed0ad0904
      
https://github.com/qemu/qemu/commit/3d3efba020da1de57a715e2087cf761ed0ad0904
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M linux-user/qemu.h
    M linux-user/signal.c
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Fix race between multiple signals

If multiple host signals are received in quick succession they would
be queued in TaskState then delivered to the guest in spite of
signals being supposed to be blocked by the guest signal handler's
sa_mask. Fix this by decoupling the guest signal mask from the
host signal mask, so we can have protected sections where all
host signals are blocked. In particular we block signals from
when host_signal_handler() queues a signal from the guest until
process_pending_signals() has unqueued it. We also block signals
while we are manipulating the guest signal mask in emulation of
sigprocmask and similar syscalls.

Blocking host signals also ensures the correct behaviour with respect
to multiple threads and the overrun count of timer related signals.
Alas blocking and queuing in qemu is still needed because of virtual
processor exceptions, SIGSEGV and SIGBUS.

Blocking signals inside process_pending_signals() protects against
concurrency problems that would otherwise happen if host_signal_handler()
ran and accessed the signal data structures while process_pending_signals()
was manipulating them.

Since we now track the guest signal mask separately from that
of the host, the sigsuspend system calls must track the signal
mask passed to them, because when we process signals as we leave
the sigsuspend the guest signal mask in force is that passed to
sigsuspend.

Signed-off-by: Timothy Edward Baldwin <address@hidden>
Message-id: address@hidden
[PMM: make signal_pending a simple flag rather than a word with two flag bits;
 ensure we don't call block_signals() twice in sigreturn codepaths;
 document and assert() the guarantee that using do_sigprocmask() to
 get the current mask never fails;  use the qemu atomics.h functions
 rather than raw volatile variable access; add extra commentary and
 documentation; block SIGSEGV/SIGBUS in block_signals() and in
 process_pending_signals() because they can't occur synchronously here;
 check the right do_sigprocmask() call for errors in ssetmask syscall;
 expand commit message; fixed sigsuspend() hanging]
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: c19c1578f8a9b894f5e368e35139620a98bf6a69
      
https://github.com/qemu/qemu/commit/c19c1578f8a9b894f5e368e35139620a98bf6a69
  Author: Timothy E Baldwin <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  linux-user: Remove redundant default action check in queue_signal()

Both queue_signal() and process_pending_signals() did check for default
actions of signals, this is redundant and also causes fatal and stopping
signals to incorrectly cause guest system calls to be interrupted.

The code in queue_signal() is removed.

Signed-off-by: Timothy Edward Baldwin <address@hidden>
Message-id: address@hidden
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 8fdb9fef3d63b5e245a496e4999ebb599b9b9496
      
https://github.com/qemu/qemu/commit/8fdb9fef3d63b5e245a496e4999ebb599b9b9496
  Author: Timothy E Baldwin <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M gdbstub.c
    M include/exec/gdbstub.h

  Log Message:
  -----------
  linux-user: Remove redundant gdb_queuesig()

Signed-off-by: Timothy Edward Baldwin <address@hidden>
Message-id: address@hidden
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 907f5fddaa673ac3f6dc955df6eac2870e3603f4
      
https://github.com/qemu/qemu/commit/907f5fddaa673ac3f6dc955df6eac2870e3603f4
  Author: Timothy E Baldwin <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M linux-user/main.c
    M linux-user/qemu.h
    M linux-user/signal.c

  Log Message:
  -----------
  linux-user: Remove real-time signal queuing

As host signals are now blocked whenever guest signals are blocked, the
queue of realtime signals is now in Linux. The QEMU queue is now
redundant and can be removed. (We already did not queue non-RT signals, and
none of the calls to queue_signal() except the one in host_signal_handler()
pass an RT signal number.)

Signed-off-by: Timothy Edward Baldwin <address@hidden>
Message-id: address@hidden
Reviewed-by: Peter Maydell <address@hidden>
[PMM: minor commit message tweak]
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 655ed67c2a248cf0a887229d8492d6ddc0518545
      
https://github.com/qemu/qemu/commit/655ed67c2a248cf0a887229d8492d6ddc0518545
  Author: Timothy E Baldwin <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M linux-user/qemu.h
    M linux-user/signal.c

  Log Message:
  -----------
  linux-user: Queue synchronous signals separately

If a synchronous signal and an asynchronous signal arrive near simultaneously,
and the signal number of the asynchronous signal is lower than that of the
synchronous signal the the handler for the asynchronous would be called first,
and then the handler for the synchronous signal would be called within or
after the first handler with an incorrect context.

This is fixed by queuing synchronous signals separately. Note that this does
risk delaying a asynchronous signal until the synchronous signal handler
returns rather than handling the signal on another thread, but this seems
unlikely to cause problems for real guest programs and is unavoidable unless
we could guarantee to roll back and reexecute whatever guest instruction
caused the synchronous signal (which would be a bit odd if we've already
logged its execution, for instance, and would require careful analysis of
all guest CPUs to check it was possible in all cases).

Signed-off-by: Timothy Edward Baldwin <address@hidden>
Message-id: address@hidden
[PMM: added a comment]
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: ef6a778ea2af4ebcf08a84cc9314cfe7cf2a2299
      
https://github.com/qemu/qemu/commit/ef6a778ea2af4ebcf08a84cc9314cfe7cf2a2299
  Author: Timothy E Baldwin <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  linux-user: Block signals during sigaction() handling

Block signals while emulating sigaction. This is a non-interruptible
syscall, and using block_signals() avoids races where the host
signal handler is invoked and tries to examine the signal handler
data structures while we are updating them.

Signed-off-by: Timothy Edward Baldwin <address@hidden>
Message-id: address@hidden
[PMM: expanded commit message]
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: f59ec606104ade2443179231fc7a3cb98683ac85
      
https://github.com/qemu/qemu/commit/f59ec606104ade2443179231fc7a3cb98683ac85
  Author: Timothy E Baldwin <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: pause() should not pause if signal pending

Fix races between signal handling and the pause syscall by
reimplementing it using block_signals() and sigsuspend().
(Using safe_syscall(pause) would also work, except that the
pause syscall doesn't exist on all architectures.)

Signed-off-by: Timothy Edward Baldwin <address@hidden>
Message-id: address@hidden
[PMM: tweaked commit message]
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: a0995886e23323258d0612c71f8b0416a02806f2
      
https://github.com/qemu/qemu/commit/a0995886e23323258d0612c71f8b0416a02806f2
  Author: Timothy E Baldwin <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Restart exit() if signal pending

Without this a signal could vanish on thread exit.

Signed-off-by: Timothy Edward Baldwin <address@hidden>
Message-id: address@hidden
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: bef653d92e4e1c47c60f5c020ff6de69dba83478
      
https://github.com/qemu/qemu/commit/bef653d92e4e1c47c60f5c020ff6de69dba83478
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Use safe_syscall for kill, tkill and tgkill syscalls

Use the safe_syscall wrapper for the kill, tkill and tgkill syscalls.
Without this, if a thread sent a SIGKILL to itself it could kill the
thread before we had a chance to process a signal that arrived just
before the SIGKILL, and that signal would get lost.

We drop all the ifdeffery for tkill and tgkill, because every guest
architecture we support implements them, and they've been in Linux
since 2003 so we can assume the host headers define the __NR_tkill
and __NR_tgkill constants.

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


  Commit: 7d92d34ee4c7988f5ef6c8a5ed23d2c3e0837253
      
https://github.com/qemu/qemu/commit/7d92d34ee4c7988f5ef6c8a5ed23d2c3e0837253
  Author: Timothy E Baldwin <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Restart fork() if signals pending

If there is a signal pending during fork() the signal handler will
erroneously be called in both the parent and child, so handle any
pending signals first.

Signed-off-by: Timothy Edward Baldwin <address@hidden>
Message-id: address@hidden
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: a70dadc7f1a3e96a7179c6c3a6ccd1a0ea65760a
      
https://github.com/qemu/qemu/commit/a70dadc7f1a3e96a7179c6c3a6ccd1a0ea65760a
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-07 (Tue, 07 Jun 2016)

  Changed paths:
    M linux-user/signal.c
    M linux-user/syscall_defs.h

  Log Message:
  -----------
  linux-user: Use both si_code and si_signo when converting siginfo_t

The siginfo_t struct includes a union. The correct way to identify
which fields of the union are relevant is complicated, because we
have to use a combination of the si_code and si_signo to figure out
which of the union's members are valid.  (Within the host kernel it
is always possible to tell, but the kernel carefully avoids giving
userspace the high 16 bits of si_code, so we don't have the
information to do this the easy way...) We therefore make our best
guess, bearing in mind that a guest can spoof most of the si_codes
via rt_sigqueueinfo() if it likes.  Once we have made our guess, we
record it in the top 16 bits of the si_code, so that tswap_siginfo()
later can use it.  tswap_siginfo() then strips these top bits out
before writing si_code to the guest (sign-extending the lower bits).

This fixes a bug where fields were sometimes wrong; in particular
the LTP kill10 test went into an infinite loop because its signal
handler got a si_pid value of 0 rather than the pid of the sending
process.

As part of this change, we switch to using __put_user() in the
tswap_siginfo code which writes out the byteswapped values to
the target memory, in case the target memory pointer is not
sufficiently aligned for the host CPU's requirements.

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 90c0f080fe6fdd8b18691e6e38c853c8a996ad92
      
https://github.com/qemu/qemu/commit/90c0f080fe6fdd8b18691e6e38c853c8a996ad92
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  linux-user: Avoid possible misalignment in target_to_host_siginfo()

Reimplement target_to_host_siginfo() to use __get_user(), which
handles possibly misaligned source guest structures correctly.

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


  Commit: 9e024732f53b368abdd578e1795bf3d2779ea88a
      
https://github.com/qemu/qemu/commit/9e024732f53b368abdd578e1795bf3d2779ea88a
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/host/x86_64/safe-syscall.inc.S

  Log Message:
  -----------
  linux-user: provide frame information in x86-64 safe_syscall

Use cfi directives in the x86-64 safe_syscall to allow gdb to get
backtraces right from within it. (In particular this will be
quite a common situation if the user interrupts QEMU while it's
in a blocked safe-syscall: at the point of the syscall insn RBP
is in use for something else, and so gdb can't find the frame then
without assistance.)

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


  Commit: e0156a9dc43daea13b06b4c0edb755cc8f92dfdf
      
https://github.com/qemu/qemu/commit/e0156a9dc43daea13b06b4c0edb755cc8f92dfdf
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Fix handling of arm_fadvise64_64 syscall

32-bit ARM has an odd variant of the fadvise syscall which has
rearranged arguments, which we try to implement. Unfortunately we got
the rearrangement wrong.

This is a six-argument syscall whose arguments are:
 * fd
 * advise parameter
 * offset high half
 * offset low half
 * len high half
 * len low half

Stop trying to share code with the standard fadvise syscalls,
and just implement the syscall with the correct argument order.

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


  Commit: badd3cd8805de3b5f8c76b6a00612ed62a71eff8
      
https://github.com/qemu/qemu/commit/badd3cd8805de3b5f8c76b6a00612ed62a71eff8
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Fix NR_fadvise64 and NR_fadvise64_64 for 32-bit guests

Fix errors in the implementation of NR_fadvise64 and NR_fadvise64_64
for 32-bit guests, which pass their off_t values in register pairs.
We can't use the 64-bit code path for this, so split out the 32-bit
cases, so that we can correctly handle the "only offset is 64-bit"
and "both offset and length are 64-bit" syscall flavours, and
"uses aligned register pairs" and "does not" flavours of target.

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


  Commit: 977d8241c10de4160a9377efd496395c98b7dee9
      
https://github.com/qemu/qemu/commit/977d8241c10de4160a9377efd496395c98b7dee9
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Fix error conversion in 64-bit fadvise syscall

Fix a missing host-to-target errno conversion in the 64-bit
fadvise syscall emulation.

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


  Commit: 918c03ed9ac583eb9d5c33345a814291e1dd2e87
      
https://github.com/qemu/qemu/commit/918c03ed9ac583eb9d5c33345a814291e1dd2e87
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Use safe_syscall wrapper for readv and writev syscalls

Use the safe_syscall wrapper for readv and writev syscalls.

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 2a3c7619288af9cfcc09a233dce911bf80849dfb
      
https://github.com/qemu/qemu/commit/2a3c7619288af9cfcc09a233dce911bf80849dfb
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Use safe_syscall wrapper for connect syscall

Use the safe_syscall wrapper for the connect syscall.

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 666875306e03e1f94e1d4c808502585c10abc69a
      
https://github.com/qemu/qemu/commit/666875306e03e1f94e1d4c808502585c10abc69a
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Use safe_syscall wrapper for send* and recv* syscalls

Use the safe_syscall wrapper for the send, sendto, sendmsg, recv,
recvfrom and recvmsg syscalls.

RV: adjusted to apply
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 89f9fe4452848386e9d0aacd84ac681944051b78
      
https://github.com/qemu/qemu/commit/89f9fe4452848386e9d0aacd84ac681944051b78
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Use safe_syscall wrapper for msgsnd and msgrcv

Use the safe_syscall wrapper for msgsnd and msgrcv syscalls.
This is made slightly awkward by some host architectures providing
only a single 'ipc' syscall rather than separate syscalls per
operation; we provide safe_msgsnd() and safe_msgrcv() as wrappers
around safe_ipc() to handle this if needed.

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: d40ecd66182c9dbcf320c63a359917968cc9b73c
      
https://github.com/qemu/qemu/commit/d40ecd66182c9dbcf320c63a359917968cc9b73c
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Use safe_syscall wrapper for mq_timedsend and mq_timedreceive

Use the safe_syscall wrapper for mq_timedsend and mq_timedreceive syscalls.

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 2a8459892f83ad563efc8a3b29db766ebe986447
      
https://github.com/qemu/qemu/commit/2a8459892f83ad563efc8a3b29db766ebe986447
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Use safe_syscall wrapper for flock

Use the safe_syscall wrapper for the flock syscall.

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: b3f823306829a717b072548e630e0bd769706802
      
https://github.com/qemu/qemu/commit/b3f823306829a717b072548e630e0bd769706802
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Use safe_syscall wrapper for rt_sigtimedwait syscall

Use the safe_syscall wrapper for the rt_sigtimedwait syscall.

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 9e518226f431454ce2d4d01051593b32515b3b55
      
https://github.com/qemu/qemu/commit/9e518226f431454ce2d4d01051593b32515b3b55
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Use safe_syscall wrapper for sleep syscalls

Use the safe_syscall wrapper for the clock_nanosleep and nanosleep
syscalls.

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: a6130237b85e15463592484155aa905a9b39cc6c
      
https://github.com/qemu/qemu/commit/a6130237b85e15463592484155aa905a9b39cc6c
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Use safe_syscall wrapper for poll and ppoll syscalls

Use the safe_syscall wrapper for the poll and ppoll syscalls.
Since not all host architectures will have a poll syscall, we
have to rewrite the TARGET_NR_poll handling to use ppoll instead
(we can assume everywhere has ppoll by now).

We take the opportunity to switch to the code structure
already used in the implementation of epoll_wait and epoll_pwait,
which uses a switch() to avoid interleaving #if and if (),
and to stop using a variable with a leading '_' which is in
the implementation's namespace.

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 227f02143f269493543faf6908318c17abd725cd
      
https://github.com/qemu/qemu/commit/227f02143f269493543faf6908318c17abd725cd
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M configure
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Use safe_syscall wrapper for epoll_wait syscalls

Use the safe_syscall wrapper for epoll_wait and epoll_pwait syscalls.

Since we now directly use the host epoll_pwait syscall for both
epoll_wait and epoll_pwait, we don't need the configure machinery
to check whether glibc supports epoll_pwait(). (The kernel has
supported the syscall since 2.6.19 so we can assume it's always there.)

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: ffb7ee796ae83b1e4b3c108f8615d54b53872c68
      
https://github.com/qemu/qemu/commit/ffb7ee796ae83b1e4b3c108f8615d54b53872c68
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Use safe_syscall wrapper for semop

Use the safe_syscall wrapper for the semop syscall or IPC operation.
(We implement via the semtimedop syscall to make it easier to
implement the guest semtimedop syscall later.)

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: ff6dc130794bcd5b2033bc50262a7720285a74c7
      
https://github.com/qemu/qemu/commit/ff6dc130794bcd5b2033bc50262a7720285a74c7
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Use safe_syscall wrapper for accept and accept4 syscalls

Use the safe_syscall wrapper for the accept and accept4 syscalls.
accept4 has been in the kernel since 2.6.28 so we can assume it
is always present.

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 49ca6f3e24ee45de514604b8116e541332b23a84
      
https://github.com/qemu/qemu/commit/49ca6f3e24ee45de514604b8116e541332b23a84
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Use safe_syscall wrapper for ioctl

Use the safe_syscall wrapper to implement the ioctl syscall.

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 8efb2ed5ec192f7e83c5e48753e695d5cbc161b2
      
https://github.com/qemu/qemu/commit/8efb2ed5ec192f7e83c5e48753e695d5cbc161b2
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/syscall_defs.h

  Log Message:
  -----------
  linux-user: Correct signedness of target_flock l_start and l_len fields

The l_start and l_len fields in the various target_flock structures are
supposed to be '__kernel_off_t' or '__kernel_loff_t', which means they
should be signed, not unsigned. Correcting the structure definitions means
that __get_user() and __put_user() will correctly sign extend them if
the guest is using 32 bit offsets and the host is using 64 bit offsets.

This fixes failures in the LTP 'fcntl14' tests where it checks that
negative seek offsets work correctly.

We reindent the structures to drop hard tabs since we're touching 40%
of the fields anyway.

RV: long long -> abi_llong as suggested by Laurent Vivier <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 7dcdaeafe07dd87079c4e073bced4cfc8bf5fdf3
      
https://github.com/qemu/qemu/commit/7dcdaeafe07dd87079c4e073bced4cfc8bf5fdf3
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/qemu.h
    M linux-user/strace.c
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Make target_strerror() return 'const char *'

Make target_strerror() return 'const char *' rather than just 'char *';
this will allow us to return constant strings from it for some special
cases.

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


  Commit: da2a34f7f9999da09f6c307b40b66eba8cc38283
      
https://github.com/qemu/qemu/commit/da2a34f7f9999da09f6c307b40b66eba8cc38283
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Special-case ERESTARTSYS in target_strerror()

Since TARGET_ERESTARTSYS and TARGET_ESIGRETURN are internal-to-QEMU
error numbers, handle them specially in target_strerror(), to avoid
confusing strace output like:

9521 rt_sigreturn(14,8,274886297808,8,0,268435456) = -1 errno=513 (Unknown 
error 513)

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: 014628a705bdaf31c09915c29e61f4088956564d
      
https://github.com/qemu/qemu/commit/014628a705bdaf31c09915c29e61f4088956564d
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M linux-user/main.c

  Log Message:
  -----------
  linux-user: In fork_end(), remove correct CPUs from CPU list

In fork_end(), we must fix the list of current CPUs to match the fact
that the child of the fork has only one thread. Unfortunately we were
removing the wrong CPUs from the list, which meant that if the child
subsequently did an exclusive operation it would deadlock in
start_exclusive() waiting for a sibling CPU which didn't exist.

In particular this could cause hangs doing git submodule init
operations, as reported in https://bugs.launchpad.net/qemu/+bug/955379
comment #47.

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>


  Commit: b66e10e4c9ae738412b9742db49457f6b703e349
      
https://github.com/qemu/qemu/commit/b66e10e4c9ae738412b9742db49457f6b703e349
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-08 (Wed, 08 Jun 2016)

  Changed paths:
    M configure
    M gdbstub.c
    M include/exec/gdbstub.h
    M linux-user/host/x86_64/safe-syscall.inc.S
    M linux-user/main.c
    M linux-user/qemu.h
    M linux-user/signal.c
    M linux-user/strace.c
    M linux-user/syscall.c
    M linux-user/syscall_defs.h
    M scripts/qemu-binfmt-conf.sh

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/riku/tags/pull-linux-user-20160608' 
into staging

linux-user pull request for June 2016

# gpg: Signature made Wed 08 Jun 2016 14:27:14 BST
# gpg:                using RSA key 0xB44890DEDE3C9BC0
# gpg: Good signature from "Riku Voipio <address@hidden>"
# gpg:                 aka "Riku Voipio <address@hidden>"

* remotes/riku/tags/pull-linux-user-20160608: (44 commits)
  linux-user: In fork_end(), remove correct CPUs from CPU list
  linux-user: Special-case ERESTARTSYS in target_strerror()
  linux-user: Make target_strerror() return 'const char *'
  linux-user: Correct signedness of target_flock l_start and l_len fields
  linux-user: Use safe_syscall wrapper for ioctl
  linux-user: Use safe_syscall wrapper for accept and accept4 syscalls
  linux-user: Use safe_syscall wrapper for semop
  linux-user: Use safe_syscall wrapper for epoll_wait syscalls
  linux-user: Use safe_syscall wrapper for poll and ppoll syscalls
  linux-user: Use safe_syscall wrapper for sleep syscalls
  linux-user: Use safe_syscall wrapper for rt_sigtimedwait syscall
  linux-user: Use safe_syscall wrapper for flock
  linux-user: Use safe_syscall wrapper for mq_timedsend and mq_timedreceive
  linux-user: Use safe_syscall wrapper for msgsnd and msgrcv
  linux-user: Use safe_syscall wrapper for send* and recv* syscalls
  linux-user: Use safe_syscall wrapper for connect syscall
  linux-user: Use safe_syscall wrapper for readv and writev syscalls
  linux-user: Fix error conversion in 64-bit fadvise syscall
  linux-user: Fix NR_fadvise64 and NR_fadvise64_64 for 32-bit guests
  linux-user: Fix handling of arm_fadvise64_64 syscall
  ...

Signed-off-by: Peter Maydell <address@hidden>

Conflicts:
        configure
        scripts/qemu-binfmt-conf.sh


Compare: https://github.com/qemu/qemu/compare/6f50f25c825f...b66e10e4c9ae

reply via email to

[Prev in Thread] Current Thread [Next in Thread]