All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall
@ 2018-06-10  3:00 Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 001/108] linux-user: Remove DEBUG Richard Henderson
                   ` (111 more replies)
  0 siblings, 112 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

* Changed the table into a switch, for the reason documented.
  Use macros to actually enter the syscall into the switch.
* Finish the split.
* Fix some bugs along the way.

I know it's a huge patch set, but I guess it was always going
to be in order to finish -- it was a stupidly large function.


r~


Richard Henderson (108):
  linux-user: Remove DEBUG
  linux-user: Split out do_syscall1
  linux-user: Relax single exit from "break"
  linux-user: Propagate goto efault to return
  linux-user: Propagate goto unimplemented_nowarn to return
  linux-user: Propagate goto unimplemented to default
  linux-user: Propagate goto fail to return
  linux-user: Make syscall number unsigned
  linux-user: Set up infrastructure for table-izing syscalls
  linux-user: Split out brk, close, exit, read, write
  linux-user: Split out execve
  linux-user: Split out open, openat
  linux-user: Split out name_to_handle_at
  linux-user: Split out open_to_handle_at
  linux-user: Split out creat, fork, waitid, waitpid
  linux-user: Split out link, linkat
  linux-user: Split out unlink, unlinkat
  linux-user: Split out chdir, mknod, mknodat, time, chmod
  linux-user: Split out getpid, getxpid, lseek
  linux-user: Split out mount, umount
  linux-user: Split out alarm, pause, stime, utime, utimes
  linux-user: Split out access, faccessat, futimesat, kill, nice, sync,
    syncfs
  linux-user: Split out rename, renameat, renameat2
  linux-user: Split out dup, mkdir, mkdirat, rmdir
  linux-user: Split out acct, pipe, pipe2, times, umount2
  linux-user: Split out ioctl
  linux-user: Split out chroot, dup2, dup3, fcntl, setpgid, umask
  linux-user: Split out getpgrp, getppid, setsid
  linux-user: Split out rt_sigaction, sigaction
  linux-user: Split out rt_sigprocmask, sgetmask, sigprocmask, ssetmask
  linux-user: Split out rt_sigpending, rt_sigsuspend, sigpending,
    sigsuspend
  linux-user: Split out rt_sigqueueinfo, rt_sigtimedwait,
    rt_tgsigqueueinfo
  linux-user: Split out rt_sigreturn, sethostname, setrlimit, sigreturn
  linux-user: Split out getrlimit, getrusage, gettimeofday, settimeofday
  linux-user: Split out select, pselect6, newselect
  linux-user: Split out symlink, symlinkat
  linux-user: Split out readlink, readlinkat
  linux-user: Split out mmap, mmap2, reboot, swapon
  linux-user: Split out mprotect, mremap, msync, munmap
  linux-user: Split out mlock, mlockall, munlock, munlockall
  linux-user: Split out fchmod, fchmodat, ftruncate, truncate
  linux-user: Split out fstatfs, fstatfs64, statfs, statfs64
  linux-user: Split out getpriority, setpriority
  linux-user: Split out socketcall
  linux-user: Split out accept, accept4, bind, connect
  linux-user: Split out 7 syscalls
  linux-user: Split out recvmmsg, send, sendmmsg, sendmsg, sendto
  linux-user: Split out getrandom, shutdown, setsockopt, socket,
    socketpair
  linux-user: Fix stub gettid
  linux-user: Split out getitimer, setitimer, syslog
  linux-user: Split out fstat, lstat, stat
  linux-user: Unwrap TARGET_NR_syscall early
  linux-user: Split out swapoff, sysinfo, vhangup, wait4
  linux-user: Split out ipc
  linux-user: Split out ipc syscalls
  linux-user: Split out clone, exit_group, fsync
  linux-user: Split out modify_ldt, setdomainname, uname
  linux-user: Split out adjtimex, clock_adjtime, vm86
  linux-user: Split out fchdir, getpgid, llseek, personality
  linux-user: Split out getdents, getdents64
  linux-user: Split out poll, ppoll
  linux-user: Split out flock, preadv, pwritev, readv, writev
  linux-user: Split out fdatasync, getsid, _sysctl
  linux-user: Split out sched syscalls
  linux-user: Split out getcpu, nanosleep, prctl
  linux-user: Split out arch_prctl
  linux-user: Split out getcwd, pread64, pwrite64, sigaltstack
  linux-user: Split out capget, capset
  linux-user: Split out sendfile, sendfile64
  linux-user: Split out ftruncate64, truncate64, ugetrlimit, vfork
  linux-user: Split out fstat64, fstatat64, newfstatat, lstat64, stat64
  linux-user: Split out getegid, geteuid, getgid, getuid, lchown
  linux-user: Split out getgroups, setgroups, setregid, setreuid
  linux-user: Split out fchown, fchownat, setresgid, setresuid
  linux-user: Split out chown, getresgid, getresuid
  linux-user: Split out setfsgid, setfsuid, setgid, setuid
  linux-user: Split out getuid32, getxgid, getxuid, lchown32
  linux-user: Split out osf_getsysinfo, osf_setsysinfo, osf_sigprocmask
  linux-user: Split out getegid32, geteuid32, getgid32, setregid32,
    setreuid32
  linux-user: Split out fchown32, getgroups32, setgroups32
  linux-user: Split out getresgid32, getresuid32, setresgid32,
    setresuid32
  linux-user: Split out chown32, setfsgid32, setfsuid32, setgid32,
    setuid32
  linux-user: Split out mincore
  linux-user: Split out fadvise64, fadvise64_64
  linux-user: Split out cacheflush, fcntl64, getpagesize, madvise
  linux-user: Split out gettid, readahead
  linux-user: Split out xattr syscalls
  linux-user: Split out getdomainname, get_thread_area, set_thread_area
  linux-user: Split out clock syscalls
  linux-user: Fix clock_nanosleep
  linux-user: Split out set_tid_address, tgkill, tkill
  linux-user: Split out futex, utimensat
  linux-user: Remove sys_futex
  linux-user: Split out inotify syscalls
  linux-user: Split out mq syscalls
  linux-user: Split out splice, tee, vmsplice
  linux-user: Split out eventfd, eventfd2
  linux-user: Split out fallocate, sync_file_range/2
  linux-user: Split out signalfd, signalfd4
  linux-user: Split out epoll syscalls
  linux-user: Split out prlimit64
  linux-user: Split out atomic_barrier, gethostname
  linux-user: Split out atomic_cmpxchg_32
  linux-user: Split out timer syscalls
  linux-user: Split out timerfd syscalls
  linux-user: Split out ioprio_get, ioprio_set, kcmp
  linux-user: Split out setns, unshare
  linux-user: Fold away do_syscall1

 linux-user/qemu.h    |     2 +-
 linux-user/syscall.c | 11826 +++++++++++++++++++++++------------------
 2 files changed, 6526 insertions(+), 5302 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 001/108] linux-user: Remove DEBUG
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10 11:51   ` Laurent Vivier
  2018-06-10 16:43   ` Philippe Mathieu-Daudé
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 002/108] linux-user: Split out do_syscall1 Richard Henderson
                   ` (110 subsequent siblings)
  111 siblings, 2 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

This is redundant with both -strace and actual tracing.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 7b9ac3b408..c212149245 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -163,7 +163,6 @@
  * (The one remaining unallocated bit is 0x1000 which used to be CLONE_PID.)
  */
 
-//#define DEBUG
 /* Define DEBUG_ERESTARTSYS to force every syscall to be restarted
  * once. This exercises the codepaths for restart.
  */
@@ -5777,9 +5776,6 @@ static abi_long do_ioctl(int fd, int cmd, abi_long arg)
         ie++;
     }
     arg_type = ie->arg_type;
-#if defined(DEBUG)
-    gemu_log("ioctl: cmd=0x%04lx (%s)\n", (long)cmd, ie->name);
-#endif
     if (ie->do_ioctl) {
         return ie->do_ioctl(ie, buf_temp, fd, cmd, arg);
     } else if (!ie->host_cmd) {
@@ -7980,9 +7976,6 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
     }
 #endif
 
-#ifdef DEBUG
-    gemu_log("syscall %d", num);
-#endif
     trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
     if(do_strace)
         print_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6);
@@ -12772,9 +12765,6 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
         break;
     }
 fail:
-#ifdef DEBUG
-    gemu_log(" = " TARGET_ABI_FMT_ld "\n", ret);
-#endif
     if(do_strace)
         print_syscall_ret(num, ret);
     trace_guest_user_syscall_ret(cpu, num, ret);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 002/108] linux-user: Split out do_syscall1
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 001/108] linux-user: Remove DEBUG Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 003/108] linux-user: Relax single exit from "break" Richard Henderson
                   ` (109 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

There was supposed to be a single point of return for do_syscall
so that tracing works properly.  However, there are a few bugs
in that area.  It is significantly simpler to simply split out
an inner function to enforce this.

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 77 +++++++++++++++++++++++++++-----------------
 1 file changed, 48 insertions(+), 29 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index c212149245..ec3bc1cbe5 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7947,13 +7947,15 @@ static int host_to_target_cpu_mask(const unsigned long *host_mask,
     return 0;
 }
 
-/* do_syscall() should always have a single exit point at the end so
-   that actions, such as logging of syscall results, can be performed.
-   All errnos that do_syscall() returns must be -TARGET_<errcode>. */
-abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
-                    abi_long arg2, abi_long arg3, abi_long arg4,
-                    abi_long arg5, abi_long arg6, abi_long arg7,
-                    abi_long arg8)
+/* This is an internal helper for do_syscall so that it is easier
+ * to have a single return point, so that actions, such as logging
+ * of syscall results, can be performed.
+ * All errnos that do_syscall() returns must be -TARGET_<errcode>.
+ */
+static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
+                            abi_long arg2, abi_long arg3, abi_long arg4,
+                            abi_long arg5, abi_long arg6, abi_long arg7,
+                            abi_long arg8)
 {
     CPUState *cpu = ENV_GET_CPU(cpu_env);
     abi_long ret;
@@ -7961,25 +7963,6 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
     struct statfs stfs;
     void *p;
 
-#if defined(DEBUG_ERESTARTSYS)
-    /* Debug-only code for exercising the syscall-restart code paths
-     * in the per-architecture cpu main loops: restart every syscall
-     * the guest makes once before letting it through.
-     */
-    {
-        static int flag;
-
-        flag = !flag;
-        if (flag) {
-            return -TARGET_ERESTARTSYS;
-        }
-    }
-#endif
-
-    trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
-    if(do_strace)
-        print_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6);
-
     switch(num) {
     case TARGET_NR_exit:
         /* In old applications this may be used to implement _exit(2).
@@ -12765,11 +12748,47 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
         break;
     }
 fail:
-    if(do_strace)
-        print_syscall_ret(num, ret);
-    trace_guest_user_syscall_ret(cpu, num, ret);
     return ret;
 efault:
     ret = -TARGET_EFAULT;
     goto fail;
 }
+
+abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+                    abi_long arg2, abi_long arg3, abi_long arg4,
+                    abi_long arg5, abi_long arg6, abi_long arg7,
+                    abi_long arg8)
+{
+    CPUState *cpu = ENV_GET_CPU(cpu_env);
+    abi_long ret;
+
+#ifdef DEBUG_ERESTARTSYS
+    /* Debug-only code for exercising the syscall-restart code paths
+     * in the per-architecture cpu main loops: restart every syscall
+     * the guest makes once before letting it through.
+     */
+    {
+        static bool flag;
+        flag = !flag;
+        if (flag) {
+            return -TARGET_ERESTARTSYS;
+        }
+    }
+#endif
+
+    trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4,
+                             arg5, arg6, arg7, arg8);
+
+    if (unlikely(do_strace)) {
+        print_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6);
+        ret = do_syscall1(cpu_env, num, arg1, arg2, arg3, arg4,
+                          arg5, arg6, arg7, arg8);
+        print_syscall_ret(num, ret);
+    } else {
+        ret = do_syscall1(cpu_env, num, arg1, arg2, arg3, arg4,
+                          arg5, arg6, arg7, arg8);
+    }
+
+    trace_guest_user_syscall_ret(cpu, num, ret);
+    return ret;
+}
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 003/108] linux-user: Relax single exit from "break"
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 001/108] linux-user: Remove DEBUG Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 002/108] linux-user: Split out do_syscall1 Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 004/108] linux-user: Propagate goto efault to return Richard Henderson
                   ` (108 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Transform outermost "break" to "return ret".  If the immediately
preceeding statement was an assignment to ret, return the value
directly.

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 970 +++++++++++++++++--------------------------
 1 file changed, 390 insertions(+), 580 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index ec3bc1cbe5..efe882612b 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7971,8 +7971,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
            Do thread termination if we have more then one thread.  */
 
         if (block_signals()) {
-            ret = -TARGET_ERESTARTSYS;
-            break;
+            return -TARGET_ERESTARTSYS;
         }
 
         cpu_list_lock();
@@ -8004,12 +8003,11 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #endif
         gdb_exit(cpu_env, arg1);
         _exit(arg1);
-        ret = 0; /* avoid warning */
-        break;
+        return 0; /* avoid warning */
     case TARGET_NR_read:
-        if (arg3 == 0)
-            ret = 0;
-        else {
+        if (arg3 == 0) {
+            return 0;
+        } else {
             if (!(p = lock_user(VERIFY_WRITE, arg2, arg3, 0)))
                 goto efault;
             ret = get_errno(safe_read(arg1, p, arg3));
@@ -8019,7 +8017,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
             unlock_user(p, arg2, ret);
         }
-        break;
+        return ret;
     case TARGET_NR_write:
         if (!(p = lock_user(VERIFY_READ, arg2, arg3, 1)))
             goto efault;
@@ -8035,7 +8033,8 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(safe_write(arg1, p, arg3));
         }
         unlock_user(p, arg2, 0);
-        break;
+        return ret;
+
 #ifdef TARGET_NR_open
     case TARGET_NR_open:
         if (!(p = lock_user_string(arg1)))
@@ -8045,7 +8044,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                                   arg3));
         fd_trans_unregister(ret);
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
 #endif
     case TARGET_NR_openat:
         if (!(p = lock_user_string(arg2)))
@@ -8055,29 +8054,27 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                                   arg4));
         fd_trans_unregister(ret);
         unlock_user(p, arg2, 0);
-        break;
+        return ret;
 #if defined(TARGET_NR_name_to_handle_at) && defined(CONFIG_OPEN_BY_HANDLE)
     case TARGET_NR_name_to_handle_at:
         ret = do_name_to_handle_at(arg1, arg2, arg3, arg4, arg5);
-        break;
+        return ret;
 #endif
 #if defined(TARGET_NR_open_by_handle_at) && defined(CONFIG_OPEN_BY_HANDLE)
     case TARGET_NR_open_by_handle_at:
         ret = do_open_by_handle_at(arg1, arg2, arg3);
         fd_trans_unregister(ret);
-        break;
+        return ret;
 #endif
     case TARGET_NR_close:
         fd_trans_unregister(arg1);
-        ret = get_errno(close(arg1));
-        break;
+        return get_errno(close(arg1));
+
     case TARGET_NR_brk:
-        ret = do_brk(arg1);
-        break;
+        return do_brk(arg1);
 #ifdef TARGET_NR_fork
     case TARGET_NR_fork:
-        ret = get_errno(do_fork(cpu_env, TARGET_SIGCHLD, 0, 0, 0, 0));
-        break;
+        return get_errno(do_fork(cpu_env, TARGET_SIGCHLD, 0, 0, 0, 0));
 #endif
 #ifdef TARGET_NR_waitpid
     case TARGET_NR_waitpid:
@@ -8088,7 +8085,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 && put_user_s32(host_to_target_waitstatus(status), arg2))
                 goto efault;
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_waitid
     case TARGET_NR_waitid:
@@ -8103,7 +8100,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 unlock_user(p, arg3, sizeof(target_siginfo_t));
             }
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_creat /* not on alpha */
     case TARGET_NR_creat:
@@ -8112,7 +8109,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         ret = get_errno(creat(p, arg2));
         fd_trans_unregister(ret);
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_link
     case TARGET_NR_link:
@@ -8127,7 +8124,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(p2, arg2, 0);
             unlock_user(p, arg1, 0);
         }
-        break;
+        return ret;
 #endif
 #if defined(TARGET_NR_linkat)
     case TARGET_NR_linkat:
@@ -8144,7 +8141,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(p, arg2, 0);
             unlock_user(p2, arg4, 0);
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_unlink
     case TARGET_NR_unlink:
@@ -8152,7 +8149,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             goto efault;
         ret = get_errno(unlink(p));
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
 #endif
 #if defined(TARGET_NR_unlinkat)
     case TARGET_NR_unlinkat:
@@ -8160,7 +8157,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             goto efault;
         ret = get_errno(unlinkat(arg1, p, arg3));
         unlock_user(p, arg2, 0);
-        break;
+        return ret;
 #endif
     case TARGET_NR_execve:
         {
@@ -8258,13 +8255,13 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             g_free(argp);
             g_free(envp);
         }
-        break;
+        return ret;
     case TARGET_NR_chdir:
         if (!(p = lock_user_string(arg1)))
             goto efault;
         ret = get_errno(chdir(p));
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
 #ifdef TARGET_NR_time
     case TARGET_NR_time:
         {
@@ -8275,7 +8272,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 && put_user_sal(host_time, arg1))
                 goto efault;
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_mknod
     case TARGET_NR_mknod:
@@ -8283,7 +8280,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             goto efault;
         ret = get_errno(mknod(p, arg2, arg3));
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
 #endif
 #if defined(TARGET_NR_mknodat)
     case TARGET_NR_mknodat:
@@ -8291,7 +8288,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             goto efault;
         ret = get_errno(mknodat(arg1, p, arg3, arg4));
         unlock_user(p, arg2, 0);
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_chmod
     case TARGET_NR_chmod:
@@ -8299,7 +8296,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             goto efault;
         ret = get_errno(chmod(p, arg2));
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_break
     case TARGET_NR_break:
@@ -8310,19 +8307,16 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         goto unimplemented;
 #endif
     case TARGET_NR_lseek:
-        ret = get_errno(lseek(arg1, arg2, arg3));
-        break;
+        return get_errno(lseek(arg1, arg2, arg3));
 #if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
     /* Alpha specific */
     case TARGET_NR_getxpid:
         ((CPUAlphaState *)cpu_env)->ir[IR_A4] = getppid();
-        ret = get_errno(getpid());
-        break;
+        return get_errno(getpid());
 #endif
 #ifdef TARGET_NR_getpid
     case TARGET_NR_getpid:
-        ret = get_errno(getpid());
-        break;
+        return get_errno(getpid());
 #endif
     case TARGET_NR_mount:
         {
@@ -8378,14 +8372,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 unlock_user(p3, arg3, 0);
             }
         }
-        break;
+        return ret;
 #ifdef TARGET_NR_umount
     case TARGET_NR_umount:
         if (!(p = lock_user_string(arg1)))
             goto efault;
         ret = get_errno(umount(p));
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_stime /* not on alpha */
     case TARGET_NR_stime:
@@ -8393,16 +8387,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             time_t host_time;
             if (get_user_sal(host_time, arg1))
                 goto efault;
-            ret = get_errno(stime(&host_time));
+            return get_errno(stime(&host_time));
         }
-        break;
 #endif
     case TARGET_NR_ptrace:
         goto unimplemented;
 #ifdef TARGET_NR_alarm /* not on alpha */
     case TARGET_NR_alarm:
-        ret = alarm(arg1);
-        break;
+        return alarm(arg1);
 #endif
 #ifdef TARGET_NR_oldfstat
     case TARGET_NR_oldfstat:
@@ -8413,8 +8405,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         if (!block_signals()) {
             sigsuspend(&((TaskState *)cpu->opaque)->signal_mask);
         }
-        ret = -TARGET_EINTR;
-        break;
+        return -TARGET_EINTR;
 #endif
 #ifdef TARGET_NR_utime
     case TARGET_NR_utime:
@@ -8436,7 +8427,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(utime(p, host_tbuf));
             unlock_user(p, arg1, 0);
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_utimes
     case TARGET_NR_utimes:
@@ -8456,7 +8447,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(utimes(p, tvp));
             unlock_user(p, arg1, 0);
         }
-        break;
+        return ret;
 #endif
 #if defined(TARGET_NR_futimesat)
     case TARGET_NR_futimesat:
@@ -8476,7 +8467,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(futimesat(arg1, path(p), tvp));
             unlock_user(p, arg2, 0);
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_stty
     case TARGET_NR_stty:
@@ -8492,7 +8483,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             goto efault;
         ret = get_errno(access(path(p), arg2));
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
 #endif
 #if defined(TARGET_NR_faccessat) && defined(__NR_faccessat)
     case TARGET_NR_faccessat:
@@ -8500,12 +8491,11 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             goto efault;
         ret = get_errno(faccessat(arg1, p, arg3, 0));
         unlock_user(p, arg2, 0);
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_nice /* not on alpha */
     case TARGET_NR_nice:
-        ret = get_errno(nice(arg1));
-        break;
+        return get_errno(nice(arg1));
 #endif
 #ifdef TARGET_NR_ftime
     case TARGET_NR_ftime:
@@ -8513,16 +8503,13 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #endif
     case TARGET_NR_sync:
         sync();
-        ret = 0;
-        break;
+        return 0;
 #if defined(TARGET_NR_syncfs) && defined(CONFIG_SYNCFS)
     case TARGET_NR_syncfs:
-        ret = get_errno(syncfs(arg1));
-        break;
+        return get_errno(syncfs(arg1));
 #endif
     case TARGET_NR_kill:
-        ret = get_errno(safe_kill(arg1, target_to_host_signal(arg2)));
-        break;
+        return get_errno(safe_kill(arg1, target_to_host_signal(arg2)));
 #ifdef TARGET_NR_rename
     case TARGET_NR_rename:
         {
@@ -8536,7 +8523,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(p2, arg2, 0);
             unlock_user(p, arg1, 0);
         }
-        break;
+        return ret;
 #endif
 #if defined(TARGET_NR_renameat)
     case TARGET_NR_renameat:
@@ -8551,7 +8538,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(p2, arg4, 0);
             unlock_user(p, arg2, 0);
         }
-        break;
+        return ret;
 #endif
 #if defined(TARGET_NR_renameat2)
     case TARGET_NR_renameat2:
@@ -8567,7 +8554,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(p2, arg4, 0);
             unlock_user(p, arg2, 0);
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_mkdir
     case TARGET_NR_mkdir:
@@ -8575,7 +8562,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             goto efault;
         ret = get_errno(mkdir(p, arg2));
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
 #endif
 #if defined(TARGET_NR_mkdirat)
     case TARGET_NR_mkdirat:
@@ -8583,7 +8570,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             goto efault;
         ret = get_errno(mkdirat(arg1, p, arg3));
         unlock_user(p, arg2, 0);
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_rmdir
     case TARGET_NR_rmdir:
@@ -8591,24 +8578,22 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             goto efault;
         ret = get_errno(rmdir(p));
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
 #endif
     case TARGET_NR_dup:
         ret = get_errno(dup(arg1));
         if (ret >= 0) {
             fd_trans_dup(arg1, ret);
         }
-        break;
+        return ret;
 #ifdef TARGET_NR_pipe
     case TARGET_NR_pipe:
-        ret = do_pipe(cpu_env, arg1, 0, 0);
-        break;
+        return do_pipe(cpu_env, arg1, 0, 0);
 #endif
 #ifdef TARGET_NR_pipe2
     case TARGET_NR_pipe2:
-        ret = do_pipe(cpu_env, arg1,
-                      target_to_host_bitmask(arg2, fcntl_flags_tbl), 1);
-        break;
+        return do_pipe(cpu_env, arg1,
+                       target_to_host_bitmask(arg2, fcntl_flags_tbl), 1);
 #endif
     case TARGET_NR_times:
         {
@@ -8627,7 +8612,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             if (!is_error(ret))
                 ret = host_to_target_clock_t(ret);
         }
-        break;
+        return ret;
 #ifdef TARGET_NR_prof
     case TARGET_NR_prof:
         goto unimplemented;
@@ -8645,34 +8630,31 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(acct(path(p)));
             unlock_user(p, arg1, 0);
         }
-        break;
+        return ret;
 #ifdef TARGET_NR_umount2
     case TARGET_NR_umount2:
         if (!(p = lock_user_string(arg1)))
             goto efault;
         ret = get_errno(umount2(p, arg2));
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_lock
     case TARGET_NR_lock:
         goto unimplemented;
 #endif
     case TARGET_NR_ioctl:
-        ret = do_ioctl(arg1, arg2, arg3);
-        break;
+        return do_ioctl(arg1, arg2, arg3);
 #ifdef TARGET_NR_fcntl
     case TARGET_NR_fcntl:
-        ret = do_fcntl(arg1, arg2, arg3);
-        break;
+        return do_fcntl(arg1, arg2, arg3);
 #endif
 #ifdef TARGET_NR_mpx
     case TARGET_NR_mpx:
         goto unimplemented;
 #endif
     case TARGET_NR_setpgid:
-        ret = get_errno(setpgid(arg1, arg2));
-        break;
+        return get_errno(setpgid(arg1, arg2));
 #ifdef TARGET_NR_ulimit
     case TARGET_NR_ulimit:
         goto unimplemented;
@@ -8682,14 +8664,13 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         goto unimplemented;
 #endif
     case TARGET_NR_umask:
-        ret = get_errno(umask(arg1));
-        break;
+        return get_errno(umask(arg1));
     case TARGET_NR_chroot:
         if (!(p = lock_user_string(arg1)))
             goto efault;
         ret = get_errno(chroot(p));
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
 #ifdef TARGET_NR_ustat
     case TARGET_NR_ustat:
         goto unimplemented;
@@ -8700,7 +8681,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         if (ret >= 0) {
             fd_trans_dup(arg1, arg2);
         }
-        break;
+        return ret;
 #endif
 #if defined(CONFIG_DUP3) && defined(TARGET_NR_dup3)
     case TARGET_NR_dup3:
@@ -8715,22 +8696,19 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         if (ret >= 0) {
             fd_trans_dup(arg1, arg2);
         }
-        break;
+        return ret;
     }
 #endif
 #ifdef TARGET_NR_getppid /* not on alpha */
     case TARGET_NR_getppid:
-        ret = get_errno(getppid());
-        break;
+        return get_errno(getppid());
 #endif
 #ifdef TARGET_NR_getpgrp
     case TARGET_NR_getpgrp:
-        ret = get_errno(getpgrp());
-        break;
+        return get_errno(getpgrp());
 #endif
     case TARGET_NR_setsid:
-        ret = get_errno(setsid());
-        break;
+        return get_errno(setsid());
 #ifdef TARGET_NR_sigaction
     case TARGET_NR_sigaction:
         {
@@ -8814,7 +8792,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
 #endif
         }
-        break;
+        return ret;
 #endif
     case TARGET_NR_rt_sigaction:
         {
@@ -8831,8 +8809,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             struct target_sigaction act, oact, *pact = 0;
 
             if (arg4 != sizeof(target_sigset_t)) {
-                ret = -TARGET_EINVAL;
-                break;
+                return -TARGET_EINVAL;
             }
             if (arg2) {
                 if (!lock_user_struct(VERIFY_READ, rt_act, arg2, 1))
@@ -8864,8 +8841,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             struct target_sigaction *oact;
 
             if (sigsetsize != sizeof(target_sigset_t)) {
-                ret = -TARGET_EINVAL;
-                break;
+                return -TARGET_EINVAL;
             }
             if (arg2) {
                 if (!lock_user_struct(VERIFY_READ, act, arg2, 1)) {
@@ -8892,7 +8868,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 unlock_user_struct(oact, arg3, 1);
 #endif
         }
-        break;
+        return ret;
 #ifdef TARGET_NR_sgetmask /* not on alpha */
     case TARGET_NR_sgetmask:
         {
@@ -8904,7 +8880,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 ret = target_set;
             }
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_ssetmask /* not on alpha */
     case TARGET_NR_ssetmask:
@@ -8918,7 +8894,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 ret = target_set;
             }
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_sigprocmask
     case TARGET_NR_sigprocmask:
@@ -8988,7 +8964,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
 #endif
         }
-        break;
+        return ret;
 #endif
     case TARGET_NR_rt_sigprocmask:
         {
@@ -8996,8 +8972,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             sigset_t set, oldset, *set_ptr;
 
             if (arg4 != sizeof(target_sigset_t)) {
-                ret = -TARGET_EINVAL;
-                break;
+                return -TARGET_EINVAL;
             }
 
             if (arg2) {
@@ -9032,7 +9007,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 unlock_user(p, arg3, sizeof(target_sigset_t));
             }
         }
-        break;
+        return ret;
 #ifdef TARGET_NR_sigpending
     case TARGET_NR_sigpending:
         {
@@ -9045,7 +9020,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 unlock_user(p, arg1, sizeof(target_sigset_t));
             }
         }
-        break;
+        return ret;
 #endif
     case TARGET_NR_rt_sigpending:
         {
@@ -9057,8 +9032,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
              * the old_sigset_t is smaller in size.
              */
             if (arg2 > sizeof(target_sigset_t)) {
-                ret = -TARGET_EINVAL;
-                break;
+                return -TARGET_EINVAL;
             }
 
             ret = get_errno(sigpending(&set));
@@ -9069,7 +9043,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 unlock_user(p, arg1, sizeof(target_sigset_t));
             }
         }
-        break;
+        return ret;
 #ifdef TARGET_NR_sigsuspend
     case TARGET_NR_sigsuspend:
         {
@@ -9089,15 +9063,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 ts->in_sigsuspend = 1;
             }
         }
-        break;
+        return ret;
 #endif
     case TARGET_NR_rt_sigsuspend:
         {
             TaskState *ts = cpu->opaque;
 
             if (arg2 != sizeof(target_sigset_t)) {
-                ret = -TARGET_EINVAL;
-                break;
+                return -TARGET_EINVAL;
             }
             if (!(p = lock_user(VERIFY_READ, arg1, sizeof(target_sigset_t), 1)))
                 goto efault;
@@ -9109,7 +9082,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 ts->in_sigsuspend = 1;
             }
         }
-        break;
+        return ret;
     case TARGET_NR_rt_sigtimedwait:
         {
             sigset_t set;
@@ -9117,8 +9090,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             siginfo_t uinfo;
 
             if (arg4 != sizeof(target_sigset_t)) {
-                ret = -TARGET_EINVAL;
-                break;
+                return -TARGET_EINVAL;
             }
 
             if (!(p = lock_user(VERIFY_READ, arg1, sizeof(target_sigset_t), 1)))
@@ -9146,7 +9118,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 ret = host_to_target_signal(ret);
             }
         }
-        break;
+        return ret;
     case TARGET_NR_rt_sigqueueinfo:
         {
             siginfo_t uinfo;
@@ -9159,7 +9131,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(p, arg3, 0);
             ret = get_errno(sys_rt_sigqueueinfo(arg1, arg2, &uinfo));
         }
-        break;
+        return ret;
     case TARGET_NR_rt_tgsigqueueinfo:
         {
             siginfo_t uinfo;
@@ -9172,7 +9144,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(p, arg4, 0);
             ret = get_errno(sys_rt_tgsigqueueinfo(arg1, arg2, arg3, &uinfo));
         }
-        break;
+        return ret;
 #ifdef TARGET_NR_sigreturn
     case TARGET_NR_sigreturn:
         if (block_signals()) {
@@ -9180,21 +9152,20 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         } else {
             ret = do_sigreturn(cpu_env);
         }
-        break;
+        return ret;
 #endif
     case TARGET_NR_rt_sigreturn:
         if (block_signals()) {
-            ret = -TARGET_ERESTARTSYS;
+            return -TARGET_ERESTARTSYS;
         } else {
-            ret = do_rt_sigreturn(cpu_env);
+            return do_rt_sigreturn(cpu_env);
         }
-        break;
     case TARGET_NR_sethostname:
         if (!(p = lock_user_string(arg1)))
             goto efault;
         ret = get_errno(sethostname(p, arg2));
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
     case TARGET_NR_setrlimit:
         {
             int resource = target_to_host_resource(arg1);
@@ -9205,9 +9176,8 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             rlim.rlim_cur = target_to_host_rlim(target_rlim->rlim_cur);
             rlim.rlim_max = target_to_host_rlim(target_rlim->rlim_max);
             unlock_user_struct(target_rlim, arg2, 0);
-            ret = get_errno(setrlimit(resource, &rlim));
+            return get_errno(setrlimit(resource, &rlim));
         }
-        break;
     case TARGET_NR_getrlimit:
         {
             int resource = target_to_host_resource(arg1);
@@ -9223,7 +9193,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 unlock_user_struct(target_rlim, arg2, 1);
             }
         }
-        break;
+        return ret;
     case TARGET_NR_getrusage:
         {
             struct rusage rusage;
@@ -9232,7 +9202,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 ret = host_to_target_rusage(arg2, &rusage);
             }
         }
-        break;
+        return ret;
     case TARGET_NR_gettimeofday:
         {
             struct timeval tv;
@@ -9242,7 +9212,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     goto efault;
             }
         }
-        break;
+        return ret;
     case TARGET_NR_settimeofday:
         {
             struct timeval tv, *ptv = NULL;
@@ -9262,9 +9232,8 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 ptz = &tz;
             }
 
-            ret = get_errno(settimeofday(ptv, ptz));
+            return get_errno(settimeofday(ptv, ptz));
         }
-        break;
 #if defined(TARGET_NR_select)
     case TARGET_NR_select:
 #if defined(TARGET_WANT_NI_OLD_SELECT)
@@ -9277,7 +9246,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #else
         ret = do_select(arg1, arg2, arg3, arg4, arg5);
 #endif
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_pselect6
     case TARGET_NR_pselect6:
@@ -9381,7 +9350,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     goto efault;
             }
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_symlink
     case TARGET_NR_symlink:
@@ -9396,7 +9365,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(p2, arg2, 0);
             unlock_user(p, arg1, 0);
         }
-        break;
+        return ret;
 #endif
 #if defined(TARGET_NR_symlinkat)
     case TARGET_NR_symlinkat:
@@ -9411,7 +9380,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(p2, arg3, 0);
             unlock_user(p, arg1, 0);
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_oldlstat
     case TARGET_NR_oldlstat:
@@ -9447,7 +9416,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(p2, arg2, ret);
             unlock_user(p, arg1, 0);
         }
-        break;
+        return ret;
 #endif
 #if defined(TARGET_NR_readlinkat)
     case TARGET_NR_readlinkat:
@@ -9468,7 +9437,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(p2, arg3, ret);
             unlock_user(p, arg2, 0);
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_uselib
     case TARGET_NR_uselib:
@@ -9480,7 +9449,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             goto efault;
         ret = get_errno(swapon(p, arg2));
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
 #endif
     case TARGET_NR_reboot:
         if (arg3 == LINUX_REBOOT_CMD_RESTART2) {
@@ -9494,7 +9463,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         } else {
            ret = get_errno(reboot(arg1, arg2, arg3, NULL));
         }
-        break;
+        return ret;
 #ifdef TARGET_NR_readdir
     case TARGET_NR_readdir:
         goto unimplemented;
@@ -9527,22 +9496,20 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                                     arg5,
                                     arg6));
 #endif
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_mmap2
     case TARGET_NR_mmap2:
 #ifndef MMAP_SHIFT
 #define MMAP_SHIFT 12
 #endif
-        ret = get_errno(target_mmap(arg1, arg2, arg3,
-                                    target_to_host_bitmask(arg4, mmap_flags_tbl),
-                                    arg5,
-                                    arg6 << MMAP_SHIFT));
-        break;
+        ret = target_mmap(arg1, arg2, arg3,
+                          target_to_host_bitmask(arg4, mmap_flags_tbl),
+                          arg5, arg6 << MMAP_SHIFT);
+        return get_errno(ret);
 #endif
     case TARGET_NR_munmap:
-        ret = get_errno(target_munmap(arg1, arg2));
-        break;
+        return get_errno(target_munmap(arg1, arg2));
     case TARGET_NR_mprotect:
         {
             TaskState *ts = cpu->opaque;
@@ -9555,58 +9522,49 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 arg1 = ts->info->stack_limit;
             }
         }
-        ret = get_errno(target_mprotect(arg1, arg2, arg3));
-        break;
+        return get_errno(target_mprotect(arg1, arg2, arg3));
 #ifdef TARGET_NR_mremap
     case TARGET_NR_mremap:
-        ret = get_errno(target_mremap(arg1, arg2, arg3, arg4, arg5));
-        break;
+        return get_errno(target_mremap(arg1, arg2, arg3, arg4, arg5));
 #endif
         /* ??? msync/mlock/munlock are broken for softmmu.  */
 #ifdef TARGET_NR_msync
     case TARGET_NR_msync:
-        ret = get_errno(msync(g2h(arg1), arg2, arg3));
-        break;
+        return get_errno(msync(g2h(arg1), arg2, arg3));
 #endif
 #ifdef TARGET_NR_mlock
     case TARGET_NR_mlock:
-        ret = get_errno(mlock(g2h(arg1), arg2));
-        break;
+        return get_errno(mlock(g2h(arg1), arg2));
 #endif
 #ifdef TARGET_NR_munlock
     case TARGET_NR_munlock:
-        ret = get_errno(munlock(g2h(arg1), arg2));
-        break;
+        return get_errno(munlock(g2h(arg1), arg2));
 #endif
 #ifdef TARGET_NR_mlockall
     case TARGET_NR_mlockall:
-        ret = get_errno(mlockall(target_to_host_mlockall_arg(arg1)));
-        break;
+        return get_errno(mlockall(target_to_host_mlockall_arg(arg1)));
 #endif
 #ifdef TARGET_NR_munlockall
     case TARGET_NR_munlockall:
-        ret = get_errno(munlockall());
-        break;
+        return get_errno(munlockall());
 #endif
     case TARGET_NR_truncate:
         if (!(p = lock_user_string(arg1)))
             goto efault;
         ret = get_errno(truncate(p, arg2));
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
     case TARGET_NR_ftruncate:
-        ret = get_errno(ftruncate(arg1, arg2));
-        break;
+        return get_errno(ftruncate(arg1, arg2));
     case TARGET_NR_fchmod:
-        ret = get_errno(fchmod(arg1, arg2));
-        break;
+        return get_errno(fchmod(arg1, arg2));
 #if defined(TARGET_NR_fchmodat)
     case TARGET_NR_fchmodat:
         if (!(p = lock_user_string(arg2)))
             goto efault;
         ret = get_errno(fchmodat(arg1, p, arg3, 0));
         unlock_user(p, arg2, 0);
-        break;
+        return ret;
 #endif
     case TARGET_NR_getpriority:
         /* Note that negative values are valid for getpriority, so we must
@@ -9614,8 +9572,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         errno = 0;
         ret = getpriority(arg1, arg2);
         if (ret == -1 && errno != 0) {
-            ret = -host_to_target_errno(errno);
-            break;
+            return -host_to_target_errno(errno);
         }
 #ifdef TARGET_ALPHA
         /* Return value is the unbiased priority.  Signal no error.  */
@@ -9624,10 +9581,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         /* Return value is a biased priority to avoid negative numbers.  */
         ret = 20 - ret;
 #endif
-        break;
+        return ret;
     case TARGET_NR_setpriority:
-        ret = get_errno(setpriority(arg1, arg2, arg3));
-        break;
+        return get_errno(setpriority(arg1, arg2, arg3));
 #ifdef TARGET_NR_profil
     case TARGET_NR_profil:
         goto unimplemented;
@@ -9662,7 +9618,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             memset(target_stfs->f_spare, 0, sizeof(target_stfs->f_spare));
             unlock_user_struct(target_stfs, arg2, 1);
         }
-        break;
+        return ret;
     case TARGET_NR_fstatfs:
         ret = get_errno(fstatfs(arg1, &stfs));
         goto convert_statfs;
@@ -9692,7 +9648,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             memset(target_stfs->f_spare, 0, sizeof(target_stfs->f_spare));
             unlock_user_struct(target_stfs, arg3, 1);
         }
-        break;
+        return ret;
     case TARGET_NR_fstatfs64:
         ret = get_errno(fstatfs(arg1, &stfs));
         goto convert_statfs64;
@@ -9703,91 +9659,73 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #endif
 #ifdef TARGET_NR_socketcall
     case TARGET_NR_socketcall:
-        ret = do_socketcall(arg1, arg2);
-        break;
+        return do_socketcall(arg1, arg2);
 #endif
 #ifdef TARGET_NR_accept
     case TARGET_NR_accept:
-        ret = do_accept4(arg1, arg2, arg3, 0);
-        break;
+        return do_accept4(arg1, arg2, arg3, 0);
 #endif
 #ifdef TARGET_NR_accept4
     case TARGET_NR_accept4:
-        ret = do_accept4(arg1, arg2, arg3, arg4);
-        break;
+        return do_accept4(arg1, arg2, arg3, arg4);
 #endif
 #ifdef TARGET_NR_bind
     case TARGET_NR_bind:
-        ret = do_bind(arg1, arg2, arg3);
-        break;
+        return do_bind(arg1, arg2, arg3);
 #endif
 #ifdef TARGET_NR_connect
     case TARGET_NR_connect:
-        ret = do_connect(arg1, arg2, arg3);
-        break;
+        return do_connect(arg1, arg2, arg3);
 #endif
 #ifdef TARGET_NR_getpeername
     case TARGET_NR_getpeername:
-        ret = do_getpeername(arg1, arg2, arg3);
-        break;
+        return do_getpeername(arg1, arg2, arg3);
 #endif
 #ifdef TARGET_NR_getsockname
     case TARGET_NR_getsockname:
-        ret = do_getsockname(arg1, arg2, arg3);
-        break;
+        return do_getsockname(arg1, arg2, arg3);
 #endif
 #ifdef TARGET_NR_getsockopt
     case TARGET_NR_getsockopt:
-        ret = do_getsockopt(arg1, arg2, arg3, arg4, arg5);
-        break;
+        return do_getsockopt(arg1, arg2, arg3, arg4, arg5);
 #endif
 #ifdef TARGET_NR_listen
     case TARGET_NR_listen:
-        ret = get_errno(listen(arg1, arg2));
-        break;
+        return get_errno(listen(arg1, arg2));
 #endif
 #ifdef TARGET_NR_recv
     case TARGET_NR_recv:
-        ret = do_recvfrom(arg1, arg2, arg3, arg4, 0, 0);
-        break;
+        return do_recvfrom(arg1, arg2, arg3, arg4, 0, 0);
 #endif
 #ifdef TARGET_NR_recvfrom
     case TARGET_NR_recvfrom:
-        ret = do_recvfrom(arg1, arg2, arg3, arg4, arg5, arg6);
-        break;
+        return do_recvfrom(arg1, arg2, arg3, arg4, arg5, arg6);
 #endif
 #ifdef TARGET_NR_recvmsg
     case TARGET_NR_recvmsg:
-        ret = do_sendrecvmsg(arg1, arg2, arg3, 0);
-        break;
+        return do_sendrecvmsg(arg1, arg2, arg3, 0);
 #endif
 #ifdef TARGET_NR_send
     case TARGET_NR_send:
-        ret = do_sendto(arg1, arg2, arg3, arg4, 0, 0);
-        break;
+        return do_sendto(arg1, arg2, arg3, arg4, 0, 0);
 #endif
 #ifdef TARGET_NR_sendmsg
     case TARGET_NR_sendmsg:
-        ret = do_sendrecvmsg(arg1, arg2, arg3, 1);
-        break;
+        return do_sendrecvmsg(arg1, arg2, arg3, 1);
 #endif
 #ifdef TARGET_NR_sendmmsg
     case TARGET_NR_sendmmsg:
-        ret = do_sendrecvmmsg(arg1, arg2, arg3, arg4, 1);
-        break;
+        return do_sendrecvmmsg(arg1, arg2, arg3, arg4, 1);
     case TARGET_NR_recvmmsg:
-        ret = do_sendrecvmmsg(arg1, arg2, arg3, arg4, 0);
-        break;
+        return do_sendrecvmmsg(arg1, arg2, arg3, arg4, 0);
 #endif
 #ifdef TARGET_NR_sendto
     case TARGET_NR_sendto:
-        ret = do_sendto(arg1, arg2, arg3, arg4, arg5, arg6);
-        break;
+        return do_sendto(arg1, arg2, arg3, arg4, arg5, arg6);
 #endif
 #ifdef TARGET_NR_shutdown
     case TARGET_NR_shutdown:
-        ret = get_errno(shutdown(arg1, arg2));
-        break;
+        return get_errno(shutdown(arg1, arg2));
 #endif
 #if defined(TARGET_NR_getrandom) && defined(__NR_getrandom)
     case TARGET_NR_getrandom:
@@ -9797,22 +9735,19 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         }
         ret = get_errno(getrandom(p, arg2, arg3));
         unlock_user(p, arg1, ret);
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_socket
     case TARGET_NR_socket:
-        ret = do_socket(arg1, arg2, arg3);
-        break;
+        return do_socket(arg1, arg2, arg3);
 #endif
 #ifdef TARGET_NR_socketpair
     case TARGET_NR_socketpair:
-        ret = do_socketpair(arg1, arg2, arg3, arg4);
-        break;
+        return do_socketpair(arg1, arg2, arg3, arg4);
 #endif
 #ifdef TARGET_NR_setsockopt
     case TARGET_NR_setsockopt:
-        ret = do_setsockopt(arg1, arg2, arg3, arg4, (socklen_t) arg5);
-        break;
+        return do_setsockopt(arg1, arg2, arg3, arg4, (socklen_t) arg5);
 #endif
 #if defined(TARGET_NR_syslog)
     case TARGET_NR_syslog:
@@ -9828,10 +9763,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             case TARGET_SYSLOG_ACTION_CONSOLE_LEVEL: /* Set messages level */
             case TARGET_SYSLOG_ACTION_SIZE_UNREAD:   /* Number of chars */
             case TARGET_SYSLOG_ACTION_SIZE_BUFFER:   /* Size of the buffer */
-                {
-                    ret = get_errno(sys_syslog((int)arg1, NULL, (int)arg3));
-                }
-                break;
+                return get_errno(sys_syslog((int)arg1, NULL, (int)arg3));
             case TARGET_SYSLOG_ACTION_READ:          /* Read from log */
             case TARGET_SYSLOG_ACTION_READ_CLEAR:    /* Read/clear msgs */
             case TARGET_SYSLOG_ACTION_READ_ALL:      /* Read last messages */
@@ -9840,9 +9772,8 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     if (len < 0) {
                         goto fail;
                     }
-                    ret = 0;
                     if (len == 0) {
-                        break;
+                        return 0;
                     }
                     p = lock_user(VERIFY_WRITE, arg2, arg3, 0);
                     if (!p) {
@@ -9852,10 +9783,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     ret = get_errno(sys_syslog((int)arg1, p, (int)arg3));
                     unlock_user(p, arg2, arg3);
                 }
-                break;
+                return ret;
             default:
-                ret = -EINVAL;
-                break;
+                return -TARGET_EINVAL;
             }
         }
         break;
@@ -9882,7 +9812,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     goto efault;
             }
         }
-        break;
+        return ret;
     case TARGET_NR_getitimer:
         {
             struct itimerval value;
@@ -9896,7 +9826,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     goto efault;
             }
         }
-        break;
+        return ret;
 #ifdef TARGET_NR_stat
     case TARGET_NR_stat:
         if (!(p = lock_user_string(arg1)))
@@ -9941,7 +9871,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 unlock_user_struct(target_st, arg2, 1);
             }
         }
-        break;
+        return ret;
 #ifdef TARGET_NR_olduname
     case TARGET_NR_olduname:
         goto unimplemented;
@@ -9951,17 +9881,15 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         goto unimplemented;
 #endif
     case TARGET_NR_vhangup:
-        ret = get_errno(vhangup());
-        break;
+        return get_errno(vhangup());
 #ifdef TARGET_NR_idle
     case TARGET_NR_idle:
         goto unimplemented;
 #endif
 #ifdef TARGET_NR_syscall
     case TARGET_NR_syscall:
-        ret = do_syscall(cpu_env, arg1 & 0xffff, arg2, arg3, arg4, arg5,
-                         arg6, arg7, arg8, 0);
-        break;
+        return do_syscall(cpu_env, arg1 & 0xffff, arg2, arg3, arg4, arg5,
+                          arg6, arg7, arg8, 0);
 #endif
     case TARGET_NR_wait4:
         {
@@ -9989,14 +9917,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 }
             }
         }
-        break;
+        return ret;
 #ifdef TARGET_NR_swapoff
     case TARGET_NR_swapoff:
         if (!(p = lock_user_string(arg1)))
             goto efault;
         ret = get_errno(swapoff(p));
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
 #endif
     case TARGET_NR_sysinfo:
         {
@@ -10024,70 +9952,57 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 unlock_user_struct(target_value, arg1, 1);
             }
         }
-        break;
+        return ret;
 #ifdef TARGET_NR_ipc
     case TARGET_NR_ipc:
-        ret = do_ipc(cpu_env, arg1, arg2, arg3, arg4, arg5, arg6);
-        break;
+        return do_ipc(cpu_env, arg1, arg2, arg3, arg4, arg5, arg6);
 #endif
 #ifdef TARGET_NR_semget
     case TARGET_NR_semget:
-        ret = get_errno(semget(arg1, arg2, arg3));
-        break;
+        return get_errno(semget(arg1, arg2, arg3));
 #endif
 #ifdef TARGET_NR_semop
     case TARGET_NR_semop:
-        ret = do_semop(arg1, arg2, arg3);
-        break;
+        return do_semop(arg1, arg2, arg3);
 #endif
 #ifdef TARGET_NR_semctl
     case TARGET_NR_semctl:
-        ret = do_semctl(arg1, arg2, arg3, arg4);
-        break;
+        return do_semctl(arg1, arg2, arg3, arg4);
 #endif
 #ifdef TARGET_NR_msgctl
     case TARGET_NR_msgctl:
-        ret = do_msgctl(arg1, arg2, arg3);
-        break;
+        return do_msgctl(arg1, arg2, arg3);
 #endif
 #ifdef TARGET_NR_msgget
     case TARGET_NR_msgget:
-        ret = get_errno(msgget(arg1, arg2));
-        break;
+        return get_errno(msgget(arg1, arg2));
 #endif
 #ifdef TARGET_NR_msgrcv
     case TARGET_NR_msgrcv:
-        ret = do_msgrcv(arg1, arg2, arg3, arg4, arg5);
-        break;
+        return do_msgrcv(arg1, arg2, arg3, arg4, arg5);
 #endif
 #ifdef TARGET_NR_msgsnd
     case TARGET_NR_msgsnd:
-        ret = do_msgsnd(arg1, arg2, arg3, arg4);
-        break;
+        return do_msgsnd(arg1, arg2, arg3, arg4);
 #endif
 #ifdef TARGET_NR_shmget
     case TARGET_NR_shmget:
-        ret = get_errno(shmget(arg1, arg2, arg3));
-        break;
+        return get_errno(shmget(arg1, arg2, arg3));
 #endif
 #ifdef TARGET_NR_shmctl
     case TARGET_NR_shmctl:
-        ret = do_shmctl(arg1, arg2, arg3);
-        break;
+        return do_shmctl(arg1, arg2, arg3);
 #endif
 #ifdef TARGET_NR_shmat
     case TARGET_NR_shmat:
-        ret = do_shmat(cpu_env, arg1, arg2, arg3);
-        break;
+        return do_shmat(cpu_env, arg1, arg2, arg3);
 #endif
 #ifdef TARGET_NR_shmdt
     case TARGET_NR_shmdt:
-        ret = do_shmdt(arg1);
-        break;
+        return do_shmdt(arg1);
 #endif
     case TARGET_NR_fsync:
-        ret = get_errno(fsync(arg1));
-        break;
+        return get_errno(fsync(arg1));
     case TARGET_NR_clone:
         /* Linux manages to have three different orderings for its
          * arguments to clone(); the BACKWARDS and BACKWARDS2 defines
@@ -10104,7 +10019,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #else
         ret = get_errno(do_fork(cpu_env, arg1, arg2, arg3, arg5, arg4));
 #endif
-        break;
+        return ret;
 #ifdef __NR_exit_group
         /* new thread calls */
     case TARGET_NR_exit_group:
@@ -10112,15 +10027,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         _mcleanup();
 #endif
         gdb_exit(cpu_env, arg1);
-        ret = get_errno(exit_group(arg1));
-        break;
+        return get_errno(exit_group(arg1));
 #endif
     case TARGET_NR_setdomainname:
         if (!(p = lock_user_string(arg1)))
             goto efault;
         ret = get_errno(setdomainname(p, arg2));
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
     case TARGET_NR_uname:
         /* no need to transcode because we use the linux syscall */
         {
@@ -10142,17 +10056,15 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
             unlock_user_struct(buf, arg1, 1);
         }
-        break;
+        return ret;
 #ifdef TARGET_I386
     case TARGET_NR_modify_ldt:
-        ret = do_modify_ldt(cpu_env, arg1, arg2, arg3);
-        break;
+        return do_modify_ldt(cpu_env, arg1, arg2, arg3);
 #if !defined(TARGET_X86_64)
     case TARGET_NR_vm86old:
         goto unimplemented;
     case TARGET_NR_vm86:
-        ret = do_vm86(cpu_env, arg1, arg2);
-        break;
+        return do_vm86(cpu_env, arg1, arg2);
 #endif
 #endif
     case TARGET_NR_adjtimex:
@@ -10169,7 +10081,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 }
             }
         }
-        break;
+        return ret;
 #if defined(TARGET_NR_clock_adjtime) && defined(CONFIG_CLOCK_ADJTIME)
     case TARGET_NR_clock_adjtime:
         {
@@ -10185,7 +10097,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 }
             }
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_create_module
     case TARGET_NR_create_module:
@@ -10199,11 +10111,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_quotactl:
         goto unimplemented;
     case TARGET_NR_getpgid:
-        ret = get_errno(getpgid(arg1));
-        break;
+        return get_errno(getpgid(arg1));
     case TARGET_NR_fchdir:
-        ret = get_errno(fchdir(arg1));
-        break;
+        return get_errno(fchdir(arg1));
 #ifdef TARGET_NR_bdflush /* not on x86_64 */
     case TARGET_NR_bdflush:
         goto unimplemented;
@@ -10213,8 +10123,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         goto unimplemented;
 #endif
     case TARGET_NR_personality:
-        ret = get_errno(personality(arg1));
-        break;
+        return get_errno(personality(arg1));
 #ifdef TARGET_NR_afs_syscall
     case TARGET_NR_afs_syscall:
         goto unimplemented;
@@ -10237,7 +10146,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 goto efault;
             }
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_getdents
     case TARGET_NR_getdents:
@@ -10369,7 +10278,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(dirp, arg2, ret);
         }
 #endif
-        break;
+        return ret;
 #endif /* TARGET_NR_getdents */
 #if defined(TARGET_NR_getdents64) && defined(__NR_getdents64)
     case TARGET_NR_getdents64:
@@ -10397,12 +10306,11 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
             unlock_user(dirp, arg2, ret);
         }
-        break;
+        return ret;
 #endif /* TARGET_NR_getdents64 */
 #if defined(TARGET_NR__newselect)
     case TARGET_NR__newselect:
-        ret = do_select(arg1, arg2, arg3, arg4, arg5);
-        break;
+        return do_select(arg1, arg2, arg3, arg4, arg5);
 #endif
 #if defined(TARGET_NR_poll) || defined(TARGET_NR_ppoll)
 # ifdef TARGET_NR_poll
@@ -10421,8 +10329,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             target_pfd = NULL;
             if (nfds) {
                 if (nfds > (INT_MAX / sizeof(struct target_pollfd))) {
-                    ret = -TARGET_EINVAL;
-                    break;
+                    return -TARGET_EINVAL;
                 }
 
                 target_pfd = lock_user(VERIFY_WRITE, arg1,
@@ -10458,8 +10365,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 if (arg4) {
                     if (arg5 != sizeof(target_sigset_t)) {
                         unlock_user(target_pfd, arg1, 0);
-                        ret = -TARGET_EINVAL;
-                        break;
+                        return -TARGET_EINVAL;
                     }
 
                     target_set = lock_user(VERIFY_READ, arg4, sizeof(target_sigset_t), 1);
@@ -10481,7 +10387,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 if (arg4) {
                     unlock_user(target_set, arg4, 0);
                 }
-                break;
+                return ret;
             }
 # endif
 # ifdef TARGET_NR_poll
@@ -10498,8 +10404,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     /* -ve poll() timeout means "infinite" */
                     pts = NULL;
                 }
-                ret = get_errno(safe_ppoll(pfd, nfds, pts, NULL, 0));
-                break;
+                return get_errno(safe_ppoll(pfd, nfds, pts, NULL, 0));
             }
 # endif
             default:
@@ -10513,13 +10418,12 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
             unlock_user(target_pfd, arg1, sizeof(struct target_pollfd) * nfds);
         }
-        break;
+        return ret;
 #endif
     case TARGET_NR_flock:
         /* NOTE: the flock constant seems to be the same for every
            Linux platform */
-        ret = get_errno(safe_flock(arg1, arg2));
-        break;
+        return get_errno(safe_flock(arg1, arg2));
     case TARGET_NR_readv:
         {
             struct iovec *vec = lock_iovec(VERIFY_WRITE, arg2, arg3, 0);
@@ -10530,7 +10434,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 ret = -host_to_target_errno(errno);
             }
         }
-        break;
+        return ret;
     case TARGET_NR_writev:
         {
             struct iovec *vec = lock_iovec(VERIFY_READ, arg2, arg3, 1);
@@ -10541,7 +10445,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 ret = -host_to_target_errno(errno);
             }
         }
-        break;
+        return ret;
 #if defined(TARGET_NR_preadv)
     case TARGET_NR_preadv:
         {
@@ -10556,7 +10460,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 ret = -host_to_target_errno(errno);
            }
         }
-        break;
+        return ret;
 #endif
 #if defined(TARGET_NR_pwritev)
     case TARGET_NR_pwritev:
@@ -10572,22 +10476,19 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 ret = -host_to_target_errno(errno);
            }
         }
-        break;
+        return ret;
 #endif
     case TARGET_NR_getsid:
-        ret = get_errno(getsid(arg1));
-        break;
+        return get_errno(getsid(arg1));
 #if defined(TARGET_NR_fdatasync) /* Not on alpha (osf_datasync ?) */
     case TARGET_NR_fdatasync:
-        ret = get_errno(fdatasync(arg1));
-        break;
+        return get_errno(fdatasync(arg1));
 #endif
 #ifdef TARGET_NR__sysctl
     case TARGET_NR__sysctl:
         /* We don't implement this, but ENOTDIR is always a safe
            return value. */
-        ret = -TARGET_ENOTDIR;
-        break;
+        return -TARGET_ENOTDIR;
 #endif
     case TARGET_NR_sched_getaffinity:
         {
@@ -10599,8 +10500,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
              * care of mismatches between target ulong and host ulong sizes.
              */
             if (arg2 & (sizeof(abi_ulong) - 1)) {
-                ret = -TARGET_EINVAL;
-                break;
+                return -TARGET_EINVAL;
             }
             mask_size = (arg2 + (sizeof(*mask) - 1)) & ~(sizeof(*mask) - 1);
 
@@ -10619,8 +10519,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                      */
                     int numcpus = sysconf(_SC_NPROCESSORS_CONF);
                     if (numcpus > arg2 * 8) {
-                        ret = -TARGET_EINVAL;
-                        break;
+                        return -TARGET_EINVAL;
                     }
                     ret = arg2;
                 }
@@ -10630,7 +10529,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 }
             }
         }
-        break;
+        return ret;
     case TARGET_NR_sched_setaffinity:
         {
             unsigned int mask_size;
@@ -10641,20 +10540,18 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
              * care of mismatches between target ulong and host ulong sizes.
              */
             if (arg2 & (sizeof(abi_ulong) - 1)) {
-                ret = -TARGET_EINVAL;
-                break;
+                return -TARGET_EINVAL;
             }
             mask_size = (arg2 + (sizeof(*mask) - 1)) & ~(sizeof(*mask) - 1);
             mask = alloca(mask_size);
 
             ret = target_to_host_cpu_mask(mask, mask_size, arg3, arg2);
             if (ret) {
-                break;
+                return ret;
             }
 
-            ret = get_errno(sys_sched_setaffinity(arg1, mask_size, mask));
+            return get_errno(sys_sched_setaffinity(arg1, mask_size, mask));
         }
-        break;
     case TARGET_NR_getcpu:
         {
             unsigned cpu, node;
@@ -10671,7 +10568,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 goto efault;
             }
         }
-        break;
+        return ret;
     case TARGET_NR_sched_setparam:
         {
             struct sched_param *target_schp;
@@ -10684,9 +10581,8 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 goto efault;
             schp.sched_priority = tswap32(target_schp->sched_priority);
             unlock_user_struct(target_schp, arg2, 0);
-            ret = get_errno(sched_setparam(arg1, &schp));
+            return get_errno(sched_setparam(arg1, &schp));
         }
-        break;
     case TARGET_NR_sched_getparam:
         {
             struct sched_param *target_schp;
@@ -10703,7 +10599,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 unlock_user_struct(target_schp, arg2, 1);
             }
         }
-        break;
+        return ret;
     case TARGET_NR_sched_setscheduler:
         {
             struct sched_param *target_schp;
@@ -10715,21 +10611,16 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 goto efault;
             schp.sched_priority = tswap32(target_schp->sched_priority);
             unlock_user_struct(target_schp, arg3, 0);
-            ret = get_errno(sched_setscheduler(arg1, arg2, &schp));
+            return get_errno(sched_setscheduler(arg1, arg2, &schp));
         }
-        break;
     case TARGET_NR_sched_getscheduler:
-        ret = get_errno(sched_getscheduler(arg1));
-        break;
+        return get_errno(sched_getscheduler(arg1));
     case TARGET_NR_sched_yield:
-        ret = get_errno(sched_yield());
-        break;
+        return get_errno(sched_yield());
     case TARGET_NR_sched_get_priority_max:
-        ret = get_errno(sched_get_priority_max(arg1));
-        break;
+        return get_errno(sched_get_priority_max(arg1));
     case TARGET_NR_sched_get_priority_min:
-        ret = get_errno(sched_get_priority_min(arg1));
-        break;
+        return get_errno(sched_get_priority_min(arg1));
     case TARGET_NR_sched_rr_get_interval:
         {
             struct timespec ts;
@@ -10738,7 +10629,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 ret = host_to_target_timespec(arg2, &ts);
             }
         }
-        break;
+        return ret;
     case TARGET_NR_nanosleep:
         {
             struct timespec req, rem;
@@ -10748,7 +10639,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 host_to_target_timespec(arg2, &rem);
             }
         }
-        break;
+        return ret;
 #ifdef TARGET_NR_query_module
     case TARGET_NR_query_module:
         goto unimplemented;
@@ -10767,7 +10658,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 && put_user_ual(deathsig, arg2)) {
                 goto efault;
             }
-            break;
+            return ret;
         }
 #ifdef PR_GET_NAME
         case PR_GET_NAME:
@@ -10779,7 +10670,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(prctl(arg1, (unsigned long)name,
                                   arg3, arg4, arg5));
             unlock_user(name, arg2, 16);
-            break;
+            return ret;
         }
         case PR_SET_NAME:
         {
@@ -10790,7 +10681,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(prctl(arg1, (unsigned long)name,
                                   arg3, arg4, arg5));
             unlock_user(name, arg2, 0);
-            break;
+            return ret;
         }
 #endif
 #ifdef TARGET_AARCH64
@@ -10811,32 +10702,29 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 env->vfp.zcr_el[1] = vq - 1;
                 ret = vq * 16;
             }
-            break;
+            return ret;
         case TARGET_PR_SVE_GET_VL:
             ret = -TARGET_EINVAL;
             if (arm_feature(cpu_env, ARM_FEATURE_SVE)) {
                 CPUARMState *env = cpu_env;
                 ret = ((env->vfp.zcr_el[1] & 0xf) + 1) * 16;
             }
-            break;
+            return ret;
 #endif /* AARCH64 */
         case PR_GET_SECCOMP:
         case PR_SET_SECCOMP:
             /* Disable seccomp to prevent the target disabling syscalls we
              * need. */
-            ret = -TARGET_EINVAL;
-            break;
+            return -TARGET_EINVAL;
         default:
             /* Most prctl options have no pointer arguments */
-            ret = get_errno(prctl(arg1, arg2, arg3, arg4, arg5));
-            break;
+            return get_errno(prctl(arg1, arg2, arg3, arg4, arg5));
         }
         break;
 #ifdef TARGET_NR_arch_prctl
     case TARGET_NR_arch_prctl:
 #if defined(TARGET_I386) && !defined(TARGET_ABI32)
-        ret = do_arch_prctl(cpu_env, arg1, arg2);
-        break;
+        return do_arch_prctl(cpu_env, arg1, arg2);
 #else
         goto unimplemented;
 #endif
@@ -10851,7 +10739,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             goto efault;
         ret = get_errno(pread64(arg1, p, arg3, target_offset64(arg4, arg5)));
         unlock_user(p, arg2, ret);
-        break;
+        return ret;
     case TARGET_NR_pwrite64:
         if (regpairs_aligned(cpu_env, num)) {
             arg4 = arg5;
@@ -10861,14 +10749,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             goto efault;
         ret = get_errno(pwrite64(arg1, p, arg3, target_offset64(arg4, arg5)));
         unlock_user(p, arg2, 0);
-        break;
+        return ret;
 #endif
     case TARGET_NR_getcwd:
         if (!(p = lock_user(VERIFY_WRITE, arg1, arg2, 0)))
             goto efault;
         ret = get_errno(sys_getcwd1(p, arg2));
         unlock_user(p, arg1, ret);
-        break;
+        return ret;
     case TARGET_NR_capget:
     case TARGET_NR_capset:
     {
@@ -10937,11 +10825,11 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 unlock_user(target_data, arg2, 0);
             }
         }
-        break;
+        return ret;
     }
     case TARGET_NR_sigaltstack:
-        ret = do_sigaltstack(arg1, arg2, get_sp_from_cpustate((CPUArchState *)cpu_env));
-        break;
+        return do_sigaltstack(arg1, arg2,
+                              get_sp_from_cpustate((CPUArchState *)cpu_env));
 
 #ifdef CONFIG_SENDFILE
     case TARGET_NR_sendfile:
@@ -10951,7 +10839,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         if (arg3) {
             ret = get_user_sal(off, arg3);
             if (is_error(ret)) {
-                break;
+                return ret;
             }
             offp = &off;
         }
@@ -10962,7 +10850,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 ret = ret2;
             }
         }
-        break;
+        return ret;
     }
 #ifdef TARGET_NR_sendfile64
     case TARGET_NR_sendfile64:
@@ -10972,7 +10860,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         if (arg3) {
             ret = get_user_s64(off, arg3);
             if (is_error(ret)) {
-                break;
+                return ret;
             }
             offp = &off;
         }
@@ -10983,7 +10871,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 ret = ret2;
             }
         }
-        break;
+        return ret;
     }
 #endif
 #else
@@ -11004,10 +10892,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #endif
 #ifdef TARGET_NR_vfork
     case TARGET_NR_vfork:
-        ret = get_errno(do_fork(cpu_env,
-                        CLONE_VFORK | CLONE_VM | TARGET_SIGCHLD,
-                        0, 0, 0, 0));
-        break;
+        return get_errno(do_fork(cpu_env,
+                         CLONE_VFORK | CLONE_VM | TARGET_SIGCHLD,
+                         0, 0, 0, 0));
 #endif
 #ifdef TARGET_NR_ugetrlimit
     case TARGET_NR_ugetrlimit:
@@ -11023,7 +10910,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 	    target_rlim->rlim_max = host_to_target_rlim(rlim.rlim_max);
             unlock_user_struct(target_rlim, arg2, 1);
 	}
-	break;
+        return ret;
     }
 #endif
 #ifdef TARGET_NR_truncate64
@@ -11032,12 +10919,11 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             goto efault;
 	ret = target_truncate64(cpu_env, p, arg2, arg3, arg4);
         unlock_user(p, arg1, 0);
-	break;
+        return ret;
 #endif
 #ifdef TARGET_NR_ftruncate64
     case TARGET_NR_ftruncate64:
-	ret = target_ftruncate64(cpu_env, arg1, arg2, arg3, arg4);
-	break;
+        return target_ftruncate64(cpu_env, arg1, arg2, arg3, arg4);
 #endif
 #ifdef TARGET_NR_stat64
     case TARGET_NR_stat64:
@@ -11047,7 +10933,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         unlock_user(p, arg1, 0);
         if (!is_error(ret))
             ret = host_to_target_stat64(cpu_env, arg2, &st);
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_lstat64
     case TARGET_NR_lstat64:
@@ -11057,14 +10943,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         unlock_user(p, arg1, 0);
         if (!is_error(ret))
             ret = host_to_target_stat64(cpu_env, arg2, &st);
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_fstat64
     case TARGET_NR_fstat64:
         ret = get_errno(fstat(arg1, &st));
         if (!is_error(ret))
             ret = host_to_target_stat64(cpu_env, arg2, &st);
-        break;
+        return ret;
 #endif
 #if (defined(TARGET_NR_fstatat64) || defined(TARGET_NR_newfstatat))
 #ifdef TARGET_NR_fstatat64
@@ -11078,7 +10964,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         ret = get_errno(fstatat(arg1, path(p), &st, arg4));
         if (!is_error(ret))
             ret = host_to_target_stat64(cpu_env, arg3, &st);
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_lchown
     case TARGET_NR_lchown:
@@ -11086,34 +10972,28 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             goto efault;
         ret = get_errno(lchown(p, low2highuid(arg2), low2highgid(arg3)));
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_getuid
     case TARGET_NR_getuid:
-        ret = get_errno(high2lowuid(getuid()));
-        break;
+        return get_errno(high2lowuid(getuid()));
 #endif
 #ifdef TARGET_NR_getgid
     case TARGET_NR_getgid:
-        ret = get_errno(high2lowgid(getgid()));
-        break;
+        return get_errno(high2lowgid(getgid()));
 #endif
 #ifdef TARGET_NR_geteuid
     case TARGET_NR_geteuid:
-        ret = get_errno(high2lowuid(geteuid()));
-        break;
+        return get_errno(high2lowuid(geteuid()));
 #endif
 #ifdef TARGET_NR_getegid
     case TARGET_NR_getegid:
-        ret = get_errno(high2lowgid(getegid()));
-        break;
+        return get_errno(high2lowgid(getegid()));
 #endif
     case TARGET_NR_setreuid:
-        ret = get_errno(setreuid(low2highuid(arg1), low2highuid(arg2)));
-        break;
+        return get_errno(setreuid(low2highuid(arg1), low2highuid(arg2)));
     case TARGET_NR_setregid:
-        ret = get_errno(setregid(low2highgid(arg1), low2highgid(arg2)));
-        break;
+        return get_errno(setregid(low2highgid(arg1), low2highgid(arg2)));
     case TARGET_NR_getgroups:
         {
             int gidsetsize = arg1;
@@ -11124,7 +11004,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             grouplist = alloca(gidsetsize * sizeof(gid_t));
             ret = get_errno(getgroups(gidsetsize, grouplist));
             if (gidsetsize == 0)
-                break;
+                return ret;
             if (!is_error(ret)) {
                 target_grouplist = lock_user(VERIFY_WRITE, arg2, gidsetsize * sizeof(target_id), 0);
                 if (!target_grouplist)
@@ -11134,7 +11014,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 unlock_user(target_grouplist, arg2, gidsetsize * sizeof(target_id));
             }
         }
-        break;
+        return ret;
     case TARGET_NR_setgroups:
         {
             int gidsetsize = arg1;
@@ -11153,12 +11033,10 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 }
                 unlock_user(target_grouplist, arg2, 0);
             }
-            ret = get_errno(setgroups(gidsetsize, grouplist));
+            return get_errno(setgroups(gidsetsize, grouplist));
         }
-        break;
     case TARGET_NR_fchown:
-        ret = get_errno(fchown(arg1, low2highuid(arg2), low2highgid(arg3)));
-        break;
+        return get_errno(fchown(arg1, low2highuid(arg2), low2highgid(arg3)));
 #if defined(TARGET_NR_fchownat)
     case TARGET_NR_fchownat:
         if (!(p = lock_user_string(arg2))) 
@@ -11166,14 +11044,13 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         ret = get_errno(fchownat(arg1, p, low2highuid(arg3),
                                  low2highgid(arg4), arg5));
         unlock_user(p, arg2, 0);
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_setresuid
     case TARGET_NR_setresuid:
-        ret = get_errno(sys_setresuid(low2highuid(arg1),
-                                      low2highuid(arg2),
-                                      low2highuid(arg3)));
-        break;
+        return get_errno(sys_setresuid(low2highuid(arg1),
+                                       low2highuid(arg2),
+                                       low2highuid(arg3)));
 #endif
 #ifdef TARGET_NR_getresuid
     case TARGET_NR_getresuid:
@@ -11187,14 +11064,13 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     goto efault;
             }
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_getresgid
     case TARGET_NR_setresgid:
-        ret = get_errno(sys_setresgid(low2highgid(arg1),
-                                      low2highgid(arg2),
-                                      low2highgid(arg3)));
-        break;
+        return get_errno(sys_setresgid(low2highgid(arg1),
+                                       low2highgid(arg2),
+                                       low2highgid(arg3)));
 #endif
 #ifdef TARGET_NR_getresgid
     case TARGET_NR_getresgid:
@@ -11208,7 +11084,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     goto efault;
             }
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_chown
     case TARGET_NR_chown:
@@ -11216,20 +11092,16 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             goto efault;
         ret = get_errno(chown(p, low2highuid(arg2), low2highgid(arg3)));
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
 #endif
     case TARGET_NR_setuid:
-        ret = get_errno(sys_setuid(low2highuid(arg1)));
-        break;
+        return get_errno(sys_setuid(low2highuid(arg1)));
     case TARGET_NR_setgid:
-        ret = get_errno(sys_setgid(low2highgid(arg1)));
-        break;
+        return get_errno(sys_setgid(low2highgid(arg1)));
     case TARGET_NR_setfsuid:
-        ret = get_errno(setfsuid(arg1));
-        break;
+        return get_errno(setfsuid(arg1));
     case TARGET_NR_setfsgid:
-        ret = get_errno(setfsgid(arg1));
-        break;
+        return get_errno(setfsgid(arg1));
 
 #ifdef TARGET_NR_lchown32
     case TARGET_NR_lchown32:
@@ -11237,12 +11109,11 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             goto efault;
         ret = get_errno(lchown(p, arg2, arg3));
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_getuid32
     case TARGET_NR_getuid32:
-        ret = get_errno(getuid());
-        break;
+        return get_errno(getuid());
 #endif
 
 #if defined(TARGET_NR_getxuid) && defined(TARGET_ALPHA)
@@ -11253,8 +11124,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             euid=geteuid();
             ((CPUAlphaState *)cpu_env)->ir[IR_A4]=euid;
          }
-        ret = get_errno(getuid());
-        break;
+        return get_errno(getuid());
 #endif
 #if defined(TARGET_NR_getxgid) && defined(TARGET_ALPHA)
    /* Alpha specific */
@@ -11264,8 +11134,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             egid=getegid();
             ((CPUAlphaState *)cpu_env)->ir[IR_A4]=egid;
          }
-        ret = get_errno(getgid());
-        break;
+        return get_errno(getgid());
 #endif
 #if defined(TARGET_NR_osf_getsysinfo) && defined(TARGET_ALPHA)
     /* Alpha specific */
@@ -11303,7 +11172,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
              -- Grabs a copy of the HWRPB; surely not used.
           */
         }
-        break;
+        return ret;
 #endif
 #if defined(TARGET_NR_osf_setsysinfo) && defined(TARGET_ALPHA)
     /* Alpha specific */
@@ -11394,7 +11263,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
              -- Not implemented in linux kernel
           */
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_osf_sigprocmask
     /* Alpha specific.  */
@@ -11426,33 +11295,28 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 ret = mask;
             }
         }
-        break;
+        return ret;
 #endif
 
 #ifdef TARGET_NR_getgid32
     case TARGET_NR_getgid32:
-        ret = get_errno(getgid());
-        break;
+        return get_errno(getgid());
 #endif
 #ifdef TARGET_NR_geteuid32
     case TARGET_NR_geteuid32:
-        ret = get_errno(geteuid());
-        break;
+        return get_errno(geteuid());
 #endif
 #ifdef TARGET_NR_getegid32
     case TARGET_NR_getegid32:
-        ret = get_errno(getegid());
-        break;
+        return get_errno(getegid());
 #endif
 #ifdef TARGET_NR_setreuid32
     case TARGET_NR_setreuid32:
-        ret = get_errno(setreuid(arg1, arg2));
-        break;
+        return get_errno(setreuid(arg1, arg2));
 #endif
 #ifdef TARGET_NR_setregid32
     case TARGET_NR_setregid32:
-        ret = get_errno(setregid(arg1, arg2));
-        break;
+        return get_errno(setregid(arg1, arg2));
 #endif
 #ifdef TARGET_NR_getgroups32
     case TARGET_NR_getgroups32:
@@ -11465,7 +11329,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             grouplist = alloca(gidsetsize * sizeof(gid_t));
             ret = get_errno(getgroups(gidsetsize, grouplist));
             if (gidsetsize == 0)
-                break;
+                return ret;
             if (!is_error(ret)) {
                 target_grouplist = lock_user(VERIFY_WRITE, arg2, gidsetsize * 4, 0);
                 if (!target_grouplist) {
@@ -11477,7 +11341,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 unlock_user(target_grouplist, arg2, gidsetsize * 4);
             }
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_setgroups32
     case TARGET_NR_setgroups32:
@@ -11496,19 +11360,16 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             for(i = 0;i < gidsetsize; i++)
                 grouplist[i] = tswap32(target_grouplist[i]);
             unlock_user(target_grouplist, arg2, 0);
-            ret = get_errno(setgroups(gidsetsize, grouplist));
+            return get_errno(setgroups(gidsetsize, grouplist));
         }
-        break;
 #endif
 #ifdef TARGET_NR_fchown32
     case TARGET_NR_fchown32:
-        ret = get_errno(fchown(arg1, arg2, arg3));
-        break;
+        return get_errno(fchown(arg1, arg2, arg3));
 #endif
 #ifdef TARGET_NR_setresuid32
     case TARGET_NR_setresuid32:
-        ret = get_errno(sys_setresuid(arg1, arg2, arg3));
-        break;
+        return get_errno(sys_setresuid(arg1, arg2, arg3));
 #endif
 #ifdef TARGET_NR_getresuid32
     case TARGET_NR_getresuid32:
@@ -11522,12 +11383,11 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     goto efault;
             }
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_setresgid32
     case TARGET_NR_setresgid32:
-        ret = get_errno(sys_setresgid(arg1, arg2, arg3));
-        break;
+        return get_errno(sys_setresgid(arg1, arg2, arg3));
 #endif
 #ifdef TARGET_NR_getresgid32
     case TARGET_NR_getresgid32:
@@ -11541,7 +11401,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     goto efault;
             }
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_chown32
     case TARGET_NR_chown32:
@@ -11549,27 +11409,23 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             goto efault;
         ret = get_errno(chown(p, arg2, arg3));
         unlock_user(p, arg1, 0);
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_setuid32
     case TARGET_NR_setuid32:
-        ret = get_errno(sys_setuid(arg1));
-        break;
+        return get_errno(sys_setuid(arg1));
 #endif
 #ifdef TARGET_NR_setgid32
     case TARGET_NR_setgid32:
-        ret = get_errno(sys_setgid(arg1));
-        break;
+        return get_errno(sys_setgid(arg1));
 #endif
 #ifdef TARGET_NR_setfsuid32
     case TARGET_NR_setfsuid32:
-        ret = get_errno(setfsuid(arg1));
-        break;
+        return get_errno(setfsuid(arg1));
 #endif
 #ifdef TARGET_NR_setfsgid32
     case TARGET_NR_setfsgid32:
-        ret = get_errno(setfsgid(arg1));
-        break;
+        return get_errno(setfsgid(arg1));
 #endif
 
     case TARGET_NR_pivot_root:
@@ -11593,7 +11449,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             mincore_fail:
             unlock_user(a, arg1, 0);
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_arm_fadvise64_64
     case TARGET_NR_arm_fadvise64_64:
@@ -11605,8 +11461,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
          */
         ret = posix_fadvise(arg1, target_offset64(arg3, arg4),
                             target_offset64(arg5, arg6), arg2);
-        ret = -host_to_target_errno(ret);
-        break;
+        return -host_to_target_errno(ret);
 #endif
 
 #if TARGET_ABI_BITS == 32
@@ -11632,11 +11487,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             arg6 = arg7;
         }
 #endif
-        ret = -host_to_target_errno(posix_fadvise(arg1,
-                                                  target_offset64(arg2, arg3),
-                                                  target_offset64(arg4, arg5),
-                                                  arg6));
-        break;
+        ret = posix_fadvise(arg1, target_offset64(arg2, arg3),
+                            target_offset64(arg4, arg5), arg6);
+        return -host_to_target_errno(ret);
 #endif
 
 #ifdef TARGET_NR_fadvise64
@@ -11649,10 +11502,8 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             arg4 = arg5;
             arg5 = arg6;
         }
-        ret = -host_to_target_errno(posix_fadvise(arg1,
-                                                  target_offset64(arg2, arg3),
-                                                  arg4, arg5));
-        break;
+        ret = posix_fadvise(arg1, target_offset64(arg2, arg3), arg4, arg5);
+        return -host_to_target_errno(ret);
 #endif
 
 #else /* not a 32-bit ABI */
@@ -11672,8 +11523,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         default: break;
         }
 #endif
-        ret = -host_to_target_errno(posix_fadvise(arg1, arg2, arg3, arg4));
-        break;
+        return -host_to_target_errno(posix_fadvise(arg1, arg2, arg3, arg4));
 #endif
 #endif /* end of 64-bit ABI fadvise handling */
 
@@ -11683,8 +11533,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
            turns private file-backed mappings into anonymous mappings.
            This will break MADV_DONTNEED.
            This is a hint, so ignoring and returning success is ok.  */
-        ret = get_errno(0);
-        break;
+        return 0;
 #endif
 #if TARGET_ABI_BITS == 32
     case TARGET_NR_fcntl64:
@@ -11703,8 +11552,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 
 	cmd = target_to_host_fcntl_cmd(arg2);
         if (cmd == -TARGET_EINVAL) {
-            ret = cmd;
-            break;
+            return cmd;
         }
 
         switch(arg2) {
@@ -11731,14 +11579,13 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = do_fcntl(arg1, arg2, arg3);
             break;
         }
-	break;
+        return ret;
     }
 #endif
 #ifdef TARGET_NR_cacheflush
     case TARGET_NR_cacheflush:
         /* self-modifying code is handled automatically, so nothing needed */
-        ret = 0;
-        break;
+        return 0;
 #endif
 #ifdef TARGET_NR_security
     case TARGET_NR_security:
@@ -11746,12 +11593,10 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #endif
 #ifdef TARGET_NR_getpagesize
     case TARGET_NR_getpagesize:
-        ret = TARGET_PAGE_SIZE;
-        break;
+        return TARGET_PAGE_SIZE;
 #endif
     case TARGET_NR_gettid:
-        ret = get_errno(gettid());
-        break;
+        return get_errno(gettid());
 #ifdef TARGET_NR_readahead
     case TARGET_NR_readahead:
 #if TARGET_ABI_BITS == 32
@@ -11764,7 +11609,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #else
         ret = get_errno(readahead(arg1, arg2, arg3));
 #endif
-        break;
+        return ret;
 #endif
 #ifdef CONFIG_ATTR
 #ifdef TARGET_NR_setxattr
@@ -11775,8 +11620,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         if (arg2) {
             b = lock_user(VERIFY_WRITE, arg2, arg3, 0);
             if (!b) {
-                ret = -TARGET_EFAULT;
-                break;
+                return -TARGET_EFAULT;
             }
         }
         p = lock_user_string(arg1);
@@ -11791,7 +11635,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         }
         unlock_user(p, arg1, 0);
         unlock_user(b, arg2, arg3);
-        break;
+        return ret;
     }
     case TARGET_NR_flistxattr:
     {
@@ -11799,13 +11643,12 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         if (arg2) {
             b = lock_user(VERIFY_WRITE, arg2, arg3, 0);
             if (!b) {
-                ret = -TARGET_EFAULT;
-                break;
+                return -TARGET_EFAULT;
             }
         }
         ret = get_errno(flistxattr(arg1, b, arg3));
         unlock_user(b, arg2, arg3);
-        break;
+        return ret;
     }
     case TARGET_NR_setxattr:
     case TARGET_NR_lsetxattr:
@@ -11814,8 +11657,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             if (arg3) {
                 v = lock_user(VERIFY_READ, arg3, arg4, 1);
                 if (!v) {
-                    ret = -TARGET_EFAULT;
-                    break;
+                    return -TARGET_EFAULT;
                 }
             }
             p = lock_user_string(arg1);
@@ -11833,15 +11675,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(n, arg2, 0);
             unlock_user(v, arg3, 0);
         }
-        break;
+        return ret;
     case TARGET_NR_fsetxattr:
         {
             void *n, *v = 0;
             if (arg3) {
                 v = lock_user(VERIFY_READ, arg3, arg4, 1);
                 if (!v) {
-                    ret = -TARGET_EFAULT;
-                    break;
+                    return -TARGET_EFAULT;
                 }
             }
             n = lock_user_string(arg2);
@@ -11853,7 +11694,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(n, arg2, 0);
             unlock_user(v, arg3, 0);
         }
-        break;
+        return ret;
     case TARGET_NR_getxattr:
     case TARGET_NR_lgetxattr:
         {
@@ -11861,8 +11702,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             if (arg3) {
                 v = lock_user(VERIFY_WRITE, arg3, arg4, 0);
                 if (!v) {
-                    ret = -TARGET_EFAULT;
-                    break;
+                    return -TARGET_EFAULT;
                 }
             }
             p = lock_user_string(arg1);
@@ -11880,15 +11720,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(n, arg2, 0);
             unlock_user(v, arg3, arg4);
         }
-        break;
+        return ret;
     case TARGET_NR_fgetxattr:
         {
             void *n, *v = 0;
             if (arg3) {
                 v = lock_user(VERIFY_WRITE, arg3, arg4, 0);
                 if (!v) {
-                    ret = -TARGET_EFAULT;
-                    break;
+                    return -TARGET_EFAULT;
                 }
             }
             n = lock_user_string(arg2);
@@ -11900,7 +11739,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(n, arg2, 0);
             unlock_user(v, arg3, arg4);
         }
-        break;
+        return ret;
     case TARGET_NR_removexattr:
     case TARGET_NR_lremovexattr:
         {
@@ -11919,7 +11758,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(p, arg1, 0);
             unlock_user(n, arg2, 0);
         }
-        break;
+        return ret;
     case TARGET_NR_fremovexattr:
         {
             void *n;
@@ -11931,15 +11770,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
             unlock_user(n, arg2, 0);
         }
-        break;
+        return ret;
 #endif
 #endif /* CONFIG_ATTR */
 #ifdef TARGET_NR_set_thread_area
     case TARGET_NR_set_thread_area:
 #if defined(TARGET_MIPS)
       ((CPUMIPSState *) cpu_env)->active_tc.CP0_UserLocal = arg1;
-      ret = 0;
-      break;
+      return 0;
 #elif defined(TARGET_CRIS)
       if (arg1 & 0xff)
           ret = -TARGET_EINVAL;
@@ -11947,16 +11785,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
           ((CPUCRISState *) cpu_env)->pregs[PR_PID] = arg1;
           ret = 0;
       }
-      break;
+      return ret;
 #elif defined(TARGET_I386) && defined(TARGET_ABI32)
-      ret = do_set_thread_area(cpu_env, arg1);
-      break;
+      return do_set_thread_area(cpu_env, arg1);
 #elif defined(TARGET_M68K)
       {
           TaskState *ts = cpu->opaque;
           ts->tp_value = arg1;
-          ret = 0;
-          break;
+          return 0;
       }
 #else
       goto unimplemented_nowarn;
@@ -11965,13 +11801,11 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_get_thread_area
     case TARGET_NR_get_thread_area:
 #if defined(TARGET_I386) && defined(TARGET_ABI32)
-        ret = do_get_thread_area(cpu_env, arg1);
-        break;
+        return do_get_thread_area(cpu_env, arg1);
 #elif defined(TARGET_M68K)
         {
             TaskState *ts = cpu->opaque;
-            ret = ts->tp_value;
-            break;
+            return ts->tp_value;
         }
 #else
         goto unimplemented_nowarn;
@@ -11991,7 +11825,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         if (!is_error(ret)) {
             ret = get_errno(clock_settime(arg1, &ts));
         }
-        break;
+        return ret;
     }
 #endif
 #ifdef TARGET_NR_clock_gettime
@@ -12002,7 +11836,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         if (!is_error(ret)) {
             ret = host_to_target_timespec(arg2, &ts);
         }
-        break;
+        return ret;
     }
 #endif
 #ifdef TARGET_NR_clock_getres
@@ -12013,7 +11847,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         if (!is_error(ret)) {
             host_to_target_timespec(arg2, &ts);
         }
-        break;
+        return ret;
     }
 #endif
 #ifdef TARGET_NR_clock_nanosleep
@@ -12033,24 +11867,21 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ((CPUPPCState *)cpu_env)->crf[0] |= 1;
         }
 #endif
-        break;
+        return ret;
     }
 #endif
 
 #if defined(TARGET_NR_set_tid_address) && defined(__NR_set_tid_address)
     case TARGET_NR_set_tid_address:
-        ret = get_errno(set_tid_address((int *)g2h(arg1)));
-        break;
+        return get_errno(set_tid_address((int *)g2h(arg1)));
 #endif
 
     case TARGET_NR_tkill:
-        ret = get_errno(safe_tkill((int)arg1, target_to_host_signal(arg2)));
-        break;
+        return get_errno(safe_tkill((int)arg1, target_to_host_signal(arg2)));
 
     case TARGET_NR_tgkill:
-        ret = get_errno(safe_tgkill((int)arg1, (int)arg2,
-                        target_to_host_signal(arg3)));
-        break;
+        return get_errno(safe_tgkill((int)arg1, (int)arg2,
+                         target_to_host_signal(arg3)));
 
 #ifdef TARGET_NR_set_robust_list
     case TARGET_NR_set_robust_list:
@@ -12092,18 +11923,17 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 unlock_user(p, arg2, 0);
             }
         }
-	break;
+        return ret;
 #endif
     case TARGET_NR_futex:
-        ret = do_futex(arg1, arg2, arg3, arg4, arg5, arg6);
-        break;
+        return do_futex(arg1, arg2, arg3, arg4, arg5, arg6);
 #if defined(TARGET_NR_inotify_init) && defined(__NR_inotify_init)
     case TARGET_NR_inotify_init:
         ret = get_errno(sys_inotify_init());
         if (ret >= 0) {
             fd_trans_register(ret, &target_inotify_trans);
         }
-        break;
+        return ret;
 #endif
 #ifdef CONFIG_INOTIFY1
 #if defined(TARGET_NR_inotify_init1) && defined(__NR_inotify_init1)
@@ -12113,7 +11943,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         if (ret >= 0) {
             fd_trans_register(ret, &target_inotify_trans);
         }
-        break;
+        return ret;
 #endif
 #endif
 #if defined(TARGET_NR_inotify_add_watch) && defined(__NR_inotify_add_watch)
@@ -12121,12 +11951,11 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         p = lock_user_string(arg2);
         ret = get_errno(sys_inotify_add_watch(arg1, path(p), arg3));
         unlock_user(p, arg2, 0);
-        break;
+        return ret;
 #endif
 #if defined(TARGET_NR_inotify_rm_watch) && defined(__NR_inotify_rm_watch)
     case TARGET_NR_inotify_rm_watch:
-        ret = get_errno(sys_inotify_rm_watch(arg1, arg2));
-        break;
+        return get_errno(sys_inotify_rm_watch(arg1, arg2));
 #endif
 
 #if defined(TARGET_NR_mq_open) && defined(__NR_mq_open)
@@ -12151,17 +11980,16 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(mq_open(p, host_flags, arg3, pposix_mq_attr));
             unlock_user (p, arg1, 0);
         }
-        break;
+        return ret;
 
     case TARGET_NR_mq_unlink:
         p = lock_user_string(arg1 - 1);
         if (!p) {
-            ret = -TARGET_EFAULT;
-            break;
+            return -TARGET_EFAULT;
         }
         ret = get_errno(mq_unlink(p));
         unlock_user (p, arg1, 0);
-        break;
+        return ret;
 
     case TARGET_NR_mq_timedsend:
         {
@@ -12177,7 +12005,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
             unlock_user (p, arg2, arg3);
         }
-        break;
+        return ret;
 
     case TARGET_NR_mq_timedreceive:
         {
@@ -12198,7 +12026,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             if (arg4 != 0)
                 put_user_u32(prio, arg4);
         }
-        break;
+        return ret;
 
     /* Not implemented for now... */
 /*     case TARGET_NR_mq_notify: */
@@ -12219,7 +12047,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 copy_to_user_mq_attr(arg3, &posix_mq_attr_out);
             }
         }
-        break;
+        return ret;
 #endif
 
 #ifdef CONFIG_SPLICE
@@ -12228,7 +12056,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         {
             ret = get_errno(tee(arg1,arg2,arg3,arg4));
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_splice
     case TARGET_NR_splice:
@@ -12259,7 +12087,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 }
             }
         }
-        break;
+        return ret;
 #endif
 #ifdef TARGET_NR_vmsplice
 	case TARGET_NR_vmsplice:
@@ -12272,7 +12100,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 ret = -host_to_target_errno(errno);
             }
         }
-        break;
+        return ret;
 #endif
 #endif /* CONFIG_SPLICE */
 #ifdef CONFIG_EVENTFD
@@ -12282,7 +12110,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         if (ret >= 0) {
             fd_trans_register(ret, &target_eventfd_trans);
         }
-        break;
+        return ret;
 #endif
 #if defined(TARGET_NR_eventfd2)
     case TARGET_NR_eventfd2:
@@ -12298,7 +12126,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         if (ret >= 0) {
             fd_trans_register(ret, &target_eventfd_trans);
         }
-        break;
+        return ret;
     }
 #endif
 #endif /* CONFIG_EVENTFD  */
@@ -12310,7 +12138,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #else
         ret = get_errno(fallocate(arg1, arg2, arg3, arg4));
 #endif
-        break;
+        return ret;
 #endif
 #if defined(CONFIG_SYNC_FILE_RANGE)
 #if defined(TARGET_NR_sync_file_range)
@@ -12326,7 +12154,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #else
         ret = get_errno(sync_file_range(arg1, arg2, arg3, arg4));
 #endif
-        break;
+        return ret;
 #endif
 #if defined(TARGET_NR_sync_file_range2)
     case TARGET_NR_sync_file_range2:
@@ -12337,29 +12165,25 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #else
         ret = get_errno(sync_file_range(arg1, arg3, arg4, arg2));
 #endif
-        break;
+        return ret;
 #endif
 #endif
 #if defined(TARGET_NR_signalfd4)
     case TARGET_NR_signalfd4:
-        ret = do_signalfd4(arg1, arg2, arg4);
-        break;
+        return do_signalfd4(arg1, arg2, arg4);
 #endif
 #if defined(TARGET_NR_signalfd)
     case TARGET_NR_signalfd:
-        ret = do_signalfd4(arg1, arg2, 0);
-        break;
+        return do_signalfd4(arg1, arg2, 0);
 #endif
 #if defined(CONFIG_EPOLL)
 #if defined(TARGET_NR_epoll_create)
     case TARGET_NR_epoll_create:
-        ret = get_errno(epoll_create(arg1));
-        break;
+        return get_errno(epoll_create(arg1));
 #endif
 #if defined(TARGET_NR_epoll_create1) && defined(CONFIG_EPOLL_CREATE1)
     case TARGET_NR_epoll_create1:
-        ret = get_errno(epoll_create1(arg1));
-        break;
+        return get_errno(epoll_create1(arg1));
 #endif
 #if defined(TARGET_NR_epoll_ctl)
     case TARGET_NR_epoll_ctl:
@@ -12380,8 +12204,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user_struct(target_ep, arg4, 0);
             epp = &ep;
         }
-        ret = get_errno(epoll_ctl(arg1, arg2, arg3, epp));
-        break;
+        return get_errno(epoll_ctl(arg1, arg2, arg3, epp));
     }
 #endif
 
@@ -12400,8 +12223,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         int timeout = arg4;
 
         if (maxevents <= 0 || maxevents > TARGET_EP_MAX_EVENTS) {
-            ret = -TARGET_EINVAL;
-            break;
+            return -TARGET_EINVAL;
         }
 
         target_ep = lock_user(VERIFY_WRITE, arg2,
@@ -12413,8 +12235,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         ep = g_try_new(struct epoll_event, maxevents);
         if (!ep) {
             unlock_user(target_ep, arg2, 0);
-            ret = -TARGET_ENOMEM;
-            break;
+            return -TARGET_ENOMEM;
         }
 
         switch (num) {
@@ -12444,7 +12265,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 
             ret = get_errno(safe_epoll_pwait(epfd, ep, maxevents, timeout,
                                              set, SIGSET_T_SIZE));
-            break;
         }
 #endif
 #if defined(TARGET_NR_epoll_wait)
@@ -12468,7 +12288,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(target_ep, arg2, 0);
         }
         g_free(ep);
-        break;
+        return ret;
     }
 #endif
 #endif
@@ -12498,7 +12318,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             target_rold->rlim_max = tswap64(rold.rlim_max);
             unlock_user_struct(target_rold, arg4, 1);
         }
-        break;
+        return ret;
     }
 #endif
 #ifdef TARGET_NR_gethostname
@@ -12511,7 +12331,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         } else {
             ret = -TARGET_EFAULT;
         }
-        break;
+        return ret;
     }
 #endif
 #ifdef TARGET_NR_atomic_cmpxchg_32
@@ -12532,17 +12352,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         }
         if (mem_value == arg2)
             put_user_u32(arg1, arg6);
-        ret = mem_value;
-        break;
+        return mem_value;
     }
 #endif
 #ifdef TARGET_NR_atomic_barrier
     case TARGET_NR_atomic_barrier:
-    {
-        /* Like the kernel implementation and the qemu arm barrier, no-op this? */
-        ret = 0;
-        break;
-    }
+        /* Like the kernel implementation and the
+           qemu arm barrier, no-op this? */
+        return 0;
 #endif
 
 #ifdef TARGET_NR_timer_create
@@ -12564,7 +12381,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 phost_sevp = &host_sevp;
                 ret = target_to_host_sigevent(phost_sevp, arg2);
                 if (ret != 0) {
-                    break;
+                    return ret;
                 }
             }
 
@@ -12577,7 +12394,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 }
             }
         }
-        break;
+        return ret;
     }
 #endif
 
@@ -12605,7 +12422,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 goto efault;
             }
         }
-        break;
+        return ret;
     }
 #endif
 
@@ -12628,7 +12445,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 ret = -TARGET_EFAULT;
             }
         }
-        break;
+        return ret;
     }
 #endif
 
@@ -12645,7 +12462,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(timer_getoverrun(htimer));
         }
         fd_trans_unregister(ret);
-        break;
+        return ret;
     }
 #endif
 
@@ -12662,15 +12479,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(timer_delete(htimer));
             g_posix_timers[timerid] = 0;
         }
-        break;
+        return ret;
     }
 #endif
 
 #if defined(TARGET_NR_timerfd_create) && defined(CONFIG_TIMERFD)
     case TARGET_NR_timerfd_create:
-        ret = get_errno(timerfd_create(arg1,
-                target_to_host_bitmask(arg2, fcntl_flags_tbl)));
-        break;
+        return get_errno(timerfd_create(arg1,
+                          target_to_host_bitmask(arg2, fcntl_flags_tbl)));
 #endif
 
 #if defined(TARGET_NR_timerfd_gettime) && defined(CONFIG_TIMERFD)
@@ -12684,7 +12500,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 goto efault;
             }
         }
-        break;
+        return ret;
 #endif
 
 #if defined(TARGET_NR_timerfd_settime) && defined(CONFIG_TIMERFD)
@@ -12707,35 +12523,30 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 goto efault;
             }
         }
-        break;
+        return ret;
 #endif
 
 #if defined(TARGET_NR_ioprio_get) && defined(__NR_ioprio_get)
     case TARGET_NR_ioprio_get:
-        ret = get_errno(ioprio_get(arg1, arg2));
-        break;
+        return get_errno(ioprio_get(arg1, arg2));
 #endif
 
 #if defined(TARGET_NR_ioprio_set) && defined(__NR_ioprio_set)
     case TARGET_NR_ioprio_set:
-        ret = get_errno(ioprio_set(arg1, arg2, arg3));
-        break;
+        return get_errno(ioprio_set(arg1, arg2, arg3));
 #endif
 
 #if defined(TARGET_NR_setns) && defined(CONFIG_SETNS)
     case TARGET_NR_setns:
-        ret = get_errno(setns(arg1, arg2));
-        break;
+        return get_errno(setns(arg1, arg2));
 #endif
 #if defined(TARGET_NR_unshare) && defined(CONFIG_SETNS)
     case TARGET_NR_unshare:
-        ret = get_errno(unshare(arg1));
-        break;
+        return get_errno(unshare(arg1));
 #endif
 #if defined(TARGET_NR_kcmp) && defined(__NR_kcmp)
     case TARGET_NR_kcmp:
-        ret = get_errno(kcmp(arg1, arg2, arg3, arg4, arg5));
-        break;
+        return get_errno(kcmp(arg1, arg2, arg3, arg4, arg5));
 #endif
 
     default:
@@ -12744,8 +12555,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #if defined(TARGET_NR_setxattr) || defined(TARGET_NR_get_thread_area) || defined(TARGET_NR_getdomainname) || defined(TARGET_NR_set_robust_list)
     unimplemented_nowarn:
 #endif
-        ret = -TARGET_ENOSYS;
-        break;
+        return -TARGET_ENOSYS;
     }
 fail:
     return ret;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 004/108] linux-user: Propagate goto efault to return
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (2 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 003/108] linux-user: Relax single exit from "break" Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 005/108] linux-user: Propagate goto unimplemented_nowarn " Richard Henderson
                   ` (107 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 341 ++++++++++++++++++++++---------------------
 1 file changed, 175 insertions(+), 166 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index efe882612b..a6b8268332 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8009,7 +8009,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             return 0;
         } else {
             if (!(p = lock_user(VERIFY_WRITE, arg2, arg3, 0)))
-                goto efault;
+                return -TARGET_EFAULT;
             ret = get_errno(safe_read(arg1, p, arg3));
             if (ret >= 0 &&
                 fd_trans_host_to_target_data(arg1)) {
@@ -8020,7 +8020,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         return ret;
     case TARGET_NR_write:
         if (!(p = lock_user(VERIFY_READ, arg2, arg3, 1)))
-            goto efault;
+            return -TARGET_EFAULT;
         if (fd_trans_target_to_host_data(arg1)) {
             void *copy = g_malloc(arg3);
             memcpy(copy, p, arg3);
@@ -8038,7 +8038,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_open
     case TARGET_NR_open:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(do_openat(cpu_env, AT_FDCWD, p,
                                   target_to_host_bitmask(arg2, fcntl_flags_tbl),
                                   arg3));
@@ -8048,7 +8048,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #endif
     case TARGET_NR_openat:
         if (!(p = lock_user_string(arg2)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(do_openat(cpu_env, arg1, p,
                                   target_to_host_bitmask(arg3, fcntl_flags_tbl),
                                   arg4));
@@ -8083,7 +8083,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(safe_wait4(arg1, &status, arg3, 0));
             if (!is_error(ret) && arg2 && ret
                 && put_user_s32(host_to_target_waitstatus(status), arg2))
-                goto efault;
+                return -TARGET_EFAULT;
         }
         return ret;
 #endif
@@ -8095,7 +8095,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(safe_waitid(arg1, arg2, &info, arg4, NULL));
             if (!is_error(ret) && arg3 && info.si_pid != 0) {
                 if (!(p = lock_user(VERIFY_WRITE, arg3, sizeof(target_siginfo_t), 0)))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 host_to_target_siginfo(p, &info);
                 unlock_user(p, arg3, sizeof(target_siginfo_t));
             }
@@ -8105,7 +8105,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_creat /* not on alpha */
     case TARGET_NR_creat:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(creat(p, arg2));
         fd_trans_unregister(ret);
         unlock_user(p, arg1, 0);
@@ -8131,7 +8131,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         {
             void * p2 = NULL;
             if (!arg2 || !arg4)
-                goto efault;
+                return -TARGET_EFAULT;
             p  = lock_user_string(arg2);
             p2 = lock_user_string(arg4);
             if (!p || !p2)
@@ -8146,7 +8146,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_unlink
     case TARGET_NR_unlink:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(unlink(p));
         unlock_user(p, arg1, 0);
         return ret;
@@ -8154,7 +8154,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #if defined(TARGET_NR_unlinkat)
     case TARGET_NR_unlinkat:
         if (!(p = lock_user_string(arg2)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(unlinkat(arg1, p, arg3));
         unlock_user(p, arg2, 0);
         return ret;
@@ -8174,7 +8174,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             guest_argp = arg2;
             for (gp = guest_argp; gp; gp += sizeof(abi_ulong)) {
                 if (get_user_ual(addr, gp))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 if (!addr)
                     break;
                 argc++;
@@ -8183,7 +8183,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             guest_envp = arg3;
             for (gp = guest_envp; gp; gp += sizeof(abi_ulong)) {
                 if (get_user_ual(addr, gp))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 if (!addr)
                     break;
                 envc++;
@@ -8258,7 +8258,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         return ret;
     case TARGET_NR_chdir:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(chdir(p));
         unlock_user(p, arg1, 0);
         return ret;
@@ -8270,14 +8270,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             if (!is_error(ret)
                 && arg1
                 && put_user_sal(host_time, arg1))
-                goto efault;
+                return -TARGET_EFAULT;
         }
         return ret;
 #endif
 #ifdef TARGET_NR_mknod
     case TARGET_NR_mknod:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(mknod(p, arg2, arg3));
         unlock_user(p, arg1, 0);
         return ret;
@@ -8285,7 +8285,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #if defined(TARGET_NR_mknodat)
     case TARGET_NR_mknodat:
         if (!(p = lock_user_string(arg2)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(mknodat(arg1, p, arg3, arg4));
         unlock_user(p, arg2, 0);
         return ret;
@@ -8293,7 +8293,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_chmod
     case TARGET_NR_chmod:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(chmod(p, arg2));
         unlock_user(p, arg1, 0);
         return ret;
@@ -8326,7 +8326,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             if (arg1) {
                 p = lock_user_string(arg1);
                 if (!p) {
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
             } else {
                 p = NULL;
@@ -8337,7 +8337,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 if (arg1) {
                     unlock_user(p, arg1, 0);
                 }
-                goto efault;
+                return -TARGET_EFAULT;
             }
 
             if (arg3) {
@@ -8347,7 +8347,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                         unlock_user(p, arg1, 0);
                     }
                     unlock_user(p2, arg2, 0);
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
             } else {
                 p3 = NULL;
@@ -8376,7 +8376,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_umount
     case TARGET_NR_umount:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(umount(p));
         unlock_user(p, arg1, 0);
         return ret;
@@ -8386,7 +8386,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         {
             time_t host_time;
             if (get_user_sal(host_time, arg1))
-                goto efault;
+                return -TARGET_EFAULT;
             return get_errno(stime(&host_time));
         }
 #endif
@@ -8414,7 +8414,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             struct target_utimbuf *target_tbuf;
             if (arg2) {
                 if (!lock_user_struct(VERIFY_READ, target_tbuf, arg2, 1))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 tbuf.actime = tswapal(target_tbuf->actime);
                 tbuf.modtime = tswapal(target_tbuf->modtime);
                 unlock_user_struct(target_tbuf, arg2, 0);
@@ -8423,7 +8423,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 host_tbuf = NULL;
             }
             if (!(p = lock_user_string(arg1)))
-                goto efault;
+                return -TARGET_EFAULT;
             ret = get_errno(utime(p, host_tbuf));
             unlock_user(p, arg1, 0);
         }
@@ -8437,13 +8437,13 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 if (copy_from_user_timeval(&tv[0], arg2)
                     || copy_from_user_timeval(&tv[1],
                                               arg2 + sizeof(struct target_timeval)))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 tvp = tv;
             } else {
                 tvp = NULL;
             }
             if (!(p = lock_user_string(arg1)))
-                goto efault;
+                return -TARGET_EFAULT;
             ret = get_errno(utimes(p, tvp));
             unlock_user(p, arg1, 0);
         }
@@ -8457,13 +8457,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 if (copy_from_user_timeval(&tv[0], arg3)
                     || copy_from_user_timeval(&tv[1],
                                               arg3 + sizeof(struct target_timeval)))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 tvp = tv;
             } else {
                 tvp = NULL;
             }
-            if (!(p = lock_user_string(arg2)))
-                goto efault;
+            if (!(p = lock_user_string(arg2))) {
+                return -TARGET_EFAULT;
+            }
             ret = get_errno(futimesat(arg1, path(p), tvp));
             unlock_user(p, arg2, 0);
         }
@@ -8479,16 +8480,18 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #endif
 #ifdef TARGET_NR_access
     case TARGET_NR_access:
-        if (!(p = lock_user_string(arg1)))
-            goto efault;
+        if (!(p = lock_user_string(arg1))) {
+            return -TARGET_EFAULT;
+        }
         ret = get_errno(access(path(p), arg2));
         unlock_user(p, arg1, 0);
         return ret;
 #endif
 #if defined(TARGET_NR_faccessat) && defined(__NR_faccessat)
     case TARGET_NR_faccessat:
-        if (!(p = lock_user_string(arg2)))
-            goto efault;
+        if (!(p = lock_user_string(arg2))) {
+            return -TARGET_EFAULT;
+        }
         ret = get_errno(faccessat(arg1, p, arg3, 0));
         unlock_user(p, arg2, 0);
         return ret;
@@ -8559,7 +8562,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_mkdir
     case TARGET_NR_mkdir:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(mkdir(p, arg2));
         unlock_user(p, arg1, 0);
         return ret;
@@ -8567,7 +8570,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #if defined(TARGET_NR_mkdirat)
     case TARGET_NR_mkdirat:
         if (!(p = lock_user_string(arg2)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(mkdirat(arg1, p, arg3));
         unlock_user(p, arg2, 0);
         return ret;
@@ -8575,7 +8578,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_rmdir
     case TARGET_NR_rmdir:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(rmdir(p));
         unlock_user(p, arg1, 0);
         return ret;
@@ -8603,7 +8606,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             if (arg1) {
                 tmsp = lock_user(VERIFY_WRITE, arg1, sizeof(struct target_tms), 0);
                 if (!tmsp)
-                    goto efault;
+                    return -TARGET_EFAULT;
                 tmsp->tms_utime = tswapal(host_to_target_clock_t(tms.tms_utime));
                 tmsp->tms_stime = tswapal(host_to_target_clock_t(tms.tms_stime));
                 tmsp->tms_cutime = tswapal(host_to_target_clock_t(tms.tms_cutime));
@@ -8625,8 +8628,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         if (arg1 == 0) {
             ret = get_errno(acct(NULL));
         } else {
-            if (!(p = lock_user_string(arg1)))
-                goto efault;
+            if (!(p = lock_user_string(arg1))) {
+                return -TARGET_EFAULT;
+            }
             ret = get_errno(acct(path(p)));
             unlock_user(p, arg1, 0);
         }
@@ -8634,7 +8638,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_umount2
     case TARGET_NR_umount2:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(umount2(p, arg2));
         unlock_user(p, arg1, 0);
         return ret;
@@ -8667,7 +8671,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         return get_errno(umask(arg1));
     case TARGET_NR_chroot:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(chroot(p));
         unlock_user(p, arg1, 0);
         return ret;
@@ -8717,7 +8721,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             struct target_old_sigaction *old_act;
             if (arg2) {
                 if (!lock_user_struct(VERIFY_READ, old_act, arg2, 1))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 act._sa_handler = old_act->_sa_handler;
                 target_siginitset(&act.sa_mask, old_act->sa_mask);
                 act.sa_flags = old_act->sa_flags;
@@ -8728,7 +8732,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(do_sigaction(arg1, pact, &oact));
             if (!is_error(ret) && arg3) {
                 if (!lock_user_struct(VERIFY_WRITE, old_act, arg3, 0))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 old_act->_sa_handler = oact._sa_handler;
                 old_act->sa_mask = oact.sa_mask.sig[0];
                 old_act->sa_flags = oact.sa_flags;
@@ -8739,7 +8743,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 
 	    if (arg2) {
                 if (!lock_user_struct(VERIFY_READ, old_act, arg2, 1))
-                    goto efault;
+                    return -TARGET_EFAULT;
 		act._sa_handler = old_act->_sa_handler;
 		target_siginitset(&act.sa_mask, old_act->sa_mask.sig[0]);
 		act.sa_flags = old_act->sa_flags;
@@ -8753,7 +8757,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 
 	    if (!is_error(ret) && arg3) {
                 if (!lock_user_struct(VERIFY_WRITE, old_act, arg3, 0))
-                    goto efault;
+                    return -TARGET_EFAULT;
 		old_act->_sa_handler = oact._sa_handler;
 		old_act->sa_flags = oact.sa_flags;
 		old_act->sa_mask.sig[0] = oact.sa_mask.sig[0];
@@ -8767,7 +8771,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             struct target_sigaction act, oact, *pact;
             if (arg2) {
                 if (!lock_user_struct(VERIFY_READ, old_act, arg2, 1))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 act._sa_handler = old_act->_sa_handler;
                 target_siginitset(&act.sa_mask, old_act->sa_mask);
                 act.sa_flags = old_act->sa_flags;
@@ -8783,7 +8787,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(do_sigaction(arg1, pact, &oact));
             if (!is_error(ret) && arg3) {
                 if (!lock_user_struct(VERIFY_WRITE, old_act, arg3, 0))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 old_act->_sa_handler = oact._sa_handler;
                 old_act->sa_mask = oact.sa_mask.sig[0];
                 old_act->sa_flags = oact.sa_flags;
@@ -8813,7 +8817,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
             if (arg2) {
                 if (!lock_user_struct(VERIFY_READ, rt_act, arg2, 1))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 act._sa_handler = rt_act->_sa_handler;
                 act.sa_mask = rt_act->sa_mask;
                 act.sa_flags = rt_act->sa_flags;
@@ -8824,7 +8828,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(do_sigaction(arg1, pact, &oact));
             if (!is_error(ret) && arg3) {
                 if (!lock_user_struct(VERIFY_WRITE, rt_act, arg3, 0))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 rt_act->_sa_handler = oact._sa_handler;
                 rt_act->sa_mask = oact.sa_mask;
                 rt_act->sa_flags = oact.sa_flags;
@@ -8845,7 +8849,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
             if (arg2) {
                 if (!lock_user_struct(VERIFY_READ, act, arg2, 1)) {
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
 #ifdef TARGET_ARCH_HAS_KA_RESTORER
                 act->ka_restorer = restorer;
@@ -8947,7 +8951,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     goto fail;
                 }
                 if (!(p = lock_user(VERIFY_READ, arg2, sizeof(target_sigset_t), 1)))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 target_to_host_old_sigset(&set, p);
                 unlock_user(p, arg2, 0);
                 set_ptr = &set;
@@ -8958,7 +8962,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = do_sigprocmask(how, set_ptr, &oldset);
             if (!is_error(ret) && arg3) {
                 if (!(p = lock_user(VERIFY_WRITE, arg3, sizeof(target_sigset_t), 0)))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 host_to_target_old_sigset(p, &oldset);
                 unlock_user(p, arg3, sizeof(target_sigset_t));
             }
@@ -8991,7 +8995,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     goto fail;
                 }
                 if (!(p = lock_user(VERIFY_READ, arg2, sizeof(target_sigset_t), 1)))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 target_to_host_sigset(&set, p);
                 unlock_user(p, arg2, 0);
                 set_ptr = &set;
@@ -9002,7 +9006,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = do_sigprocmask(how, set_ptr, &oldset);
             if (!is_error(ret) && arg3) {
                 if (!(p = lock_user(VERIFY_WRITE, arg3, sizeof(target_sigset_t), 0)))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 host_to_target_sigset(p, &oldset);
                 unlock_user(p, arg3, sizeof(target_sigset_t));
             }
@@ -9015,7 +9019,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(sigpending(&set));
             if (!is_error(ret)) {
                 if (!(p = lock_user(VERIFY_WRITE, arg1, sizeof(target_sigset_t), 0)))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 host_to_target_old_sigset(p, &set);
                 unlock_user(p, arg1, sizeof(target_sigset_t));
             }
@@ -9038,7 +9042,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(sigpending(&set));
             if (!is_error(ret)) {
                 if (!(p = lock_user(VERIFY_WRITE, arg1, sizeof(target_sigset_t), 0)))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 host_to_target_sigset(p, &set);
                 unlock_user(p, arg1, sizeof(target_sigset_t));
             }
@@ -9053,7 +9057,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             target_to_host_old_sigset(&ts->sigsuspend_mask, &mask);
 #else
             if (!(p = lock_user(VERIFY_READ, arg1, sizeof(target_sigset_t), 1)))
-                goto efault;
+                return -TARGET_EFAULT;
             target_to_host_old_sigset(&ts->sigsuspend_mask, p);
             unlock_user(p, arg1, 0);
 #endif
@@ -9073,7 +9077,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 return -TARGET_EINVAL;
             }
             if (!(p = lock_user(VERIFY_READ, arg1, sizeof(target_sigset_t), 1)))
-                goto efault;
+                return -TARGET_EFAULT;
             target_to_host_sigset(&ts->sigsuspend_mask, p);
             unlock_user(p, arg1, 0);
             ret = get_errno(safe_rt_sigsuspend(&ts->sigsuspend_mask,
@@ -9094,7 +9098,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
 
             if (!(p = lock_user(VERIFY_READ, arg1, sizeof(target_sigset_t), 1)))
-                goto efault;
+                return -TARGET_EFAULT;
             target_to_host_sigset(&set, p);
             unlock_user(p, arg1, 0);
             if (arg3) {
@@ -9110,7 +9114,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     p = lock_user(VERIFY_WRITE, arg2, sizeof(target_siginfo_t),
                                   0);
                     if (!p) {
-                        goto efault;
+                        return -TARGET_EFAULT;
                     }
                     host_to_target_siginfo(p, &uinfo);
                     unlock_user(p, arg2, sizeof(target_siginfo_t));
@@ -9125,7 +9129,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 
             p = lock_user(VERIFY_READ, arg3, sizeof(target_siginfo_t), 1);
             if (!p) {
-                goto efault;
+                return -TARGET_EFAULT;
             }
             target_to_host_siginfo(&uinfo, p);
             unlock_user(p, arg3, 0);
@@ -9138,7 +9142,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 
             p = lock_user(VERIFY_READ, arg4, sizeof(target_siginfo_t), 1);
             if (!p) {
-                goto efault;
+                return -TARGET_EFAULT;
             }
             target_to_host_siginfo(&uinfo, p);
             unlock_user(p, arg4, 0);
@@ -9162,7 +9166,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         }
     case TARGET_NR_sethostname:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(sethostname(p, arg2));
         unlock_user(p, arg1, 0);
         return ret;
@@ -9172,7 +9176,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             struct target_rlimit *target_rlim;
             struct rlimit rlim;
             if (!lock_user_struct(VERIFY_READ, target_rlim, arg2, 1))
-                goto efault;
+                return -TARGET_EFAULT;
             rlim.rlim_cur = target_to_host_rlim(target_rlim->rlim_cur);
             rlim.rlim_max = target_to_host_rlim(target_rlim->rlim_max);
             unlock_user_struct(target_rlim, arg2, 0);
@@ -9187,7 +9191,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(getrlimit(resource, &rlim));
             if (!is_error(ret)) {
                 if (!lock_user_struct(VERIFY_WRITE, target_rlim, arg2, 0))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 target_rlim->rlim_cur = host_to_target_rlim(rlim.rlim_cur);
                 target_rlim->rlim_max = host_to_target_rlim(rlim.rlim_max);
                 unlock_user_struct(target_rlim, arg2, 1);
@@ -9209,7 +9213,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(gettimeofday(&tv, NULL));
             if (!is_error(ret)) {
                 if (copy_to_user_timeval(arg1, &tv))
-                    goto efault;
+                    return -TARGET_EFAULT;
             }
         }
         return ret;
@@ -9220,14 +9224,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 
             if (arg1) {
                 if (copy_from_user_timeval(&tv, arg1)) {
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
                 ptv = &tv;
             }
 
             if (arg2) {
                 if (copy_from_user_timezone(&tz, arg2)) {
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
                 ptz = &tz;
             }
@@ -9294,7 +9298,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
              */
             if (ts_addr) {
                 if (target_to_host_timespec(&ts, ts_addr)) {
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
                 ts_ptr = &ts;
             } else {
@@ -9308,7 +9312,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 
                 arg7 = lock_user(VERIFY_READ, arg6, sizeof(*arg7) * 2, 1);
                 if (!arg7) {
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
                 arg_sigset = tswapal(arg7[0]);
                 arg_sigsize = tswapal(arg7[1]);
@@ -9324,7 +9328,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     target_sigset = lock_user(VERIFY_READ, arg_sigset,
                                               sizeof(*target_sigset), 1);
                     if (!target_sigset) {
-                        goto efault;
+                        return -TARGET_EFAULT;
                     }
                     target_to_host_sigset(&set, target_sigset);
                     unlock_user(target_sigset, arg_sigset, 0);
@@ -9340,14 +9344,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 
             if (!is_error(ret)) {
                 if (rfd_addr && copy_to_user_fdset(rfd_addr, &rfds, n))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 if (wfd_addr && copy_to_user_fdset(wfd_addr, &wfds, n))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 if (efd_addr && copy_to_user_fdset(efd_addr, &efds, n))
-                    goto efault;
+                    return -TARGET_EFAULT;
 
                 if (ts_addr && host_to_target_timespec(ts_addr, &ts))
-                    goto efault;
+                    return -TARGET_EFAULT;
             }
         }
         return ret;
@@ -9446,7 +9450,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_swapon
     case TARGET_NR_swapon:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(swapon(p, arg2));
         unlock_user(p, arg1, 0);
         return ret;
@@ -9456,7 +9460,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
            /* arg4 must be ignored in all other cases */
            p = lock_user_string(arg4);
            if (!p) {
-              goto efault;
+               return -TARGET_EFAULT;
            }
            ret = get_errno(reboot(arg1, arg2, arg3, p));
            unlock_user(p, arg4, 0);
@@ -9478,7 +9482,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             abi_ulong *v;
             abi_ulong v1, v2, v3, v4, v5, v6;
             if (!(v = lock_user(VERIFY_READ, arg1, 6 * sizeof(abi_ulong), 1)))
-                goto efault;
+                return -TARGET_EFAULT;
             v1 = tswapal(v[0]);
             v2 = tswapal(v[1]);
             v3 = tswapal(v[2]);
@@ -9550,7 +9554,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #endif
     case TARGET_NR_truncate:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(truncate(p, arg2));
         unlock_user(p, arg1, 0);
         return ret;
@@ -9561,7 +9565,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #if defined(TARGET_NR_fchmodat)
     case TARGET_NR_fchmodat:
         if (!(p = lock_user_string(arg2)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(fchmodat(arg1, p, arg3, 0));
         unlock_user(p, arg2, 0);
         return ret;
@@ -9589,8 +9593,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         goto unimplemented;
 #endif
     case TARGET_NR_statfs:
-        if (!(p = lock_user_string(arg1)))
-            goto efault;
+        if (!(p = lock_user_string(arg1))) {
+            return -TARGET_EFAULT;
+        }
         ret = get_errno(statfs(path(p), &stfs));
         unlock_user(p, arg1, 0);
     convert_statfs:
@@ -9598,7 +9603,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             struct target_statfs *target_stfs;
 
             if (!lock_user_struct(VERIFY_WRITE, target_stfs, arg2, 0))
-                goto efault;
+                return -TARGET_EFAULT;
             __put_user(stfs.f_type, &target_stfs->f_type);
             __put_user(stfs.f_bsize, &target_stfs->f_bsize);
             __put_user(stfs.f_blocks, &target_stfs->f_blocks);
@@ -9624,8 +9629,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         goto convert_statfs;
 #ifdef TARGET_NR_statfs64
     case TARGET_NR_statfs64:
-        if (!(p = lock_user_string(arg1)))
-            goto efault;
+        if (!(p = lock_user_string(arg1))) {
+            return -TARGET_EFAULT;
+        }
         ret = get_errno(statfs(path(p), &stfs));
         unlock_user(p, arg1, 0);
     convert_statfs64:
@@ -9633,7 +9639,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             struct target_statfs64 *target_stfs;
 
             if (!lock_user_struct(VERIFY_WRITE, target_stfs, arg3, 0))
-                goto efault;
+                return -TARGET_EFAULT;
             __put_user(stfs.f_type, &target_stfs->f_type);
             __put_user(stfs.f_bsize, &target_stfs->f_bsize);
             __put_user(stfs.f_blocks, &target_stfs->f_blocks);
@@ -9731,7 +9737,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_getrandom:
         p = lock_user(VERIFY_WRITE, arg1, arg2, 0);
         if (!p) {
-            goto efault;
+            return -TARGET_EFAULT;
         }
         ret = get_errno(getrandom(p, arg2, arg3));
         unlock_user(p, arg1, ret);
@@ -9799,7 +9805,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 if (copy_from_user_timeval(&pvalue->it_interval, arg2)
                     || copy_from_user_timeval(&pvalue->it_value,
                                               arg2 + sizeof(struct target_timeval)))
-                    goto efault;
+                    return -TARGET_EFAULT;
             } else {
                 pvalue = NULL;
             }
@@ -9809,7 +9815,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                                          &ovalue.it_interval)
                     || copy_to_user_timeval(arg3 + sizeof(struct target_timeval),
                                             &ovalue.it_value))
-                    goto efault;
+                    return -TARGET_EFAULT;
             }
         }
         return ret;
@@ -9823,22 +9829,24 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                                          &value.it_interval)
                     || copy_to_user_timeval(arg2 + sizeof(struct target_timeval),
                                             &value.it_value))
-                    goto efault;
+                    return -TARGET_EFAULT;
             }
         }
         return ret;
 #ifdef TARGET_NR_stat
     case TARGET_NR_stat:
-        if (!(p = lock_user_string(arg1)))
-            goto efault;
+        if (!(p = lock_user_string(arg1))) {
+            return -TARGET_EFAULT;
+        }
         ret = get_errno(stat(path(p), &st));
         unlock_user(p, arg1, 0);
         goto do_stat;
 #endif
 #ifdef TARGET_NR_lstat
     case TARGET_NR_lstat:
-        if (!(p = lock_user_string(arg1)))
-            goto efault;
+        if (!(p = lock_user_string(arg1))) {
+            return -TARGET_EFAULT;
+        }
         ret = get_errno(lstat(path(p), &st));
         unlock_user(p, arg1, 0);
         goto do_stat;
@@ -9853,7 +9861,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 struct target_stat *target_st;
 
                 if (!lock_user_struct(VERIFY_WRITE, target_st, arg2, 0))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 memset(target_st, 0, sizeof(*target_st));
                 __put_user(st.st_dev, &target_st->st_dev);
                 __put_user(st.st_ino, &target_st->st_ino);
@@ -9907,7 +9915,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 if (status_ptr && ret) {
                     status = host_to_target_waitstatus(status);
                     if (put_user_s32(status, status_ptr))
-                        goto efault;
+                        return -TARGET_EFAULT;
                 }
                 if (target_rusage) {
                     rusage_err = host_to_target_rusage(target_rusage, &rusage);
@@ -9921,7 +9929,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_swapoff
     case TARGET_NR_swapoff:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(swapoff(p));
         unlock_user(p, arg1, 0);
         return ret;
@@ -9934,7 +9942,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             if (!is_error(ret) && arg1)
             {
                 if (!lock_user_struct(VERIFY_WRITE, target_value, arg1, 0))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 __put_user(value.uptime, &target_value->uptime);
                 __put_user(value.loads[0], &target_value->loads[0]);
                 __put_user(value.loads[1], &target_value->loads[1]);
@@ -10031,7 +10039,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #endif
     case TARGET_NR_setdomainname:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(setdomainname(p, arg2));
         unlock_user(p, arg1, 0);
         return ret;
@@ -10041,7 +10049,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             struct new_utsname * buf;
 
             if (!lock_user_struct(VERIFY_WRITE, buf, arg1, 0))
-                goto efault;
+                return -TARGET_EFAULT;
             ret = get_errno(sys_uname(buf));
             if (!is_error(ret)) {
                 /* Overwrite the native machine name with whatever is being
@@ -10072,12 +10080,12 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             struct timex host_buf;
 
             if (target_to_host_timex(&host_buf, arg1) != 0) {
-                goto efault;
+                return -TARGET_EFAULT;
             }
             ret = get_errno(adjtimex(&host_buf));
             if (!is_error(ret)) {
                 if (host_to_target_timex(arg1, &host_buf) != 0) {
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
             }
         }
@@ -10088,12 +10096,12 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             struct timex htx, *phtx = &htx;
 
             if (target_to_host_timex(phtx, arg2) != 0) {
-                goto efault;
+                return -TARGET_EFAULT;
             }
             ret = get_errno(clock_adjtime(arg1, phtx));
             if (!is_error(ret) && phtx) {
                 if (host_to_target_timex(arg2, phtx) != 0) {
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
             }
         }
@@ -10143,7 +10151,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(_llseek(arg1, arg2, arg3, &res, arg5));
 #endif
             if ((ret == 0) && put_user_s64(res, arg4)) {
-                goto efault;
+                return -TARGET_EFAULT;
             }
         }
         return ret;
@@ -10174,7 +10182,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 		count1 = 0;
                 de = dirp;
                 if (!(target_dirp = lock_user(VERIFY_WRITE, arg2, count, 0)))
-                    goto efault;
+                    return -TARGET_EFAULT;
 		tde = target_dirp;
                 while (len > 0) {
                     reclen = de->d_reclen;
@@ -10202,7 +10210,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             abi_long count = arg3;
 
             if (!(dirp = lock_user(VERIFY_WRITE, arg2, count, 0)))
-                goto efault;
+                return -TARGET_EFAULT;
             ret = get_errno(sys_getdents(arg1, dirp, count));
             if (!is_error(ret)) {
                 struct linux_dirent *de;
@@ -10231,7 +10239,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 
             dirp = lock_user(VERIFY_WRITE, arg2, count, 0);
             if (!dirp) {
-                goto efault;
+                return -TARGET_EFAULT;
             }
             ret = get_errno(sys_getdents64(arg1, dirp, count));
             if (!is_error(ret)) {
@@ -10286,7 +10294,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             struct linux_dirent64 *dirp;
             abi_long count = arg3;
             if (!(dirp = lock_user(VERIFY_WRITE, arg2, count, 0)))
-                goto efault;
+                return -TARGET_EFAULT;
             ret = get_errno(sys_getdents64(arg1, dirp, count));
             if (!is_error(ret)) {
                 struct linux_dirent64 *de;
@@ -10335,7 +10343,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 target_pfd = lock_user(VERIFY_WRITE, arg1,
                                        sizeof(struct target_pollfd) * nfds, 1);
                 if (!target_pfd) {
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
 
                 pfd = alloca(sizeof(struct pollfd) * nfds);
@@ -10356,7 +10364,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 if (arg3) {
                     if (target_to_host_timespec(timeout_ts, arg3)) {
                         unlock_user(target_pfd, arg1, 0);
-                        goto efault;
+                        return -TARGET_EFAULT;
                     }
                 } else {
                     timeout_ts = NULL;
@@ -10371,7 +10379,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     target_set = lock_user(VERIFY_READ, arg4, sizeof(target_sigset_t), 1);
                     if (!target_set) {
                         unlock_user(target_pfd, arg1, 0);
-                        goto efault;
+                        return -TARGET_EFAULT;
                     }
                     target_to_host_sigset(set, target_set);
                 } else {
@@ -10525,7 +10533,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 }
 
                 if (host_to_target_cpu_mask(mask, mask_size, arg3, ret)) {
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
             }
         }
@@ -10562,10 +10570,10 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 goto fail;
             }
             if (arg1 && put_user_u32(cpu, arg1)) {
-                goto efault;
+                return -TARGET_EFAULT;
             }
             if (arg2 && put_user_u32(node, arg2)) {
-                goto efault;
+                return -TARGET_EFAULT;
             }
         }
         return ret;
@@ -10578,7 +10586,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 return -TARGET_EINVAL;
             }
             if (!lock_user_struct(VERIFY_READ, target_schp, arg2, 1))
-                goto efault;
+                return -TARGET_EFAULT;
             schp.sched_priority = tswap32(target_schp->sched_priority);
             unlock_user_struct(target_schp, arg2, 0);
             return get_errno(sched_setparam(arg1, &schp));
@@ -10594,7 +10602,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(sched_getparam(arg1, &schp));
             if (!is_error(ret)) {
                 if (!lock_user_struct(VERIFY_WRITE, target_schp, arg2, 0))
-                    goto efault;
+                    return -TARGET_EFAULT;
                 target_schp->sched_priority = tswap32(schp.sched_priority);
                 unlock_user_struct(target_schp, arg2, 1);
             }
@@ -10608,7 +10616,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 return -TARGET_EINVAL;
             }
             if (!lock_user_struct(VERIFY_READ, target_schp, arg3, 1))
-                goto efault;
+                return -TARGET_EFAULT;
             schp.sched_priority = tswap32(target_schp->sched_priority);
             unlock_user_struct(target_schp, arg3, 0);
             return get_errno(sched_setscheduler(arg1, arg2, &schp));
@@ -10656,7 +10664,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(prctl(arg1, &deathsig, arg3, arg4, arg5));
             if (!is_error(ret) && arg2
                 && put_user_ual(deathsig, arg2)) {
-                goto efault;
+                return -TARGET_EFAULT;
             }
             return ret;
         }
@@ -10665,7 +10673,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         {
             void *name = lock_user(VERIFY_WRITE, arg2, 16, 1);
             if (!name) {
-                goto efault;
+                return -TARGET_EFAULT;
             }
             ret = get_errno(prctl(arg1, (unsigned long)name,
                                   arg3, arg4, arg5));
@@ -10676,7 +10684,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         {
             void *name = lock_user(VERIFY_READ, arg2, 16, 1);
             if (!name) {
-                goto efault;
+                return -TARGET_EFAULT;
             }
             ret = get_errno(prctl(arg1, (unsigned long)name,
                                   arg3, arg4, arg5));
@@ -10736,7 +10744,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             arg5 = arg6;
         }
         if (!(p = lock_user(VERIFY_WRITE, arg2, arg3, 0)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(pread64(arg1, p, arg3, target_offset64(arg4, arg5)));
         unlock_user(p, arg2, ret);
         return ret;
@@ -10746,14 +10754,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             arg5 = arg6;
         }
         if (!(p = lock_user(VERIFY_READ, arg2, arg3, 1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(pwrite64(arg1, p, arg3, target_offset64(arg4, arg5)));
         unlock_user(p, arg2, 0);
         return ret;
 #endif
     case TARGET_NR_getcwd:
         if (!(p = lock_user(VERIFY_WRITE, arg1, arg2, 0)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(sys_getcwd1(p, arg2));
         unlock_user(p, arg1, ret);
         return ret;
@@ -10769,7 +10777,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         int data_items = 1;
 
         if (!lock_user_struct(VERIFY_WRITE, target_header, arg1, 1)) {
-            goto efault;
+            return -TARGET_EFAULT;
         }
         header.version = tswap32(target_header->version);
         header.pid = tswap32(target_header->pid);
@@ -10789,7 +10797,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
             if (!target_data) {
                 unlock_user_struct(target_header, arg1, 0);
-                goto efault;
+                return -TARGET_EFAULT;
             }
 
             if (num == TARGET_NR_capset) {
@@ -10905,7 +10913,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 	if (!is_error(ret)) {
 	    struct target_rlimit *target_rlim;
             if (!lock_user_struct(VERIFY_WRITE, target_rlim, arg2, 0))
-                goto efault;
+                return -TARGET_EFAULT;
 	    target_rlim->rlim_cur = host_to_target_rlim(rlim.rlim_cur);
 	    target_rlim->rlim_max = host_to_target_rlim(rlim.rlim_max);
             unlock_user_struct(target_rlim, arg2, 1);
@@ -10916,7 +10924,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_truncate64
     case TARGET_NR_truncate64:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
 	ret = target_truncate64(cpu_env, p, arg2, arg3, arg4);
         unlock_user(p, arg1, 0);
         return ret;
@@ -10927,8 +10935,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #endif
 #ifdef TARGET_NR_stat64
     case TARGET_NR_stat64:
-        if (!(p = lock_user_string(arg1)))
-            goto efault;
+        if (!(p = lock_user_string(arg1))) {
+            return -TARGET_EFAULT;
+        }
         ret = get_errno(stat(path(p), &st));
         unlock_user(p, arg1, 0);
         if (!is_error(ret))
@@ -10937,8 +10946,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #endif
 #ifdef TARGET_NR_lstat64
     case TARGET_NR_lstat64:
-        if (!(p = lock_user_string(arg1)))
-            goto efault;
+        if (!(p = lock_user_string(arg1))) {
+            return -TARGET_EFAULT;
+        }
         ret = get_errno(lstat(path(p), &st));
         unlock_user(p, arg1, 0);
         if (!is_error(ret))
@@ -10959,9 +10969,11 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_newfstatat
     case TARGET_NR_newfstatat:
 #endif
-        if (!(p = lock_user_string(arg2)))
-            goto efault;
+        if (!(p = lock_user_string(arg2))) {
+            return -TARGET_EFAULT;
+        }
         ret = get_errno(fstatat(arg1, path(p), &st, arg4));
+        unlock_user(p, arg2, 0);
         if (!is_error(ret))
             ret = host_to_target_stat64(cpu_env, arg3, &st);
         return ret;
@@ -10969,7 +10981,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_lchown
     case TARGET_NR_lchown:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(lchown(p, low2highuid(arg2), low2highgid(arg3)));
         unlock_user(p, arg1, 0);
         return ret;
@@ -11008,7 +11020,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             if (!is_error(ret)) {
                 target_grouplist = lock_user(VERIFY_WRITE, arg2, gidsetsize * sizeof(target_id), 0);
                 if (!target_grouplist)
-                    goto efault;
+                    return -TARGET_EFAULT;
                 for(i = 0;i < ret; i++)
                     target_grouplist[i] = tswapid(high2lowgid(grouplist[i]));
                 unlock_user(target_grouplist, arg2, gidsetsize * sizeof(target_id));
@@ -11040,7 +11052,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #if defined(TARGET_NR_fchownat)
     case TARGET_NR_fchownat:
         if (!(p = lock_user_string(arg2))) 
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(fchownat(arg1, p, low2highuid(arg3),
                                  low2highgid(arg4), arg5));
         unlock_user(p, arg2, 0);
@@ -11061,7 +11073,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 if (put_user_id(high2lowuid(ruid), arg1)
                     || put_user_id(high2lowuid(euid), arg2)
                     || put_user_id(high2lowuid(suid), arg3))
-                    goto efault;
+                    return -TARGET_EFAULT;
             }
         }
         return ret;
@@ -11081,7 +11093,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 if (put_user_id(high2lowgid(rgid), arg1)
                     || put_user_id(high2lowgid(egid), arg2)
                     || put_user_id(high2lowgid(sgid), arg3))
-                    goto efault;
+                    return -TARGET_EFAULT;
             }
         }
         return ret;
@@ -11089,7 +11101,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_chown
     case TARGET_NR_chown:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(chown(p, low2highuid(arg2), low2highgid(arg3)));
         unlock_user(p, arg1, 0);
         return ret;
@@ -11106,7 +11118,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_lchown32
     case TARGET_NR_lchown32:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(lchown(p, arg2, arg3));
         unlock_user(p, arg1, 0);
         return ret;
@@ -11157,7 +11169,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 swcr |= (~fpcr >> 41) & SWCR_TRAP_ENABLE_DNO;
 
                 if (put_user_u64 (swcr, arg2))
-                        goto efault;
+                        return -TARGET_EFAULT;
                 ret = 0;
             }
             break;
@@ -11184,7 +11196,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 uint64_t swcr, fpcr, orig_fpcr;
 
                 if (get_user_u64 (swcr, arg2)) {
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
                 orig_fpcr = cpu_alpha_load_fpcr(cpu_env);
                 fpcr = orig_fpcr & FPCR_DYN_MASK;
@@ -11211,7 +11223,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 int si_code;
 
                 if (get_user_u64(exc, arg2)) {
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
 
                 orig_fpcr = cpu_alpha_load_fpcr(cpu_env);
@@ -11380,7 +11392,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 if (put_user_u32(ruid, arg1)
                     || put_user_u32(euid, arg2)
                     || put_user_u32(suid, arg3))
-                    goto efault;
+                    return -TARGET_EFAULT;
             }
         }
         return ret;
@@ -11398,7 +11410,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 if (put_user_u32(rgid, arg1)
                     || put_user_u32(egid, arg2)
                     || put_user_u32(sgid, arg3))
-                    goto efault;
+                    return -TARGET_EFAULT;
             }
         }
         return ret;
@@ -11406,7 +11418,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_chown32
     case TARGET_NR_chown32:
         if (!(p = lock_user_string(arg1)))
-            goto efault;
+            return -TARGET_EFAULT;
         ret = get_errno(chown(p, arg2, arg3));
         unlock_user(p, arg1, 0);
         return ret;
@@ -11969,13 +11981,13 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             pposix_mq_attr = NULL;
             if (arg4) {
                 if (copy_from_user_mq_attr(&posix_mq_attr, arg4) != 0) {
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
                 pposix_mq_attr = &posix_mq_attr;
             }
             p = lock_user_string(arg1 - 1);
             if (!p) {
-                goto efault;
+                return -TARGET_EFAULT;
             }
             ret = get_errno(mq_open(p, host_flags, arg3, pposix_mq_attr));
             unlock_user (p, arg1, 0);
@@ -12065,25 +12077,25 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             loff_t *ploff_in = NULL, *ploff_out = NULL;
             if (arg2) {
                 if (get_user_u64(loff_in, arg2)) {
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
                 ploff_in = &loff_in;
             }
             if (arg4) {
                 if (get_user_u64(loff_out, arg4)) {
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
                 ploff_out = &loff_out;
             }
             ret = get_errno(splice(arg1, ploff_in, arg3, ploff_out, arg5, arg6));
             if (arg2) {
                 if (put_user_u64(loff_in, arg2)) {
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
             }
             if (arg4) {
                 if (put_user_u64(loff_out, arg4)) {
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
             }
         }
@@ -12193,7 +12205,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         if (arg4) {
             struct target_epoll_event *target_ep;
             if (!lock_user_struct(VERIFY_READ, target_ep, arg4, 1)) {
-                goto efault;
+                return -TARGET_EFAULT;
             }
             ep.events = tswap32(target_ep->events);
             /* The epoll_data_t union is just opaque data to the kernel,
@@ -12229,7 +12241,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         target_ep = lock_user(VERIFY_WRITE, arg2,
                               maxevents * sizeof(struct target_epoll_event), 1);
         if (!target_ep) {
-            goto efault;
+            return -TARGET_EFAULT;
         }
 
         ep = g_try_new(struct epoll_event, maxevents);
@@ -12301,7 +12313,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         int resource = target_to_host_resource(arg2);
         if (arg3) {
             if (!lock_user_struct(VERIFY_READ, target_rnew, arg3, 1)) {
-                goto efault;
+                return -TARGET_EFAULT;
             }
             rnew.rlim_cur = tswap64(target_rnew->rlim_cur);
             rnew.rlim_max = tswap64(target_rnew->rlim_max);
@@ -12312,7 +12324,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         ret = get_errno(sys_prlimit64(arg1, resource, rnewp, arg4 ? &rold : 0));
         if (!is_error(ret) && arg4) {
             if (!lock_user_struct(VERIFY_WRITE, target_rold, arg4, 1)) {
-                goto efault;
+                return -TARGET_EFAULT;
             }
             target_rold->rlim_cur = tswap64(rold.rlim_cur);
             target_rold->rlim_max = tswap64(rold.rlim_max);
@@ -12390,7 +12402,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 phtimer = NULL;
             } else {
                 if (put_user(TIMER_MAGIC | timer_index, arg3, target_timer_t)) {
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
             }
         }
@@ -12414,12 +12426,12 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             struct itimerspec hspec_new = {{0},}, hspec_old = {{0},};
 
             if (target_to_host_itimerspec(&hspec_new, arg3)) {
-                goto efault;
+                return -TARGET_EFAULT;
             }
             ret = get_errno(
                           timer_settime(htimer, arg2, &hspec_new, &hspec_old));
             if (arg4 && host_to_target_itimerspec(arg4, &hspec_old)) {
-                goto efault;
+                return -TARGET_EFAULT;
             }
         }
         return ret;
@@ -12497,7 +12509,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(timerfd_gettime(arg1, &its_curr));
 
             if (arg2 && host_to_target_itimerspec(arg2, &its_curr)) {
-                goto efault;
+                return -TARGET_EFAULT;
             }
         }
         return ret;
@@ -12510,7 +12522,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 
             if (arg3) {
                 if (target_to_host_itimerspec(&its_new, arg3)) {
-                    goto efault;
+                    return -TARGET_EFAULT;
                 }
                 p_new = &its_new;
             } else {
@@ -12520,7 +12532,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(timerfd_settime(arg1, arg2, p_new, &its_old));
 
             if (arg4 && host_to_target_itimerspec(arg4, &its_old)) {
-                goto efault;
+                return -TARGET_EFAULT;
             }
         }
         return ret;
@@ -12559,9 +12571,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
     }
 fail:
     return ret;
-efault:
-    ret = -TARGET_EFAULT;
-    goto fail;
 }
 
 abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 005/108] linux-user: Propagate goto unimplemented_nowarn to return
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (3 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 004/108] linux-user: Propagate goto efault to return Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 006/108] linux-user: Propagate goto unimplemented to default Richard Henderson
                   ` (106 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index a6b8268332..06205d3d65 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -11807,7 +11807,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
           return 0;
       }
 #else
-      goto unimplemented_nowarn;
+      return -TARGET_ENOSYS;
 #endif
 #endif
 #ifdef TARGET_NR_get_thread_area
@@ -11820,12 +11820,12 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             return ts->tp_value;
         }
 #else
-        goto unimplemented_nowarn;
+        return -TARGET_ENOSYS;
 #endif
 #endif
 #ifdef TARGET_NR_getdomainname
     case TARGET_NR_getdomainname:
-        goto unimplemented_nowarn;
+        return -TARGET_ENOSYS;
 #endif
 
 #ifdef TARGET_NR_clock_settime
@@ -11910,7 +11910,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
          * holding a mutex that is shared with another process via
          * shared memory).
          */
-        goto unimplemented_nowarn;
+        return -TARGET_ENOSYS;
 #endif
 
 #if defined(TARGET_NR_utimensat)
@@ -12564,9 +12564,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
     default:
     unimplemented:
         gemu_log("qemu: Unsupported syscall: %d\n", num);
-#if defined(TARGET_NR_setxattr) || defined(TARGET_NR_get_thread_area) || defined(TARGET_NR_getdomainname) || defined(TARGET_NR_set_robust_list)
-    unimplemented_nowarn:
-#endif
         return -TARGET_ENOSYS;
     }
 fail:
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 006/108] linux-user: Propagate goto unimplemented to default
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (4 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 005/108] linux-user: Propagate goto unimplemented_nowarn " Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 007/108] linux-user: Propagate goto fail to return Richard Henderson
                   ` (105 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

There is no point in listing a syscall if you want the same effect as
not listing it.  In one less trivial case, the goto was demonstrably
not reachable.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 144 +------------------------------------------
 1 file changed, 1 insertion(+), 143 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 06205d3d65..5a17803732 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8297,14 +8297,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         ret = get_errno(chmod(p, arg2));
         unlock_user(p, arg1, 0);
         return ret;
-#endif
-#ifdef TARGET_NR_break
-    case TARGET_NR_break:
-        goto unimplemented;
-#endif
-#ifdef TARGET_NR_oldstat
-    case TARGET_NR_oldstat:
-        goto unimplemented;
 #endif
     case TARGET_NR_lseek:
         return get_errno(lseek(arg1, arg2, arg3));
@@ -8390,16 +8382,10 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             return get_errno(stime(&host_time));
         }
 #endif
-    case TARGET_NR_ptrace:
-        goto unimplemented;
 #ifdef TARGET_NR_alarm /* not on alpha */
     case TARGET_NR_alarm:
         return alarm(arg1);
 #endif
-#ifdef TARGET_NR_oldfstat
-    case TARGET_NR_oldfstat:
-        goto unimplemented;
-#endif
 #ifdef TARGET_NR_pause /* not on alpha */
     case TARGET_NR_pause:
         if (!block_signals()) {
@@ -8470,14 +8456,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         }
         return ret;
 #endif
-#ifdef TARGET_NR_stty
-    case TARGET_NR_stty:
-        goto unimplemented;
-#endif
-#ifdef TARGET_NR_gtty
-    case TARGET_NR_gtty:
-        goto unimplemented;
-#endif
 #ifdef TARGET_NR_access
     case TARGET_NR_access:
         if (!(p = lock_user_string(arg1))) {
@@ -8499,10 +8477,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_nice /* not on alpha */
     case TARGET_NR_nice:
         return get_errno(nice(arg1));
-#endif
-#ifdef TARGET_NR_ftime
-    case TARGET_NR_ftime:
-        goto unimplemented;
 #endif
     case TARGET_NR_sync:
         sync();
@@ -8616,14 +8590,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 ret = host_to_target_clock_t(ret);
         }
         return ret;
-#ifdef TARGET_NR_prof
-    case TARGET_NR_prof:
-        goto unimplemented;
-#endif
-#ifdef TARGET_NR_signal
-    case TARGET_NR_signal:
-        goto unimplemented;
-#endif
     case TARGET_NR_acct:
         if (arg1 == 0) {
             ret = get_errno(acct(NULL));
@@ -8642,31 +8608,15 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         ret = get_errno(umount2(p, arg2));
         unlock_user(p, arg1, 0);
         return ret;
-#endif
-#ifdef TARGET_NR_lock
-    case TARGET_NR_lock:
-        goto unimplemented;
 #endif
     case TARGET_NR_ioctl:
         return do_ioctl(arg1, arg2, arg3);
 #ifdef TARGET_NR_fcntl
     case TARGET_NR_fcntl:
         return do_fcntl(arg1, arg2, arg3);
-#endif
-#ifdef TARGET_NR_mpx
-    case TARGET_NR_mpx:
-        goto unimplemented;
 #endif
     case TARGET_NR_setpgid:
         return get_errno(setpgid(arg1, arg2));
-#ifdef TARGET_NR_ulimit
-    case TARGET_NR_ulimit:
-        goto unimplemented;
-#endif
-#ifdef TARGET_NR_oldolduname
-    case TARGET_NR_oldolduname:
-        goto unimplemented;
-#endif
     case TARGET_NR_umask:
         return get_errno(umask(arg1));
     case TARGET_NR_chroot:
@@ -8675,10 +8625,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         ret = get_errno(chroot(p));
         unlock_user(p, arg1, 0);
         return ret;
-#ifdef TARGET_NR_ustat
-    case TARGET_NR_ustat:
-        goto unimplemented;
-#endif
 #ifdef TARGET_NR_dup2
     case TARGET_NR_dup2:
         ret = get_errno(dup2(arg1, arg2));
@@ -9386,10 +9332,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         }
         return ret;
 #endif
-#ifdef TARGET_NR_oldlstat
-    case TARGET_NR_oldlstat:
-        goto unimplemented;
-#endif
 #ifdef TARGET_NR_readlink
     case TARGET_NR_readlink:
         {
@@ -9443,10 +9385,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         }
         return ret;
 #endif
-#ifdef TARGET_NR_uselib
-    case TARGET_NR_uselib:
-        goto unimplemented;
-#endif
 #ifdef TARGET_NR_swapon
     case TARGET_NR_swapon:
         if (!(p = lock_user_string(arg1)))
@@ -9468,10 +9406,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
            ret = get_errno(reboot(arg1, arg2, arg3, NULL));
         }
         return ret;
-#ifdef TARGET_NR_readdir
-    case TARGET_NR_readdir:
-        goto unimplemented;
-#endif
 #ifdef TARGET_NR_mmap
     case TARGET_NR_mmap:
 #if (defined(TARGET_I386) && defined(TARGET_ABI32)) || \
@@ -9588,10 +9522,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         return ret;
     case TARGET_NR_setpriority:
         return get_errno(setpriority(arg1, arg2, arg3));
-#ifdef TARGET_NR_profil
-    case TARGET_NR_profil:
-        goto unimplemented;
-#endif
     case TARGET_NR_statfs:
         if (!(p = lock_user_string(arg1))) {
             return -TARGET_EFAULT;
@@ -9659,10 +9589,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         ret = get_errno(fstatfs(arg1, &stfs));
         goto convert_statfs64;
 #endif
-#ifdef TARGET_NR_ioperm
-    case TARGET_NR_ioperm:
-        goto unimplemented;
-#endif
 #ifdef TARGET_NR_socketcall
     case TARGET_NR_socketcall:
         return do_socketcall(arg1, arg2);
@@ -9880,20 +9806,8 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
         }
         return ret;
-#ifdef TARGET_NR_olduname
-    case TARGET_NR_olduname:
-        goto unimplemented;
-#endif
-#ifdef TARGET_NR_iopl
-    case TARGET_NR_iopl:
-        goto unimplemented;
-#endif
     case TARGET_NR_vhangup:
         return get_errno(vhangup());
-#ifdef TARGET_NR_idle
-    case TARGET_NR_idle:
-        goto unimplemented;
-#endif
 #ifdef TARGET_NR_syscall
     case TARGET_NR_syscall:
         return do_syscall(cpu_env, arg1 & 0xffff, arg2, arg3, arg4, arg5,
@@ -10069,8 +9983,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_modify_ldt:
         return do_modify_ldt(cpu_env, arg1, arg2, arg3);
 #if !defined(TARGET_X86_64)
-    case TARGET_NR_vm86old:
-        goto unimplemented;
     case TARGET_NR_vm86:
         return do_vm86(cpu_env, arg1, arg2);
 #endif
@@ -10107,35 +10019,12 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         }
         return ret;
 #endif
-#ifdef TARGET_NR_create_module
-    case TARGET_NR_create_module:
-#endif
-    case TARGET_NR_init_module:
-    case TARGET_NR_delete_module:
-#ifdef TARGET_NR_get_kernel_syms
-    case TARGET_NR_get_kernel_syms:
-#endif
-        goto unimplemented;
-    case TARGET_NR_quotactl:
-        goto unimplemented;
     case TARGET_NR_getpgid:
         return get_errno(getpgid(arg1));
     case TARGET_NR_fchdir:
         return get_errno(fchdir(arg1));
-#ifdef TARGET_NR_bdflush /* not on x86_64 */
-    case TARGET_NR_bdflush:
-        goto unimplemented;
-#endif
-#ifdef TARGET_NR_sysfs
-    case TARGET_NR_sysfs:
-        goto unimplemented;
-#endif
     case TARGET_NR_personality:
         return get_errno(personality(arg1));
-#ifdef TARGET_NR_afs_syscall
-    case TARGET_NR_afs_syscall:
-        goto unimplemented;
-#endif
 #ifdef TARGET_NR__llseek /* Not on alpha */
     case TARGET_NR__llseek:
         {
@@ -10648,14 +10537,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             }
         }
         return ret;
-#ifdef TARGET_NR_query_module
-    case TARGET_NR_query_module:
-        goto unimplemented;
-#endif
-#ifdef TARGET_NR_nfsservctl
-    case TARGET_NR_nfsservctl:
-        goto unimplemented;
-#endif
     case TARGET_NR_prctl:
         switch (arg1) {
         case PR_GET_PDEATHSIG:
@@ -10734,7 +10615,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #if defined(TARGET_I386) && !defined(TARGET_ABI32)
         return do_arch_prctl(cpu_env, arg1, arg2);
 #else
-        goto unimplemented;
+#error unreachable
 #endif
 #endif
 #ifdef TARGET_NR_pread64
@@ -10882,21 +10763,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         return ret;
     }
 #endif
-#else
-    case TARGET_NR_sendfile:
-#ifdef TARGET_NR_sendfile64
-    case TARGET_NR_sendfile64:
-#endif
-        goto unimplemented;
-#endif
-
-#ifdef TARGET_NR_getpmsg
-    case TARGET_NR_getpmsg:
-        goto unimplemented;
-#endif
-#ifdef TARGET_NR_putpmsg
-    case TARGET_NR_putpmsg:
-        goto unimplemented;
 #endif
 #ifdef TARGET_NR_vfork
     case TARGET_NR_vfork:
@@ -11439,9 +11305,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_setfsgid32:
         return get_errno(setfsgid(arg1));
 #endif
-
-    case TARGET_NR_pivot_root:
-        goto unimplemented;
 #ifdef TARGET_NR_mincore
     case TARGET_NR_mincore:
         {
@@ -11599,10 +11462,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         /* self-modifying code is handled automatically, so nothing needed */
         return 0;
 #endif
-#ifdef TARGET_NR_security
-    case TARGET_NR_security:
-        goto unimplemented;
-#endif
 #ifdef TARGET_NR_getpagesize
     case TARGET_NR_getpagesize:
         return TARGET_PAGE_SIZE;
@@ -12562,7 +12421,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #endif
 
     default:
-    unimplemented:
         gemu_log("qemu: Unsupported syscall: %d\n", num);
         return -TARGET_ENOSYS;
     }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 007/108] linux-user: Propagate goto fail to return
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (5 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 006/108] linux-user: Propagate goto unimplemented to default Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 008/108] linux-user: Make syscall number unsigned Richard Henderson
                   ` (104 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 60 ++++++++++++++++----------------------------
 1 file changed, 22 insertions(+), 38 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5a17803732..fd8d48b0da 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8865,8 +8865,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 how = SIG_SETMASK;
                 break;
             default:
-                ret = -TARGET_EINVAL;
-                goto fail;
+                return -TARGET_EINVAL;
             }
             mask = arg2;
             target_to_host_old_sigset(&set, &mask);
@@ -8893,8 +8892,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     how = SIG_SETMASK;
                     break;
                 default:
-                    ret = -TARGET_EINVAL;
-                    goto fail;
+                    return -TARGET_EINVAL;
                 }
                 if (!(p = lock_user(VERIFY_READ, arg2, sizeof(target_sigset_t), 1)))
                     return -TARGET_EFAULT;
@@ -8937,8 +8935,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     how = SIG_SETMASK;
                     break;
                 default:
-                    ret = -TARGET_EINVAL;
-                    goto fail;
+                    return -TARGET_EINVAL;
                 }
                 if (!(p = lock_user(VERIFY_READ, arg2, sizeof(target_sigset_t), 1)))
                     return -TARGET_EFAULT;
@@ -9227,15 +9224,15 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 
             ret = copy_from_user_fdset_ptr(&rfds, &rfds_ptr, rfd_addr, n);
             if (ret) {
-                goto fail;
+                return ret;
             }
             ret = copy_from_user_fdset_ptr(&wfds, &wfds_ptr, wfd_addr, n);
             if (ret) {
-                goto fail;
+                return ret;
             }
             ret = copy_from_user_fdset_ptr(&efds, &efds_ptr, efd_addr, n);
             if (ret) {
-                goto fail;
+                return ret;
             }
 
             /*
@@ -9268,8 +9265,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     sig.set = &set;
                     if (arg_sigsize != sizeof(*target_sigset)) {
                         /* Like the kernel, we enforce correct size sigsets */
-                        ret = -TARGET_EINVAL;
-                        goto fail;
+                        return -TARGET_EINVAL;
                     }
                     target_sigset = lock_user(VERIFY_READ, arg_sigset,
                                               sizeof(*target_sigset), 1);
@@ -9700,17 +9696,15 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             case TARGET_SYSLOG_ACTION_READ_CLEAR:    /* Read/clear msgs */
             case TARGET_SYSLOG_ACTION_READ_ALL:      /* Read last messages */
                 {
-                    ret = -TARGET_EINVAL;
                     if (len < 0) {
-                        goto fail;
+                        return -TARGET_EINVAL;
                     }
                     if (len == 0) {
                         return 0;
                     }
                     p = lock_user(VERIFY_WRITE, arg2, arg3, 0);
                     if (!p) {
-                        ret = -TARGET_EFAULT;
-                        goto fail;
+                        return -TARGET_EFAULT;
                     }
                     ret = get_errno(sys_syslog((int)arg1, p, (int)arg3));
                     unlock_user(p, arg2, arg3);
@@ -10056,8 +10050,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 
             dirp = g_try_malloc(count);
             if (!dirp) {
-                ret = -TARGET_ENOMEM;
-                goto fail;
+                return -TARGET_ENOMEM;
             }
 
             ret = get_errno(sys_getdents(arg1, dirp, count));
@@ -10456,7 +10449,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                                        arg2 ? &node : NULL,
                                        NULL));
             if (is_error(ret)) {
-                goto fail;
+                return ret;
             }
             if (arg1 && put_user_u32(cpu, arg1)) {
                 return -TARGET_EFAULT;
@@ -10903,8 +10896,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 grouplist = alloca(gidsetsize * sizeof(gid_t));
                 target_grouplist = lock_user(VERIFY_READ, arg2, gidsetsize * sizeof(target_id), 1);
                 if (!target_grouplist) {
-                    ret = -TARGET_EFAULT;
-                    goto fail;
+                    return -TARGET_EFAULT;
                 }
                 for (i = 0; i < gidsetsize; i++) {
                     grouplist[i] = low2highgid(tswapid(target_grouplist[i]));
@@ -11162,8 +11154,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 how = SIG_SETMASK;
                 break;
             default:
-                ret = -TARGET_EINVAL;
-                goto fail;
+                return -TARGET_EINVAL;
             }
             mask = arg2;
             target_to_host_old_sigset(&set, &mask);
@@ -11211,8 +11202,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             if (!is_error(ret)) {
                 target_grouplist = lock_user(VERIFY_WRITE, arg2, gidsetsize * 4, 0);
                 if (!target_grouplist) {
-                    ret = -TARGET_EFAULT;
-                    goto fail;
+                    return -TARGET_EFAULT;
                 }
                 for(i = 0;i < ret; i++)
                     target_grouplist[i] = tswap32(grouplist[i]);
@@ -11232,8 +11222,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             grouplist = alloca(gidsetsize * sizeof(gid_t));
             target_grouplist = lock_user(VERIFY_READ, arg2, gidsetsize * 4, 1);
             if (!target_grouplist) {
-                ret = -TARGET_EFAULT;
-                goto fail;
+                return -TARGET_EFAULT;
             }
             for(i = 0;i < gidsetsize; i++)
                 grouplist[i] = tswap32(target_grouplist[i]);
@@ -11308,20 +11297,17 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_mincore
     case TARGET_NR_mincore:
         {
-            void *a;
-            ret = -TARGET_ENOMEM;
-            a = lock_user(VERIFY_READ, arg1, arg2, 0);
+            void *a = lock_user(VERIFY_READ, arg1, arg2, 0);
             if (!a) {
-                goto fail;
+                return -TARGET_ENOMEM;
             }
-            ret = -TARGET_EFAULT;
             p = lock_user_string(arg3);
             if (!p) {
-                goto mincore_fail;
+                ret = -TARGET_EFAULT;
+            } else {
+                ret = get_errno(mincore(a, arg2, p));
+                unlock_user(p, arg3, ret);
             }
-            ret = get_errno(mincore(a, arg2, p));
-            unlock_user(p, arg3, ret);
-            mincore_fail:
             unlock_user(a, arg1, 0);
         }
         return ret;
@@ -11787,8 +11773,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 ret = get_errno(sys_utimensat(arg1, NULL, tsp, arg4));
             else {
                 if (!(p = lock_user_string(arg2))) {
-                    ret = -TARGET_EFAULT;
-                    goto fail;
+                    return -TARGET_EFAULT;
                 }
                 ret = get_errno(sys_utimensat(arg1, path(p), tsp, arg4));
                 unlock_user(p, arg2, 0);
@@ -12424,7 +12409,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         gemu_log("qemu: Unsupported syscall: %d\n", num);
         return -TARGET_ENOSYS;
     }
-fail:
     return ret;
 }
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 008/108] linux-user: Make syscall number unsigned
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (6 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 007/108] linux-user: Propagate goto fail to return Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 009/108] linux-user: Set up infrastructure for table-izing syscalls Richard Henderson
                   ` (103 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/qemu.h    |  2 +-
 linux-user/syscall.c | 16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index 6fa1e968db..c628a5a05c 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -201,7 +201,7 @@ abi_long memcpy_to_target(abi_ulong dest, const void *src,
 void target_set_brk(abi_ulong new_brk);
 abi_long do_brk(abi_ulong new_brk);
 void syscall_init(void);
-abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+abi_long do_syscall(void *cpu_env, unsigned num, abi_long arg1,
                     abi_long arg2, abi_long arg3, abi_long arg4,
                     abi_long arg5, abi_long arg6, abi_long arg7,
                     abi_long arg8);
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index fd8d48b0da..46f123ee13 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -719,20 +719,20 @@ static inline int next_free_host_timer(void)
 
 /* ARM EABI and MIPS expect 64bit types aligned even on pairs or registers */
 #ifdef TARGET_ARM
-static inline int regpairs_aligned(void *cpu_env, int num)
+static inline int regpairs_aligned(void *cpu_env, unsigned num)
 {
     return ((((CPUARMState *)cpu_env)->eabi) == 1) ;
 }
 #elif defined(TARGET_MIPS) && (TARGET_ABI_BITS == 32)
-static inline int regpairs_aligned(void *cpu_env, int num) { return 1; }
+static inline int regpairs_aligned(void *cpu_env, unsigned num) { return 1; }
 #elif defined(TARGET_PPC) && !defined(TARGET_PPC64)
 /* SysV AVI for PPC32 expects 64bit parameters to be passed on odd/even pairs
  * of registers which translates to the same as ARM/MIPS, because we start with
  * r3 as arg1 */
-static inline int regpairs_aligned(void *cpu_env, int num) { return 1; }
+static inline int regpairs_aligned(void *cpu_env, unsigned num) { return 1; }
 #elif defined(TARGET_SH4)
 /* SH4 doesn't align register pairs, except for p{read,write}64 */
-static inline int regpairs_aligned(void *cpu_env, int num)
+static inline int regpairs_aligned(void *cpu_env, unsigned num)
 {
     switch (num) {
     case TARGET_NR_pread64:
@@ -744,9 +744,9 @@ static inline int regpairs_aligned(void *cpu_env, int num)
     }
 }
 #elif defined(TARGET_XTENSA)
-static inline int regpairs_aligned(void *cpu_env, int num) { return 1; }
+static inline int regpairs_aligned(void *cpu_env, unsigned num) { return 1; }
 #else
-static inline int regpairs_aligned(void *cpu_env, int num) { return 0; }
+static inline int regpairs_aligned(void *cpu_env, unsigned num) { return 0; }
 #endif
 
 #define ERRNO_TABLE_SIZE 1200
@@ -7952,7 +7952,7 @@ static int host_to_target_cpu_mask(const unsigned long *host_mask,
  * of syscall results, can be performed.
  * All errnos that do_syscall() returns must be -TARGET_<errcode>.
  */
-static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
+static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
                             abi_long arg2, abi_long arg3, abi_long arg4,
                             abi_long arg5, abi_long arg6, abi_long arg7,
                             abi_long arg8)
@@ -12412,7 +12412,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
     return ret;
 }
 
-abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+abi_long do_syscall(void *cpu_env, unsigned num, abi_long arg1,
                     abi_long arg2, abi_long arg3, abi_long arg4,
                     abi_long arg5, abi_long arg6, abi_long arg7,
                     abi_long arg8)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 009/108] linux-user: Set up infrastructure for table-izing syscalls
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (7 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 008/108] linux-user: Make syscall number unsigned Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10 12:32   ` Peter Maydell
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 010/108] linux-user: Split out brk, close, exit, read, write Richard Henderson
                   ` (102 subsequent siblings)
  111 siblings, 1 reply; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

At the same time, split out set_robust_list and get_robust_list.
Put them together, along with their block comment, at the top
of syscall_table.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 87 +++++++++++++++++++++++++++++++++-----------
 1 file changed, 66 insertions(+), 21 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 46f123ee13..8678e749ee 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7947,6 +7947,17 @@ static int host_to_target_cpu_mask(const unsigned long *host_mask,
     return 0;
 }
 
+typedef abi_long impl_fn(void *cpu_env, unsigned num, abi_long arg1,
+                         abi_long arg2, abi_long arg3, abi_long arg4,
+                         abi_long arg5, abi_long arg6, abi_long arg7,
+                         abi_long arg8);
+
+#define IMPL(NAME) \
+static abi_long impl_##NAME(void *cpu_env, unsigned num, abi_long arg1,   \
+                            abi_long arg2, abi_long arg3, abi_long arg4,  \
+                            abi_long arg5, abi_long arg6, abi_long arg7,  \
+                            abi_long arg8)
+
 /* This is an internal helper for do_syscall so that it is easier
  * to have a single return point, so that actions, such as logging
  * of syscall results, can be performed.
@@ -11740,23 +11751,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
         return get_errno(safe_tgkill((int)arg1, (int)arg2,
                          target_to_host_signal(arg3)));
 
-#ifdef TARGET_NR_set_robust_list
-    case TARGET_NR_set_robust_list:
-    case TARGET_NR_get_robust_list:
-        /* The ABI for supporting robust futexes has userspace pass
-         * the kernel a pointer to a linked list which is updated by
-         * userspace after the syscall; the list is walked by the kernel
-         * when the thread exits. Since the linked list in QEMU guest
-         * memory isn't a valid linked list for the host and we have
-         * no way to reliably intercept the thread-death event, we can't
-         * support these. Silently return ENOSYS so that guest userspace
-         * falls back to a non-robust futex implementation (which should
-         * be OK except in the corner case of the guest crashing while
-         * holding a mutex that is shared with another process via
-         * shared memory).
-         */
-        return -TARGET_ENOSYS;
-#endif
 
 #if defined(TARGET_NR_utimensat)
     case TARGET_NR_utimensat:
@@ -12412,6 +12406,54 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     return ret;
 }
 
+/* The default action for a syscall not listed in syscall_table is to
+ * log the missing syscall.  If a syscall is intentionally emulated as
+ * not present, then list it with impl_enosys as the implementation,
+ * which will avoid the logging.
+ */
+IMPL(enosys)
+{
+    return -TARGET_ENOSYS;
+}
+
+/* For a given syscall number, return a function implementing it.
+ * Do this via switch statement instead of table because some targets
+ * do not begin at 0 and others have a large split in the middle of
+ * the numbers.  The compiler should be able to produce a dense table.
+ */
+static impl_fn *syscall_table(unsigned num)
+{
+#define SYSCALL_WITH(X, Y)    case TARGET_NR_##X: return impl_##Y
+#define SYSCALL(X)            SYSCALL_WITH(X, X)
+
+    switch (num) {
+        /* The ABI for supporting robust futexes has userspace pass
+         * the kernel a pointer to a linked list which is updated by
+         * userspace after the syscall; the list is walked by the kernel
+         * when the thread exits. Since the linked list in QEMU guest
+         * memory isn't a valid linked list for the host and we have
+         * no way to reliably intercept the thread-death event, we can't
+         * support these. Silently return ENOSYS so that guest userspace
+         * falls back to a non-robust futex implementation (which should
+         * be OK except in the corner case of the guest crashing while
+         * holding a mutex that is shared with another process via
+         * shared memory).
+         */
+        SYSCALL_WITH(get_robust_list, enosys);
+        SYSCALL_WITH(set_robust_list, enosys);
+
+        /*
+         * Other syscalls listed in collation order, with '_' ignored.
+         */
+    }
+
+#undef SYSCALL
+#undef SYSCALL_WITH
+
+    /* After do_syscall1 is fully split, this will be impl_enosys.  */
+    return do_syscall1;
+}
+
 abi_long do_syscall(void *cpu_env, unsigned num, abi_long arg1,
                     abi_long arg2, abi_long arg3, abi_long arg4,
                     abi_long arg5, abi_long arg6, abi_long arg7,
@@ -12419,6 +12461,7 @@ abi_long do_syscall(void *cpu_env, unsigned num, abi_long arg1,
 {
     CPUState *cpu = ENV_GET_CPU(cpu_env);
     abi_long ret;
+    impl_fn *fn;
 
 #ifdef DEBUG_ERESTARTSYS
     /* Debug-only code for exercising the syscall-restart code paths
@@ -12437,14 +12480,16 @@ abi_long do_syscall(void *cpu_env, unsigned num, abi_long arg1,
     trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4,
                              arg5, arg6, arg7, arg8);
 
+    fn = syscall_table(num);
+
     if (unlikely(do_strace)) {
         print_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6);
-        ret = do_syscall1(cpu_env, num, arg1, arg2, arg3, arg4,
-                          arg5, arg6, arg7, arg8);
+        ret = fn(cpu_env, num, arg1, arg2, arg3, arg4,
+                 arg5, arg6, arg7, arg8);
         print_syscall_ret(num, ret);
     } else {
-        ret = do_syscall1(cpu_env, num, arg1, arg2, arg3, arg4,
-                          arg5, arg6, arg7, arg8);
+        ret = fn(cpu_env, num, arg1, arg2, arg3, arg4,
+                 arg5, arg6, arg7, arg8);
     }
 
     trace_guest_user_syscall_ret(cpu, num, ret);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 010/108] linux-user: Split out brk, close, exit, read, write
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (8 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 009/108] linux-user: Set up infrastructure for table-izing syscalls Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 011/108] linux-user: Split out execve Richard Henderson
                   ` (101 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

These are relatively simple unconditionally defined syscalls.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 179 ++++++++++++++++++++++++-------------------
 1 file changed, 102 insertions(+), 77 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8678e749ee..6d2f9915ec 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7958,6 +7958,103 @@ static abi_long impl_##NAME(void *cpu_env, unsigned num, abi_long arg1,   \
                             abi_long arg5, abi_long arg6, abi_long arg7,  \
                             abi_long arg8)
 
+IMPL(brk)
+{
+    return do_brk(arg1);
+}
+
+IMPL(close)
+{
+    fd_trans_unregister(arg1);
+    return get_errno(close(arg1));
+}
+
+IMPL(exit)
+{
+    CPUState *cpu = ENV_GET_CPU(cpu_env);
+
+    /* In old applications this may be used to implement _exit(2).
+       However in threaded applictions it is used for thread termination,
+       and _exit_group is used for application termination.
+       Do thread termination if we have more then one thread.  */
+    if (block_signals()) {
+        return -TARGET_ERESTARTSYS;
+    }
+
+    cpu_list_lock();
+
+    if (CPU_NEXT(first_cpu)) {
+        /* Remove the CPU from the list.  */
+        QTAILQ_REMOVE(&cpus, cpu, node);
+        cpu_list_unlock();
+
+        TaskState *ts = cpu->opaque;
+        if (ts->child_tidptr) {
+            put_user_u32(0, ts->child_tidptr);
+            sys_futex(g2h(ts->child_tidptr), FUTEX_WAKE, INT_MAX,
+                      NULL, NULL, 0);
+        }
+        thread_cpu = NULL;
+        object_unref(OBJECT(cpu));
+        g_free(ts);
+        rcu_unregister_thread();
+        pthread_exit(NULL);
+    } else {
+        cpu_list_unlock();
+
+#ifdef TARGET_GPROF
+        _mcleanup();
+#endif
+        gdb_exit(cpu_env, arg1);
+        _exit(arg1);
+    }
+    g_assert_not_reached();
+}
+
+IMPL(read)
+{
+    abi_long ret;
+    char *p;
+
+    if (arg3 == 0) {
+        return 0;
+    }
+    p = lock_user(VERIFY_WRITE, arg2, arg3, 0);
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(safe_read(arg1, p, arg3));
+    if (ret >= 0 && fd_trans_host_to_target_data(arg1)) {
+        ret = fd_trans_host_to_target_data(arg1)(p, ret);
+    }
+    unlock_user(p, arg2, ret);
+    return ret;
+}
+
+IMPL(write)
+{
+    abi_long ret;
+    char *p;
+
+    p = lock_user(VERIFY_READ, arg2, arg3, 1);
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    if (fd_trans_target_to_host_data(arg1)) {
+        void *copy = g_malloc(arg3);
+        memcpy(copy, p, arg3);
+        ret = fd_trans_target_to_host_data(arg1)(copy, arg3);
+        if (ret >= 0) {
+            ret = get_errno(safe_write(arg1, copy, ret));
+        }
+        g_free(copy);
+    } else {
+        ret = get_errno(safe_write(arg1, p, arg3));
+    }
+    unlock_user(p, arg2, ret);
+    return ret;
+}
+
 /* This is an internal helper for do_syscall so that it is easier
  * to have a single return point, so that actions, such as logging
  * of syscall results, can be performed.
@@ -7975,77 +8072,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_exit:
-        /* In old applications this may be used to implement _exit(2).
-           However in threaded applictions it is used for thread termination,
-           and _exit_group is used for application termination.
-           Do thread termination if we have more then one thread.  */
-
-        if (block_signals()) {
-            return -TARGET_ERESTARTSYS;
-        }
-
-        cpu_list_lock();
-
-        if (CPU_NEXT(first_cpu)) {
-            TaskState *ts;
-
-            /* Remove the CPU from the list.  */
-            QTAILQ_REMOVE(&cpus, cpu, node);
-
-            cpu_list_unlock();
-
-            ts = cpu->opaque;
-            if (ts->child_tidptr) {
-                put_user_u32(0, ts->child_tidptr);
-                sys_futex(g2h(ts->child_tidptr), FUTEX_WAKE, INT_MAX,
-                          NULL, NULL, 0);
-            }
-            thread_cpu = NULL;
-            object_unref(OBJECT(cpu));
-            g_free(ts);
-            rcu_unregister_thread();
-            pthread_exit(NULL);
-        }
-
-        cpu_list_unlock();
-#ifdef TARGET_GPROF
-        _mcleanup();
-#endif
-        gdb_exit(cpu_env, arg1);
-        _exit(arg1);
-        return 0; /* avoid warning */
-    case TARGET_NR_read:
-        if (arg3 == 0) {
-            return 0;
-        } else {
-            if (!(p = lock_user(VERIFY_WRITE, arg2, arg3, 0)))
-                return -TARGET_EFAULT;
-            ret = get_errno(safe_read(arg1, p, arg3));
-            if (ret >= 0 &&
-                fd_trans_host_to_target_data(arg1)) {
-                ret = fd_trans_host_to_target_data(arg1)(p, ret);
-            }
-            unlock_user(p, arg2, ret);
-        }
-        return ret;
-    case TARGET_NR_write:
-        if (!(p = lock_user(VERIFY_READ, arg2, arg3, 1)))
-            return -TARGET_EFAULT;
-        if (fd_trans_target_to_host_data(arg1)) {
-            void *copy = g_malloc(arg3);
-            memcpy(copy, p, arg3);
-            ret = fd_trans_target_to_host_data(arg1)(copy, arg3);
-            if (ret >= 0) {
-                ret = get_errno(safe_write(arg1, copy, ret));
-            }
-            g_free(copy);
-        } else {
-            ret = get_errno(safe_write(arg1, p, arg3));
-        }
-        unlock_user(p, arg2, 0);
-        return ret;
-
 #ifdef TARGET_NR_open
     case TARGET_NR_open:
         if (!(p = lock_user_string(arg1)))
@@ -8077,12 +8103,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
         fd_trans_unregister(ret);
         return ret;
 #endif
-    case TARGET_NR_close:
-        fd_trans_unregister(arg1);
-        return get_errno(close(arg1));
-
-    case TARGET_NR_brk:
-        return do_brk(arg1);
 #ifdef TARGET_NR_fork
     case TARGET_NR_fork:
         return get_errno(do_fork(cpu_env, TARGET_SIGCHLD, 0, 0, 0, 0));
@@ -12445,6 +12465,11 @@ static impl_fn *syscall_table(unsigned num)
         /*
          * Other syscalls listed in collation order, with '_' ignored.
          */
+        SYSCALL(brk);
+        SYSCALL(close);
+        SYSCALL(exit);
+        SYSCALL(read);
+        SYSCALL(write);
     }
 
 #undef SYSCALL
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 011/108] linux-user: Split out execve
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (9 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 010/108] linux-user: Split out brk, close, exit, read, write Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 012/108] linux-user: Split out open, openat Richard Henderson
                   ` (100 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

At the same time, fix the repeated re-reading of the argv and env
arrays from guest memory.  Instead read into a unified array once.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 203 ++++++++++++++++++++++---------------------
 1 file changed, 106 insertions(+), 97 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 6d2f9915ec..aa6c4e1577 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7969,6 +7969,111 @@ IMPL(close)
     return get_errno(close(arg1));
 }
 
+IMPL(execve)
+{
+    abi_ulong *guest_ptrs;
+    char **host_ptrs;
+    int argc, envc, alloc, i;
+    abi_ulong gp;
+    abi_ulong guest_argp = arg2;
+    abi_ulong guest_envp = arg3;
+    char *filename;
+    abi_long ret;
+
+    /* Initial estimate of number of guest pointers required.  */
+    alloc = 32;
+    guest_ptrs = g_new(abi_ulong, alloc);
+
+    /* Iterate through argp and envp, counting entries, and
+     * reading guest addresses from the arrays.
+     */
+    for (gp = guest_argp, argc = 0; gp; gp += sizeof(abi_ulong)) {
+        abi_ulong addr;
+        if (get_user_ual(addr, gp)) {
+            return -TARGET_EFAULT;
+        }
+        if (!addr) {
+            break;
+        }
+        if (argc >= alloc) {
+            alloc *= 2;
+            guest_ptrs = g_renew(abi_ulong, guest_ptrs, alloc);
+        }
+        guest_ptrs[argc++] = addr;
+    }
+    for (gp = guest_envp, envc = 0; gp; gp += sizeof(abi_ulong)) {
+        abi_ulong addr;
+        if (get_user_ual(addr, gp)) {
+            return -TARGET_EFAULT;
+        }
+        if (!addr) {
+            break;
+        }
+        if (argc + envc >= alloc) {
+            alloc *= 2;
+            guest_ptrs = g_renew(abi_ulong, guest_ptrs, alloc);
+        }
+        guest_ptrs[argc + envc++] = addr;
+    }
+
+    /* Exact number of host pointers required.  */
+    host_ptrs = g_new0(char *, argc + envc + 2);
+
+    /* Iterate through the argp and envp that we already read
+     * and convert the guest pointers to host pointers.
+     */
+    ret = -TARGET_EFAULT;
+    for (i = 0; i < argc; ++i) {
+        char *p = lock_user_string(guest_ptrs[i]);
+        if (!p) {
+            goto fini;
+        }
+        host_ptrs[i] = p;
+    }
+    for (i = 0; i < envc; ++i) {
+        char *p = lock_user_string(guest_ptrs[argc + i]);
+        if (!p) {
+            goto fini;
+        }
+        host_ptrs[argc + 1 + i] = p;
+    }
+
+    /* Read the executable filename.  */
+    filename = lock_user_string(arg1);
+    if (!filename) {
+        goto fini;
+    }
+
+    /* Although execve() is not an interruptible syscall it is
+     * a special case where we must use the safe_syscall wrapper:
+     * if we allow a signal to happen before we make the host
+     * syscall then we will 'lose' it, because at the point of
+     * execve the process leaves QEMU's control. So we use the
+     * safe syscall wrapper to ensure that we either take the
+     * signal as a guest signal, or else it does not happen
+     * before the execve completes and makes it the other
+     * program's problem.
+     */
+    ret = get_errno(safe_execve(filename, host_ptrs, host_ptrs + argc + 1));
+    unlock_user(filename, arg1, 0);
+
+ fini:
+    /* Deallocate everything we allocated above.  */
+    for (i = 0; i < argc; ++i) {
+        if (host_ptrs[i]) {
+            unlock_user(host_ptrs[i], guest_ptrs[i], 0);
+        }
+    }
+    for (i = 0; i < envc; ++i) {
+        if (host_ptrs[argc + 1 + i]) {
+            unlock_user(host_ptrs[argc + 1 + i], guest_ptrs[argc + i], 0);
+        }
+    }
+    g_free(host_ptrs);
+    g_free(guest_ptrs);
+    return ret;
+}
+
 IMPL(exit)
 {
     CPUState *cpu = ENV_GET_CPU(cpu_env);
@@ -8190,103 +8295,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
         unlock_user(p, arg2, 0);
         return ret;
 #endif
-    case TARGET_NR_execve:
-        {
-            char **argp, **envp;
-            int argc, envc;
-            abi_ulong gp;
-            abi_ulong guest_argp;
-            abi_ulong guest_envp;
-            abi_ulong addr;
-            char **q;
-            int total_size = 0;
-
-            argc = 0;
-            guest_argp = arg2;
-            for (gp = guest_argp; gp; gp += sizeof(abi_ulong)) {
-                if (get_user_ual(addr, gp))
-                    return -TARGET_EFAULT;
-                if (!addr)
-                    break;
-                argc++;
-            }
-            envc = 0;
-            guest_envp = arg3;
-            for (gp = guest_envp; gp; gp += sizeof(abi_ulong)) {
-                if (get_user_ual(addr, gp))
-                    return -TARGET_EFAULT;
-                if (!addr)
-                    break;
-                envc++;
-            }
-
-            argp = g_new0(char *, argc + 1);
-            envp = g_new0(char *, envc + 1);
-
-            for (gp = guest_argp, q = argp; gp;
-                  gp += sizeof(abi_ulong), q++) {
-                if (get_user_ual(addr, gp))
-                    goto execve_efault;
-                if (!addr)
-                    break;
-                if (!(*q = lock_user_string(addr)))
-                    goto execve_efault;
-                total_size += strlen(*q) + 1;
-            }
-            *q = NULL;
-
-            for (gp = guest_envp, q = envp; gp;
-                  gp += sizeof(abi_ulong), q++) {
-                if (get_user_ual(addr, gp))
-                    goto execve_efault;
-                if (!addr)
-                    break;
-                if (!(*q = lock_user_string(addr)))
-                    goto execve_efault;
-                total_size += strlen(*q) + 1;
-            }
-            *q = NULL;
-
-            if (!(p = lock_user_string(arg1)))
-                goto execve_efault;
-            /* Although execve() is not an interruptible syscall it is
-             * a special case where we must use the safe_syscall wrapper:
-             * if we allow a signal to happen before we make the host
-             * syscall then we will 'lose' it, because at the point of
-             * execve the process leaves QEMU's control. So we use the
-             * safe syscall wrapper to ensure that we either take the
-             * signal as a guest signal, or else it does not happen
-             * before the execve completes and makes it the other
-             * program's problem.
-             */
-            ret = get_errno(safe_execve(p, argp, envp));
-            unlock_user(p, arg1, 0);
-
-            goto execve_end;
-
-        execve_efault:
-            ret = -TARGET_EFAULT;
-
-        execve_end:
-            for (gp = guest_argp, q = argp; *q;
-                  gp += sizeof(abi_ulong), q++) {
-                if (get_user_ual(addr, gp)
-                    || !addr)
-                    break;
-                unlock_user(*q, addr, 0);
-            }
-            for (gp = guest_envp, q = envp; *q;
-                  gp += sizeof(abi_ulong), q++) {
-                if (get_user_ual(addr, gp)
-                    || !addr)
-                    break;
-                unlock_user(*q, addr, 0);
-            }
-
-            g_free(argp);
-            g_free(envp);
-        }
-        return ret;
     case TARGET_NR_chdir:
         if (!(p = lock_user_string(arg1)))
             return -TARGET_EFAULT;
@@ -12467,6 +12475,7 @@ static impl_fn *syscall_table(unsigned num)
          */
         SYSCALL(brk);
         SYSCALL(close);
+        SYSCALL(execve);
         SYSCALL(exit);
         SYSCALL(read);
         SYSCALL(write);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 012/108] linux-user: Split out open, openat
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (10 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 011/108] linux-user: Split out execve Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 013/108] linux-user: Split out name_to_handle_at Richard Henderson
                   ` (99 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 58 +++++++++++++++++++++++++++++---------------
 1 file changed, 38 insertions(+), 20 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index aa6c4e1577..a4d0f2720f 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8116,6 +8116,40 @@ IMPL(exit)
     g_assert_not_reached();
 }
 
+#ifdef TARGET_NR_open
+IMPL(open)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(do_openat(cpu_env, AT_FDCWD, p,
+                              target_to_host_bitmask(arg2, fcntl_flags_tbl),
+                              arg3));
+    unlock_user(p, arg1, 0);
+    fd_trans_unregister(ret);
+    return ret;
+}
+#endif
+
+IMPL(openat)
+{
+    char *p = lock_user_string(arg2);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(do_openat(cpu_env, arg1, p,
+                              target_to_host_bitmask(arg3, fcntl_flags_tbl),
+                              arg4));
+    unlock_user(p, arg2, 0);
+    fd_trans_unregister(ret);
+    return ret;
+}
+
 IMPL(read)
 {
     abi_long ret;
@@ -8177,26 +8211,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_open
-    case TARGET_NR_open:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(do_openat(cpu_env, AT_FDCWD, p,
-                                  target_to_host_bitmask(arg2, fcntl_flags_tbl),
-                                  arg3));
-        fd_trans_unregister(ret);
-        unlock_user(p, arg1, 0);
-        return ret;
-#endif
-    case TARGET_NR_openat:
-        if (!(p = lock_user_string(arg2)))
-            return -TARGET_EFAULT;
-        ret = get_errno(do_openat(cpu_env, arg1, p,
-                                  target_to_host_bitmask(arg3, fcntl_flags_tbl),
-                                  arg4));
-        fd_trans_unregister(ret);
-        unlock_user(p, arg2, 0);
-        return ret;
 #if defined(TARGET_NR_name_to_handle_at) && defined(CONFIG_OPEN_BY_HANDLE)
     case TARGET_NR_name_to_handle_at:
         ret = do_name_to_handle_at(arg1, arg2, arg3, arg4, arg5);
@@ -12477,6 +12491,10 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(close);
         SYSCALL(execve);
         SYSCALL(exit);
+#ifdef TARGET_NR_open
+        SYSCALL(open);
+#endif
+        SYSCALL(openat);
         SYSCALL(read);
         SYSCALL(write);
     }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 013/108] linux-user: Split out name_to_handle_at
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (11 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 012/108] linux-user: Split out open, openat Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 014/108] linux-user: Split out open_to_handle_at Richard Henderson
                   ` (98 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

At the same time, merge do_name_to_handle_at into the new function.
All targets define this syscall; remove one of the two ifdefs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 116 +++++++++++++++++++++----------------------
 1 file changed, 58 insertions(+), 58 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index a4d0f2720f..90341f4254 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7361,59 +7361,6 @@ static int do_futex(target_ulong uaddr, int op, int val, target_ulong timeout,
         return -TARGET_ENOSYS;
     }
 }
-#if defined(TARGET_NR_name_to_handle_at) && defined(CONFIG_OPEN_BY_HANDLE)
-static abi_long do_name_to_handle_at(abi_long dirfd, abi_long pathname,
-                                     abi_long handle, abi_long mount_id,
-                                     abi_long flags)
-{
-    struct file_handle *target_fh;
-    struct file_handle *fh;
-    int mid = 0;
-    abi_long ret;
-    char *name;
-    unsigned int size, total_size;
-
-    if (get_user_s32(size, handle)) {
-        return -TARGET_EFAULT;
-    }
-
-    name = lock_user_string(pathname);
-    if (!name) {
-        return -TARGET_EFAULT;
-    }
-
-    total_size = sizeof(struct file_handle) + size;
-    target_fh = lock_user(VERIFY_WRITE, handle, total_size, 0);
-    if (!target_fh) {
-        unlock_user(name, pathname, 0);
-        return -TARGET_EFAULT;
-    }
-
-    fh = g_malloc0(total_size);
-    fh->handle_bytes = size;
-
-    ret = get_errno(name_to_handle_at(dirfd, path(name), fh, &mid, flags));
-    unlock_user(name, pathname, 0);
-
-    /* man name_to_handle_at(2):
-     * Other than the use of the handle_bytes field, the caller should treat
-     * the file_handle structure as an opaque data type
-     */
-
-    memcpy(target_fh, fh, total_size);
-    target_fh->handle_bytes = tswap32(fh->handle_bytes);
-    target_fh->handle_type = tswap32(fh->handle_type);
-    g_free(fh);
-    unlock_user(target_fh, handle, total_size);
-
-    if (put_user_s32(mid, mount_id)) {
-        return -TARGET_EFAULT;
-    }
-
-    return ret;
-
-}
-#endif
 
 #if defined(TARGET_NR_open_by_handle_at) && defined(CONFIG_OPEN_BY_HANDLE)
 static abi_long do_open_by_handle_at(abi_long mount_fd, abi_long handle,
@@ -8116,6 +8063,61 @@ IMPL(exit)
     g_assert_not_reached();
 }
 
+#ifdef CONFIG_OPEN_BY_HANDLE
+IMPL(name_to_handle_at)
+{
+    abi_long dirfd = arg1;
+    abi_long pathname = arg2;
+    abi_long handle = arg3;
+    abi_long mount_id = arg4;
+    abi_long flags = arg5;
+    struct file_handle *target_fh;
+    struct file_handle *fh;
+    int mid = 0;
+    abi_long ret;
+    char *name;
+    unsigned int size, total_size;
+
+    if (get_user_s32(size, handle)) {
+        return -TARGET_EFAULT;
+    }
+
+    name = lock_user_string(pathname);
+    if (!name) {
+        return -TARGET_EFAULT;
+    }
+
+    total_size = sizeof(struct file_handle) + size;
+    target_fh = lock_user(VERIFY_WRITE, handle, total_size, 0);
+    if (!target_fh) {
+        unlock_user(name, pathname, 0);
+        return -TARGET_EFAULT;
+    }
+
+    fh = g_malloc0(total_size);
+    fh->handle_bytes = size;
+
+    ret = get_errno(name_to_handle_at(dirfd, path(name), fh, &mid, flags));
+    unlock_user(name, pathname, 0);
+
+    /* man name_to_handle_at(2):
+     * Other than the use of the handle_bytes field, the caller should treat
+     * the file_handle structure as an opaque data type
+     */
+
+    memcpy(target_fh, fh, total_size);
+    target_fh->handle_bytes = tswap32(fh->handle_bytes);
+    target_fh->handle_type = tswap32(fh->handle_type);
+    g_free(fh);
+    unlock_user(target_fh, handle, total_size);
+
+    if (put_user_s32(mid, mount_id)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_open
 IMPL(open)
 {
@@ -8211,11 +8213,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#if defined(TARGET_NR_name_to_handle_at) && defined(CONFIG_OPEN_BY_HANDLE)
-    case TARGET_NR_name_to_handle_at:
-        ret = do_name_to_handle_at(arg1, arg2, arg3, arg4, arg5);
-        return ret;
-#endif
 #if defined(TARGET_NR_open_by_handle_at) && defined(CONFIG_OPEN_BY_HANDLE)
     case TARGET_NR_open_by_handle_at:
         ret = do_open_by_handle_at(arg1, arg2, arg3);
@@ -12491,6 +12488,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(close);
         SYSCALL(execve);
         SYSCALL(exit);
+#ifdef CONFIG_OPEN_BY_HANDLE
+        SYSCALL(name_to_handle_at);
+#endif
 #ifdef TARGET_NR_open
         SYSCALL(open);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 014/108] linux-user: Split out open_to_handle_at
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (12 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 013/108] linux-user: Split out name_to_handle_at Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 015/108] linux-user: Split out creat, fork, waitid, waitpid Richard Henderson
                   ` (97 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

At the same time, merge do_open_to_handle_at into the new function.
All targets define this syscall; remove one of the two ifdefs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 79 ++++++++++++++++++++++----------------------
 1 file changed, 39 insertions(+), 40 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 90341f4254..f51cc7e937 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7362,40 +7362,6 @@ static int do_futex(target_ulong uaddr, int op, int val, target_ulong timeout,
     }
 }
 
-#if defined(TARGET_NR_open_by_handle_at) && defined(CONFIG_OPEN_BY_HANDLE)
-static abi_long do_open_by_handle_at(abi_long mount_fd, abi_long handle,
-                                     abi_long flags)
-{
-    struct file_handle *target_fh;
-    struct file_handle *fh;
-    unsigned int size, total_size;
-    abi_long ret;
-
-    if (get_user_s32(size, handle)) {
-        return -TARGET_EFAULT;
-    }
-
-    total_size = sizeof(struct file_handle) + size;
-    target_fh = lock_user(VERIFY_READ, handle, total_size, 1);
-    if (!target_fh) {
-        return -TARGET_EFAULT;
-    }
-
-    fh = g_memdup(target_fh, total_size);
-    fh->handle_bytes = size;
-    fh->handle_type = tswap32(target_fh->handle_type);
-
-    ret = get_errno(open_by_handle_at(mount_fd, fh,
-                    target_to_host_bitmask(flags, fcntl_flags_tbl)));
-
-    g_free(fh);
-
-    unlock_user(target_fh, handle, total_size);
-
-    return ret;
-}
-#endif
-
 #if defined(TARGET_NR_signalfd) || defined(TARGET_NR_signalfd4)
 
 /* signalfd siginfo conversion */
@@ -8152,6 +8118,42 @@ IMPL(openat)
     return ret;
 }
 
+#ifdef CONFIG_OPEN_BY_HANDLE
+IMPL(open_by_handle_at)
+{
+    abi_long mount_fd = arg1;
+    abi_long handle = arg2;
+    abi_long flags = arg3;
+    struct file_handle *target_fh;
+    struct file_handle *fh;
+    unsigned int size, total_size;
+    abi_long ret;
+
+    if (get_user_s32(size, handle)) {
+        return -TARGET_EFAULT;
+    }
+
+    total_size = sizeof(struct file_handle) + size;
+    target_fh = lock_user(VERIFY_READ, handle, total_size, 1);
+    if (!target_fh) {
+        return -TARGET_EFAULT;
+    }
+
+    fh = g_memdup(target_fh, total_size);
+    fh->handle_bytes = size;
+    fh->handle_type = tswap32(target_fh->handle_type);
+
+    flags = target_to_host_bitmask(flags, fcntl_flags_tbl);
+    ret = get_errno(open_by_handle_at(mount_fd, fh, flags));
+
+    g_free(fh);
+    unlock_user(target_fh, handle, total_size);
+
+    fd_trans_unregister(ret);
+    return ret;
+}
+#endif
+
 IMPL(read)
 {
     abi_long ret;
@@ -8213,12 +8215,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#if defined(TARGET_NR_open_by_handle_at) && defined(CONFIG_OPEN_BY_HANDLE)
-    case TARGET_NR_open_by_handle_at:
-        ret = do_open_by_handle_at(arg1, arg2, arg3);
-        fd_trans_unregister(ret);
-        return ret;
-#endif
 #ifdef TARGET_NR_fork
     case TARGET_NR_fork:
         return get_errno(do_fork(cpu_env, TARGET_SIGCHLD, 0, 0, 0, 0));
@@ -12495,6 +12491,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(open);
 #endif
         SYSCALL(openat);
+#ifdef CONFIG_OPEN_BY_HANDLE
+        SYSCALL(open_by_handle_at);
+#endif
         SYSCALL(read);
         SYSCALL(write);
     }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 015/108] linux-user: Split out creat, fork, waitid, waitpid
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (13 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 014/108] linux-user: Split out open_to_handle_at Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 016/108] linux-user: Split out link, linkat Richard Henderson
                   ` (96 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define waitid; remove the ifdef.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 104 +++++++++++++++++++++++++++----------------
 1 file changed, 65 insertions(+), 39 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index f51cc7e937..a146b696fd 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7882,6 +7882,22 @@ IMPL(close)
     return get_errno(close(arg1));
 }
 
+#ifdef TARGET_NR_creat
+IMPL(creat)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(creat(p, arg2));
+    fd_trans_unregister(ret);
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+#endif
+
 IMPL(execve)
 {
     abi_ulong *guest_ptrs;
@@ -8029,6 +8045,13 @@ IMPL(exit)
     g_assert_not_reached();
 }
 
+#ifdef TARGET_NR_fork
+IMPL(fork)
+{
+    return get_errno(do_fork(cpu_env, TARGET_SIGCHLD, 0, 0, 0, 0));
+}
+#endif
+
 #ifdef CONFIG_OPEN_BY_HANDLE
 IMPL(name_to_handle_at)
 {
@@ -8174,6 +8197,38 @@ IMPL(read)
     return ret;
 }
 
+IMPL(waitid)
+{
+    siginfo_t info;
+    abi_long ret;
+
+    info.si_pid = 0;
+    ret = get_errno(safe_waitid(arg1, arg2, &info, arg4, NULL));
+    if (!is_error(ret) && arg3 && info.si_pid != 0) {
+        target_siginfo_t *p
+            = lock_user(VERIFY_WRITE, arg3, sizeof(target_siginfo_t), 0);
+        if (!p) {
+            return -TARGET_EFAULT;
+        }
+        host_to_target_siginfo(p, &info);
+        unlock_user(p, arg3, sizeof(target_siginfo_t));
+    }
+    return ret;
+}
+
+#ifdef TARGET_NR_waitpid
+IMPL(waitpid)
+{
+    int status;
+    abi_long ret = get_errno(safe_wait4(arg1, &status, arg3, 0));
+    if (!is_error(ret) && arg2 && ret &&
+        put_user_s32(host_to_target_waitstatus(status), arg2)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+#endif
+
 IMPL(write)
 {
     abi_long ret;
@@ -8215,45 +8270,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_fork
-    case TARGET_NR_fork:
-        return get_errno(do_fork(cpu_env, TARGET_SIGCHLD, 0, 0, 0, 0));
-#endif
-#ifdef TARGET_NR_waitpid
-    case TARGET_NR_waitpid:
-        {
-            int status;
-            ret = get_errno(safe_wait4(arg1, &status, arg3, 0));
-            if (!is_error(ret) && arg2 && ret
-                && put_user_s32(host_to_target_waitstatus(status), arg2))
-                return -TARGET_EFAULT;
-        }
-        return ret;
-#endif
-#ifdef TARGET_NR_waitid
-    case TARGET_NR_waitid:
-        {
-            siginfo_t info;
-            info.si_pid = 0;
-            ret = get_errno(safe_waitid(arg1, arg2, &info, arg4, NULL));
-            if (!is_error(ret) && arg3 && info.si_pid != 0) {
-                if (!(p = lock_user(VERIFY_WRITE, arg3, sizeof(target_siginfo_t), 0)))
-                    return -TARGET_EFAULT;
-                host_to_target_siginfo(p, &info);
-                unlock_user(p, arg3, sizeof(target_siginfo_t));
-            }
-        }
-        return ret;
-#endif
-#ifdef TARGET_NR_creat /* not on alpha */
-    case TARGET_NR_creat:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(creat(p, arg2));
-        fd_trans_unregister(ret);
-        unlock_user(p, arg1, 0);
-        return ret;
-#endif
 #ifdef TARGET_NR_link
     case TARGET_NR_link:
         {
@@ -12482,8 +12498,14 @@ static impl_fn *syscall_table(unsigned num)
          */
         SYSCALL(brk);
         SYSCALL(close);
+#ifdef TARGET_NR_creat
+        SYSCALL(creat);
+#endif
         SYSCALL(execve);
         SYSCALL(exit);
+#ifdef TARGET_NR_fork
+        SYSCALL(fork);
+#endif
 #ifdef CONFIG_OPEN_BY_HANDLE
         SYSCALL(name_to_handle_at);
 #endif
@@ -12495,6 +12517,10 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(open_by_handle_at);
 #endif
         SYSCALL(read);
+        SYSCALL(waitid);
+#ifdef TARGET_NR_waitpid
+        SYSCALL(waitpid);
+#endif
         SYSCALL(write);
     }
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 016/108] linux-user: Split out link, linkat
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (14 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 015/108] linux-user: Split out creat, fork, waitid, waitpid Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 017/108] linux-user: Split out unlink, unlinkat Richard Henderson
                   ` (95 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define linkat; remove the ifdef.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 66 +++++++++++++++++++++++---------------------
 1 file changed, 34 insertions(+), 32 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index a146b696fd..936c7a7484 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8052,6 +8052,36 @@ IMPL(fork)
 }
 #endif
 
+#ifdef TARGET_NR_link
+IMPL(link)
+{
+    char *p1 = lock_user_string(arg1);
+    char *p2 = lock_user_string(arg2);
+    abi_long ret = -TARGET_EFAULT;
+
+    if (p1 && p2) {
+        ret = get_errno(link(p1, p2));
+    }
+    unlock_user(p1, arg1, 0);
+    unlock_user(p2, arg2, 0);
+    return ret;
+}
+#endif
+
+IMPL(linkat)
+{
+    char *p1 = lock_user_string(arg2);
+    char *p2 = lock_user_string(arg4);
+    abi_long ret = -TARGET_EFAULT;
+
+    if (p1 && p2) {
+        ret = get_errno(linkat(arg1, p1, arg3, p2, arg5));
+    }
+    unlock_user(p1, arg2, 0);
+    unlock_user(p2, arg4, 0);
+    return ret;
+}
+
 #ifdef CONFIG_OPEN_BY_HANDLE
 IMPL(name_to_handle_at)
 {
@@ -8270,38 +8300,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_link
-    case TARGET_NR_link:
-        {
-            void * p2;
-            p = lock_user_string(arg1);
-            p2 = lock_user_string(arg2);
-            if (!p || !p2)
-                ret = -TARGET_EFAULT;
-            else
-                ret = get_errno(link(p, p2));
-            unlock_user(p2, arg2, 0);
-            unlock_user(p, arg1, 0);
-        }
-        return ret;
-#endif
-#if defined(TARGET_NR_linkat)
-    case TARGET_NR_linkat:
-        {
-            void * p2 = NULL;
-            if (!arg2 || !arg4)
-                return -TARGET_EFAULT;
-            p  = lock_user_string(arg2);
-            p2 = lock_user_string(arg4);
-            if (!p || !p2)
-                ret = -TARGET_EFAULT;
-            else
-                ret = get_errno(linkat(arg1, p, arg3, p2, arg5));
-            unlock_user(p, arg2, 0);
-            unlock_user(p2, arg4, 0);
-        }
-        return ret;
-#endif
 #ifdef TARGET_NR_unlink
     case TARGET_NR_unlink:
         if (!(p = lock_user_string(arg1)))
@@ -12506,6 +12504,10 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_fork
         SYSCALL(fork);
 #endif
+#ifdef TARGET_NR_link
+        SYSCALL(link);
+#endif
+        SYSCALL(linkat);
 #ifdef CONFIG_OPEN_BY_HANDLE
         SYSCALL(name_to_handle_at);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 017/108] linux-user: Split out unlink, unlinkat
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (15 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 016/108] linux-user: Split out link, linkat Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 018/108] linux-user: Split out chdir, mknod, mknodat, time, chmod Richard Henderson
                   ` (94 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define unlinkat; remove the ifdef.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 48 +++++++++++++++++++++++++++++---------------
 1 file changed, 32 insertions(+), 16 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 936c7a7484..e1b3c7e827 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8227,6 +8227,34 @@ IMPL(read)
     return ret;
 }
 
+#ifdef TARGET_NR_unlink
+IMPL(unlink)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(unlink(p));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+#endif
+
+IMPL(unlinkat)
+{
+    char *p = lock_user_string(arg2);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(unlinkat(arg1, p, arg3));
+    unlock_user(p, arg2, 0);
+    return ret;
+}
+
 IMPL(waitid)
 {
     siginfo_t info;
@@ -8300,22 +8328,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_unlink
-    case TARGET_NR_unlink:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(unlink(p));
-        unlock_user(p, arg1, 0);
-        return ret;
-#endif
-#if defined(TARGET_NR_unlinkat)
-    case TARGET_NR_unlinkat:
-        if (!(p = lock_user_string(arg2)))
-            return -TARGET_EFAULT;
-        ret = get_errno(unlinkat(arg1, p, arg3));
-        unlock_user(p, arg2, 0);
-        return ret;
-#endif
     case TARGET_NR_chdir:
         if (!(p = lock_user_string(arg1)))
             return -TARGET_EFAULT;
@@ -12519,6 +12531,10 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(open_by_handle_at);
 #endif
         SYSCALL(read);
+#ifdef TARGET_NR_unlink
+        SYSCALL(unlink);
+#endif
+        SYSCALL(unlinkat);
         SYSCALL(waitid);
 #ifdef TARGET_NR_waitpid
         SYSCALL(waitpid);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 018/108] linux-user: Split out chdir, mknod, mknodat, time, chmod
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (16 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 017/108] linux-user: Split out unlink, unlinkat Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 019/108] linux-user: Split out getpid, getxpid, lseek Richard Henderson
                   ` (93 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define mknodat; remove the ifdef.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 121 ++++++++++++++++++++++++++++---------------
 1 file changed, 79 insertions(+), 42 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e1b3c7e827..d32034ce38 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7876,6 +7876,34 @@ IMPL(brk)
     return do_brk(arg1);
 }
 
+IMPL(chdir)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(chdir(p));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+
+#ifdef TARGET_NR_chmod
+IMPL(chmod)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(chmod(p, arg2));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+#endif
+
 IMPL(close)
 {
     fd_trans_unregister(arg1);
@@ -8082,6 +8110,34 @@ IMPL(linkat)
     return ret;
 }
 
+#ifdef TARGET_NR_mknod
+IMPL(mknod)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(mknod(p, arg2, arg3));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+#endif
+
+IMPL(mknodat)
+{
+    char *p = lock_user_string(arg2);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(mknodat(arg1, p, arg3, arg4));
+    unlock_user(p, arg2, 0);
+    return ret;
+}
+
 #ifdef CONFIG_OPEN_BY_HANDLE
 IMPL(name_to_handle_at)
 {
@@ -8227,6 +8283,18 @@ IMPL(read)
     return ret;
 }
 
+#ifdef TARGET_NR_time
+IMPL(time)
+{
+    time_t host_time;
+    abi_long ret = get_errno(time(&host_time));
+    if (!is_error(ret) && arg1 && put_user_sal(host_time, arg1)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_unlink
 IMPL(unlink)
 {
@@ -8328,48 +8396,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_chdir:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(chdir(p));
-        unlock_user(p, arg1, 0);
-        return ret;
-#ifdef TARGET_NR_time
-    case TARGET_NR_time:
-        {
-            time_t host_time;
-            ret = get_errno(time(&host_time));
-            if (!is_error(ret)
-                && arg1
-                && put_user_sal(host_time, arg1))
-                return -TARGET_EFAULT;
-        }
-        return ret;
-#endif
-#ifdef TARGET_NR_mknod
-    case TARGET_NR_mknod:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(mknod(p, arg2, arg3));
-        unlock_user(p, arg1, 0);
-        return ret;
-#endif
-#if defined(TARGET_NR_mknodat)
-    case TARGET_NR_mknodat:
-        if (!(p = lock_user_string(arg2)))
-            return -TARGET_EFAULT;
-        ret = get_errno(mknodat(arg1, p, arg3, arg4));
-        unlock_user(p, arg2, 0);
-        return ret;
-#endif
-#ifdef TARGET_NR_chmod
-    case TARGET_NR_chmod:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(chmod(p, arg2));
-        unlock_user(p, arg1, 0);
-        return ret;
-#endif
     case TARGET_NR_lseek:
         return get_errno(lseek(arg1, arg2, arg3));
 #if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
@@ -12508,6 +12534,10 @@ static impl_fn *syscall_table(unsigned num)
          */
         SYSCALL(brk);
         SYSCALL(close);
+        SYSCALL(chdir);
+#ifdef TARGET_NR_chmod
+        SYSCALL(chmod);
+#endif
 #ifdef TARGET_NR_creat
         SYSCALL(creat);
 #endif
@@ -12520,6 +12550,10 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(link);
 #endif
         SYSCALL(linkat);
+#ifdef TARGET_NR_mknod
+        SYSCALL(mknod);
+#endif
+        SYSCALL(mknodat);
 #ifdef CONFIG_OPEN_BY_HANDLE
         SYSCALL(name_to_handle_at);
 #endif
@@ -12531,6 +12565,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(open_by_handle_at);
 #endif
         SYSCALL(read);
+#ifdef TARGET_NR_time
+        SYSCALL(time);
+#endif
 #ifdef TARGET_NR_unlink
         SYSCALL(unlink);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 019/108] linux-user: Split out getpid, getxpid, lseek
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (17 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 018/108] linux-user: Split out chdir, mknod, mknodat, time, chmod Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 020/108] linux-user: Split out mount, umount Richard Henderson
                   ` (92 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 39 +++++++++++++++++++++++++++------------
 1 file changed, 27 insertions(+), 12 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index d32034ce38..3d3983a504 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8080,6 +8080,21 @@ IMPL(fork)
 }
 #endif
 
+#ifdef TARGET_NR_getpid
+IMPL(getpid)
+{
+    return get_errno(getpid());
+}
+#endif
+
+#if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
+IMPL(getxpid)
+{
+    ((CPUAlphaState *)cpu_env)->ir[IR_A4] = getppid();
+    return get_errno(getpid());
+}
+#endif
+
 #ifdef TARGET_NR_link
 IMPL(link)
 {
@@ -8110,6 +8125,11 @@ IMPL(linkat)
     return ret;
 }
 
+IMPL(lseek)
+{
+    return get_errno(lseek(arg1, arg2, arg3));
+}
+
 #ifdef TARGET_NR_mknod
 IMPL(mknod)
 {
@@ -8396,18 +8416,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_lseek:
-        return get_errno(lseek(arg1, arg2, arg3));
-#if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
-    /* Alpha specific */
-    case TARGET_NR_getxpid:
-        ((CPUAlphaState *)cpu_env)->ir[IR_A4] = getppid();
-        return get_errno(getpid());
-#endif
-#ifdef TARGET_NR_getpid
-    case TARGET_NR_getpid:
-        return get_errno(getpid());
-#endif
     case TARGET_NR_mount:
         {
             /* need to look at the data field */
@@ -12546,10 +12554,17 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_fork
         SYSCALL(fork);
 #endif
+#ifdef TARGET_NR_getpid
+        SYSCALL(getpid);
+#endif
+#if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
+        SYSCALL(getxpid);
+#endif
 #ifdef TARGET_NR_link
         SYSCALL(link);
 #endif
         SYSCALL(linkat);
+        SYSCALL(lseek);
 #ifdef TARGET_NR_mknod
         SYSCALL(mknod);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 020/108] linux-user: Split out mount, umount
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (18 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 019/108] linux-user: Split out getpid, getxpid, lseek Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 021/108] linux-user: Split out alarm, pause, stime, utime, utimes Richard Henderson
                   ` (91 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 118 ++++++++++++++++++++-----------------------
 1 file changed, 55 insertions(+), 63 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 3d3983a504..844e771488 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8158,6 +8158,42 @@ IMPL(mknodat)
     return ret;
 }
 
+IMPL(mount)
+{
+    char *p1 = NULL, *p2, *p3 = NULL;
+    abi_long ret = -TARGET_EFAULT;
+
+    if (arg1) {
+        p1 = lock_user_string(arg1);
+        if (!p1) {
+            return ret;
+        }
+    }
+    p2 = lock_user_string(arg2);
+    if (!p2) {
+        goto exit2;
+    }
+    if (arg3) {
+        p3 = lock_user_string(arg3);
+        if (!p3) {
+            goto exit3;
+        }
+    }
+
+    /* FIXME - arg5 should be locked, but it isn't clear how to do that
+     * since it's not guaranteed to be a NULL-terminated string.
+     */
+    ret = mount(p1, p2, p3, (unsigned long)arg4, arg5 ? g2h(arg5) : NULL);
+    ret = get_errno(ret);
+
+    unlock_user(p3, arg3, 0);
+ exit3:
+    unlock_user(p2, arg2, 0);
+ exit2:
+    unlock_user(p1, arg1, 0);
+    return ret;
+}
+
 #ifdef CONFIG_OPEN_BY_HANDLE
 IMPL(name_to_handle_at)
 {
@@ -8315,6 +8351,21 @@ IMPL(time)
 }
 #endif
 
+#ifdef TARGET_NR_umount
+IMPL(umount)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(umount(p));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_unlink
 IMPL(unlink)
 {
@@ -8416,69 +8467,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_mount:
-        {
-            /* need to look at the data field */
-            void *p2, *p3;
-
-            if (arg1) {
-                p = lock_user_string(arg1);
-                if (!p) {
-                    return -TARGET_EFAULT;
-                }
-            } else {
-                p = NULL;
-            }
-
-            p2 = lock_user_string(arg2);
-            if (!p2) {
-                if (arg1) {
-                    unlock_user(p, arg1, 0);
-                }
-                return -TARGET_EFAULT;
-            }
-
-            if (arg3) {
-                p3 = lock_user_string(arg3);
-                if (!p3) {
-                    if (arg1) {
-                        unlock_user(p, arg1, 0);
-                    }
-                    unlock_user(p2, arg2, 0);
-                    return -TARGET_EFAULT;
-                }
-            } else {
-                p3 = NULL;
-            }
-
-            /* FIXME - arg5 should be locked, but it isn't clear how to
-             * do that since it's not guaranteed to be a NULL-terminated
-             * string.
-             */
-            if (!arg5) {
-                ret = mount(p, p2, p3, (unsigned long)arg4, NULL);
-            } else {
-                ret = mount(p, p2, p3, (unsigned long)arg4, g2h(arg5));
-            }
-            ret = get_errno(ret);
-
-            if (arg1) {
-                unlock_user(p, arg1, 0);
-            }
-            unlock_user(p2, arg2, 0);
-            if (arg3) {
-                unlock_user(p3, arg3, 0);
-            }
-        }
-        return ret;
-#ifdef TARGET_NR_umount
-    case TARGET_NR_umount:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(umount(p));
-        unlock_user(p, arg1, 0);
-        return ret;
-#endif
 #ifdef TARGET_NR_stime /* not on alpha */
     case TARGET_NR_stime:
         {
@@ -12569,6 +12557,7 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(mknod);
 #endif
         SYSCALL(mknodat);
+        SYSCALL(mount);
 #ifdef CONFIG_OPEN_BY_HANDLE
         SYSCALL(name_to_handle_at);
 #endif
@@ -12583,6 +12572,9 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_time
         SYSCALL(time);
 #endif
+#ifdef TARGET_NR_umount
+        SYSCALL(umount);
+#endif
 #ifdef TARGET_NR_unlink
         SYSCALL(unlink);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 021/108] linux-user: Split out alarm, pause, stime, utime, utimes
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (19 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 020/108] linux-user: Split out mount, umount Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 022/108] linux-user: Split out access, faccessat, futimesat, kill, nice, sync, syncfs Richard Henderson
                   ` (90 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 155 ++++++++++++++++++++++++++-----------------
 1 file changed, 93 insertions(+), 62 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 844e771488..d5f7519e62 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7871,6 +7871,13 @@ static abi_long impl_##NAME(void *cpu_env, unsigned num, abi_long arg1,   \
                             abi_long arg5, abi_long arg6, abi_long arg7,  \
                             abi_long arg8)
 
+#ifdef TARGET_NR_alarm
+IMPL(alarm)
+{
+    return alarm(arg1);
+}
+#endif
+
 IMPL(brk)
 {
     return do_brk(arg1);
@@ -8319,6 +8326,17 @@ IMPL(open_by_handle_at)
 }
 #endif
 
+#ifdef TARGET_NR_pause
+IMPL(pause)
+{
+    if (!block_signals()) {
+        CPUState *cpu = ENV_GET_CPU(cpu_env);
+        sigsuspend(&((TaskState *)cpu->opaque)->signal_mask);
+    }
+    return -TARGET_EINTR;
+}
+#endif
+
 IMPL(read)
 {
     abi_long ret;
@@ -8339,6 +8357,17 @@ IMPL(read)
     return ret;
 }
 
+#ifdef TARGET_NR_stime
+IMPL(stime)
+{
+    time_t host_time;
+    if (get_user_sal(host_time, arg1)) {
+        return -TARGET_EFAULT;
+    }
+    return get_errno(stime(&host_time));
+}
+#endif
+
 #ifdef TARGET_NR_time
 IMPL(time)
 {
@@ -8394,6 +8423,55 @@ IMPL(unlinkat)
     return ret;
 }
 
+#ifdef TARGET_NR_utime
+IMPL(utime)
+{
+    struct utimbuf tbuf;
+    char *p;
+    abi_long ret;
+
+    if (arg2) {
+        struct target_utimbuf *target_tbuf;
+        if (!lock_user_struct(VERIFY_READ, target_tbuf, arg2, 1)) {
+            return -TARGET_EFAULT;
+        }
+        tbuf.actime = tswapal(target_tbuf->actime);
+        tbuf.modtime = tswapal(target_tbuf->modtime);
+        unlock_user_struct(target_tbuf, arg2, 0);
+    }
+    p = lock_user_string(arg1);
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(utime(p, arg2 ? &tbuf : NULL));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+#endif
+
+#ifdef TARGET_NR_utimes
+IMPL(utimes)
+{
+    struct timeval tv[2];
+    char *p;
+    abi_long ret;
+
+    if (arg2 &&
+        (copy_from_user_timeval(&tv[0], arg2) ||
+         copy_from_user_timeval(&tv[1],
+                                arg2 + sizeof(struct target_timeval)))) {
+        return -TARGET_EFAULT;
+    }
+    p = lock_user_string(arg1);
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(utimes(p, arg2 ? tv : NULL));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+#endif
+
 IMPL(waitid)
 {
     siginfo_t info;
@@ -8467,68 +8545,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_stime /* not on alpha */
-    case TARGET_NR_stime:
-        {
-            time_t host_time;
-            if (get_user_sal(host_time, arg1))
-                return -TARGET_EFAULT;
-            return get_errno(stime(&host_time));
-        }
-#endif
-#ifdef TARGET_NR_alarm /* not on alpha */
-    case TARGET_NR_alarm:
-        return alarm(arg1);
-#endif
-#ifdef TARGET_NR_pause /* not on alpha */
-    case TARGET_NR_pause:
-        if (!block_signals()) {
-            sigsuspend(&((TaskState *)cpu->opaque)->signal_mask);
-        }
-        return -TARGET_EINTR;
-#endif
-#ifdef TARGET_NR_utime
-    case TARGET_NR_utime:
-        {
-            struct utimbuf tbuf, *host_tbuf;
-            struct target_utimbuf *target_tbuf;
-            if (arg2) {
-                if (!lock_user_struct(VERIFY_READ, target_tbuf, arg2, 1))
-                    return -TARGET_EFAULT;
-                tbuf.actime = tswapal(target_tbuf->actime);
-                tbuf.modtime = tswapal(target_tbuf->modtime);
-                unlock_user_struct(target_tbuf, arg2, 0);
-                host_tbuf = &tbuf;
-            } else {
-                host_tbuf = NULL;
-            }
-            if (!(p = lock_user_string(arg1)))
-                return -TARGET_EFAULT;
-            ret = get_errno(utime(p, host_tbuf));
-            unlock_user(p, arg1, 0);
-        }
-        return ret;
-#endif
-#ifdef TARGET_NR_utimes
-    case TARGET_NR_utimes:
-        {
-            struct timeval *tvp, tv[2];
-            if (arg2) {
-                if (copy_from_user_timeval(&tv[0], arg2)
-                    || copy_from_user_timeval(&tv[1],
-                                              arg2 + sizeof(struct target_timeval)))
-                    return -TARGET_EFAULT;
-                tvp = tv;
-            } else {
-                tvp = NULL;
-            }
-            if (!(p = lock_user_string(arg1)))
-                return -TARGET_EFAULT;
-            ret = get_errno(utimes(p, tvp));
-            unlock_user(p, arg1, 0);
-        }
-        return ret;
-#endif
 #if defined(TARGET_NR_futimesat)
     case TARGET_NR_futimesat:
         {
@@ -12528,6 +12544,9 @@ static impl_fn *syscall_table(unsigned num)
         /*
          * Other syscalls listed in collation order, with '_' ignored.
          */
+#ifdef TARGET_NR_alarm
+        SYSCALL(alarm);
+#endif
         SYSCALL(brk);
         SYSCALL(close);
         SYSCALL(chdir);
@@ -12567,8 +12586,14 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(openat);
 #ifdef CONFIG_OPEN_BY_HANDLE
         SYSCALL(open_by_handle_at);
+#endif
+#ifdef TARGET_NR_pause
+        SYSCALL(pause);
 #endif
         SYSCALL(read);
+#ifdef TARGET_NR_stime
+        SYSCALL(stime);
+#endif
 #ifdef TARGET_NR_time
         SYSCALL(time);
 #endif
@@ -12579,6 +12604,12 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(unlink);
 #endif
         SYSCALL(unlinkat);
+#ifdef TARGET_NR_utime
+        SYSCALL(utime);
+#endif
+#ifdef TARGET_NR_utimes
+        SYSCALL(utimes);
+#endif
         SYSCALL(waitid);
 #ifdef TARGET_NR_waitpid
         SYSCALL(waitpid);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 022/108] linux-user: Split out access, faccessat, futimesat, kill, nice, sync, syncfs
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (20 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 021/108] linux-user: Split out alarm, pause, stime, utime, utimes Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 023/108] linux-user: Split out rename, renameat, renameat2 Richard Henderson
                   ` (89 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define faccessat and syncfs; remove the ifdefs.
Fix the missing flags parameter to faccessat.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 143 +++++++++++++++++++++++++++----------------
 1 file changed, 91 insertions(+), 52 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index d5f7519e62..6729a960ea 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7871,6 +7871,21 @@ static abi_long impl_##NAME(void *cpu_env, unsigned num, abi_long arg1,   \
                             abi_long arg5, abi_long arg6, abi_long arg7,  \
                             abi_long arg8)
 
+#ifdef TARGET_NR_access
+IMPL(access)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(access(path(p), arg2));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_alarm
 IMPL(alarm)
 {
@@ -8080,6 +8095,19 @@ IMPL(exit)
     g_assert_not_reached();
 }
 
+IMPL(faccessat)
+{
+    char *p = lock_user_string(arg2);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(faccessat(arg1, p, arg3, arg4));
+    unlock_user(p, arg2, 0);
+    return ret;
+}
+
 #ifdef TARGET_NR_fork
 IMPL(fork)
 {
@@ -8087,6 +8115,29 @@ IMPL(fork)
 }
 #endif
 
+#ifdef TARGET_NR_futimesat
+IMPL(futimesat)
+{
+    struct timeval tv[2];
+    char *p;
+    abi_long ret;
+
+    if (arg3 &&
+        (copy_from_user_timeval(&tv[0], arg3) ||
+         copy_from_user_timeval(&tv[1],
+                                arg3 + sizeof(struct target_timeval)))) {
+        return -TARGET_EFAULT;
+    }
+    p = lock_user_string(arg2);
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(futimesat(arg1, path(p), arg3 ? tv : NULL));
+    unlock_user(p, arg2, 0);
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_getpid
 IMPL(getpid)
 {
@@ -8102,6 +8153,11 @@ IMPL(getxpid)
 }
 #endif
 
+IMPL(kill)
+{
+    return get_errno(safe_kill(arg1, target_to_host_signal(arg2)));
+}
+
 #ifdef TARGET_NR_link
 IMPL(link)
 {
@@ -8256,6 +8312,13 @@ IMPL(name_to_handle_at)
 }
 #endif
 
+#ifdef TARGET_NR_nice
+IMPL(nice)
+{
+    return get_errno(nice(arg1));
+}
+#endif
+
 #ifdef TARGET_NR_open
 IMPL(open)
 {
@@ -8368,6 +8431,19 @@ IMPL(stime)
 }
 #endif
 
+IMPL(sync)
+{
+    sync();
+    return 0;
+}
+
+#ifdef CONFIG_SYNCFS
+IMPL(syncfs)
+{
+    return get_errno(syncfs(arg1));
+}
+#endif
+
 #ifdef TARGET_NR_time
 IMPL(time)
 {
@@ -8545,58 +8621,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#if defined(TARGET_NR_futimesat)
-    case TARGET_NR_futimesat:
-        {
-            struct timeval *tvp, tv[2];
-            if (arg3) {
-                if (copy_from_user_timeval(&tv[0], arg3)
-                    || copy_from_user_timeval(&tv[1],
-                                              arg3 + sizeof(struct target_timeval)))
-                    return -TARGET_EFAULT;
-                tvp = tv;
-            } else {
-                tvp = NULL;
-            }
-            if (!(p = lock_user_string(arg2))) {
-                return -TARGET_EFAULT;
-            }
-            ret = get_errno(futimesat(arg1, path(p), tvp));
-            unlock_user(p, arg2, 0);
-        }
-        return ret;
-#endif
-#ifdef TARGET_NR_access
-    case TARGET_NR_access:
-        if (!(p = lock_user_string(arg1))) {
-            return -TARGET_EFAULT;
-        }
-        ret = get_errno(access(path(p), arg2));
-        unlock_user(p, arg1, 0);
-        return ret;
-#endif
-#if defined(TARGET_NR_faccessat) && defined(__NR_faccessat)
-    case TARGET_NR_faccessat:
-        if (!(p = lock_user_string(arg2))) {
-            return -TARGET_EFAULT;
-        }
-        ret = get_errno(faccessat(arg1, p, arg3, 0));
-        unlock_user(p, arg2, 0);
-        return ret;
-#endif
-#ifdef TARGET_NR_nice /* not on alpha */
-    case TARGET_NR_nice:
-        return get_errno(nice(arg1));
-#endif
-    case TARGET_NR_sync:
-        sync();
-        return 0;
-#if defined(TARGET_NR_syncfs) && defined(CONFIG_SYNCFS)
-    case TARGET_NR_syncfs:
-        return get_errno(syncfs(arg1));
-#endif
-    case TARGET_NR_kill:
-        return get_errno(safe_kill(arg1, target_to_host_signal(arg2)));
 #ifdef TARGET_NR_rename
     case TARGET_NR_rename:
         {
@@ -12544,6 +12568,9 @@ static impl_fn *syscall_table(unsigned num)
         /*
          * Other syscalls listed in collation order, with '_' ignored.
          */
+#ifdef TARGET_NR_access
+        SYSCALL(access);
+#endif
 #ifdef TARGET_NR_alarm
         SYSCALL(alarm);
 #endif
@@ -12558,15 +12585,20 @@ static impl_fn *syscall_table(unsigned num)
 #endif
         SYSCALL(execve);
         SYSCALL(exit);
+        SYSCALL(faccessat);
 #ifdef TARGET_NR_fork
         SYSCALL(fork);
 #endif
+#ifdef TARGET_NR_futimesat
+        SYSCALL(futimesat);
+#endif
 #ifdef TARGET_NR_getpid
         SYSCALL(getpid);
 #endif
 #if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
         SYSCALL(getxpid);
 #endif
+        SYSCALL(kill);
 #ifdef TARGET_NR_link
         SYSCALL(link);
 #endif
@@ -12580,6 +12612,9 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef CONFIG_OPEN_BY_HANDLE
         SYSCALL(name_to_handle_at);
 #endif
+#ifdef TARGET_NR_nice
+        SYSCALL(nice);
+#endif
 #ifdef TARGET_NR_open
         SYSCALL(open);
 #endif
@@ -12593,6 +12628,10 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(read);
 #ifdef TARGET_NR_stime
         SYSCALL(stime);
+#endif
+        SYSCALL(sync);
+#ifdef CONFIG_SYNCFS
+        SYSCALL(syncfs);
 #endif
 #ifdef TARGET_NR_time
         SYSCALL(time);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 023/108] linux-user: Split out rename, renameat, renameat2
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (21 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 022/108] linux-user: Split out access, faccessat, futimesat, kill, nice, sync, syncfs Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 024/108] linux-user: Split out dup, mkdir, mkdirat, rmdir Richard Henderson
                   ` (88 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define renameat2; remove the ifdefs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 101 +++++++++++++++++++++++--------------------
 1 file changed, 53 insertions(+), 48 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 6729a960ea..e0a5d86956 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -628,7 +628,6 @@ static int sys_utimensat(int dirfd, const char *pathname,
 #endif
 #endif /* TARGET_NR_utimensat */
 
-#ifdef TARGET_NR_renameat2
 #if defined(__NR_renameat2)
 #define __NR_sys_renameat2 __NR_renameat2
 _syscall5(int, sys_renameat2, int, oldfd, const char *, old, int, newfd,
@@ -644,7 +643,6 @@ static int sys_renameat2(int oldfd, const char *old,
     return -1;
 }
 #endif
-#endif /* TARGET_NR_renameat2 */
 
 #ifdef CONFIG_INOTIFY
 #include <sys/inotify.h>
@@ -8420,6 +8418,52 @@ IMPL(read)
     return ret;
 }
 
+#ifdef TARGET_NR_rename
+IMPL(rename)
+{
+    char *p1 = lock_user_string(arg1);
+    char *p2 = lock_user_string(arg2);
+    abi_long ret = -TARGET_EFAULT;
+
+    if (p1 && p2) {
+        ret = get_errno(rename(p1, p2));
+    }
+    unlock_user(p2, arg2, 0);
+    unlock_user(p1, arg1, 0);
+    return ret;
+}
+#endif
+
+#ifdef TARGET_NR_renameat
+IMPL(renameat)
+{
+    char *p1 = lock_user_string(arg2);
+    char *p2 = lock_user_string(arg4);
+    abi_long ret = -TARGET_EFAULT;
+
+    if (p1 && p2) {
+        ret = get_errno(renameat(arg1, p1, arg3, p2));
+    }
+    unlock_user(p2, arg4, 0);
+    unlock_user(p1, arg2, 0);
+    return ret;
+}
+#endif
+
+IMPL(renameat2)
+{
+    char *p1 = lock_user_string(arg2);
+    char *p2 = lock_user_string(arg4);
+    abi_long ret = -TARGET_EFAULT;
+
+    if (p1 && p2) {
+        ret = get_errno(sys_renameat2(arg1, p1, arg3, p2, arg5));
+    }
+    unlock_user(p2, arg4, 0);
+    unlock_user(p1, arg2, 0);
+    return ret;
+}
+
 #ifdef TARGET_NR_stime
 IMPL(stime)
 {
@@ -8621,52 +8665,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_rename
-    case TARGET_NR_rename:
-        {
-            void *p2;
-            p = lock_user_string(arg1);
-            p2 = lock_user_string(arg2);
-            if (!p || !p2)
-                ret = -TARGET_EFAULT;
-            else
-                ret = get_errno(rename(p, p2));
-            unlock_user(p2, arg2, 0);
-            unlock_user(p, arg1, 0);
-        }
-        return ret;
-#endif
-#if defined(TARGET_NR_renameat)
-    case TARGET_NR_renameat:
-        {
-            void *p2;
-            p  = lock_user_string(arg2);
-            p2 = lock_user_string(arg4);
-            if (!p || !p2)
-                ret = -TARGET_EFAULT;
-            else
-                ret = get_errno(renameat(arg1, p, arg3, p2));
-            unlock_user(p2, arg4, 0);
-            unlock_user(p, arg2, 0);
-        }
-        return ret;
-#endif
-#if defined(TARGET_NR_renameat2)
-    case TARGET_NR_renameat2:
-        {
-            void *p2;
-            p  = lock_user_string(arg2);
-            p2 = lock_user_string(arg4);
-            if (!p || !p2) {
-                ret = -TARGET_EFAULT;
-            } else {
-                ret = get_errno(sys_renameat2(arg1, p, arg3, p2, arg5));
-            }
-            unlock_user(p2, arg4, 0);
-            unlock_user(p, arg2, 0);
-        }
-        return ret;
-#endif
 #ifdef TARGET_NR_mkdir
     case TARGET_NR_mkdir:
         if (!(p = lock_user_string(arg1)))
@@ -12626,6 +12624,13 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(pause);
 #endif
         SYSCALL(read);
+#ifdef TARGET_NR_rename
+        SYSCALL(rename);
+#endif
+#ifdef TARGET_NR_renameat
+        SYSCALL(renameat);
+#endif
+        SYSCALL(renameat2);
 #ifdef TARGET_NR_stime
         SYSCALL(stime);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 024/108] linux-user: Split out dup, mkdir, mkdirat, rmdir
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (22 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 023/108] linux-user: Split out rename, renameat, renameat2 Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 025/108] linux-user: Split out acct, pipe, pipe2, times, umount2 Richard Henderson
                   ` (87 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define mkdirat; remove the ifdef.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 90 +++++++++++++++++++++++++++++---------------
 1 file changed, 60 insertions(+), 30 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e0a5d86956..f22d45d2cb 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7946,6 +7946,15 @@ IMPL(creat)
 }
 #endif
 
+IMPL(dup)
+{
+    abi_long ret = get_errno(dup(arg1));
+    if (ret >= 0) {
+        fd_trans_dup(arg1, ret);
+    }
+    return ret;
+}
+
 IMPL(execve)
 {
     abi_ulong *guest_ptrs;
@@ -8191,6 +8200,34 @@ IMPL(lseek)
     return get_errno(lseek(arg1, arg2, arg3));
 }
 
+#ifdef TARGET_NR_mkdir
+IMPL(mkdir)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(mkdir(p, arg2));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+#endif
+
+IMPL(mkdirat)
+{
+    char *p = lock_user_string(arg2);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(mkdirat(arg1, p, arg3));
+    unlock_user(p, arg2, 0);
+    return ret;
+}
+
 #ifdef TARGET_NR_mknod
 IMPL(mknod)
 {
@@ -8464,6 +8501,21 @@ IMPL(renameat2)
     return ret;
 }
 
+#ifdef TARGET_NR_rmdir
+IMPL(rmdir)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(rmdir(p));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_stime
 IMPL(stime)
 {
@@ -8665,36 +8717,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_mkdir
-    case TARGET_NR_mkdir:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(mkdir(p, arg2));
-        unlock_user(p, arg1, 0);
-        return ret;
-#endif
-#if defined(TARGET_NR_mkdirat)
-    case TARGET_NR_mkdirat:
-        if (!(p = lock_user_string(arg2)))
-            return -TARGET_EFAULT;
-        ret = get_errno(mkdirat(arg1, p, arg3));
-        unlock_user(p, arg2, 0);
-        return ret;
-#endif
-#ifdef TARGET_NR_rmdir
-    case TARGET_NR_rmdir:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(rmdir(p));
-        unlock_user(p, arg1, 0);
-        return ret;
-#endif
-    case TARGET_NR_dup:
-        ret = get_errno(dup(arg1));
-        if (ret >= 0) {
-            fd_trans_dup(arg1, ret);
-        }
-        return ret;
 #ifdef TARGET_NR_pipe
     case TARGET_NR_pipe:
         return do_pipe(cpu_env, arg1, 0, 0);
@@ -12581,6 +12603,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_creat
         SYSCALL(creat);
 #endif
+        SYSCALL(dup);
         SYSCALL(execve);
         SYSCALL(exit);
         SYSCALL(faccessat);
@@ -12602,6 +12625,10 @@ static impl_fn *syscall_table(unsigned num)
 #endif
         SYSCALL(linkat);
         SYSCALL(lseek);
+#ifdef TARGET_NR_mkdir
+        SYSCALL(mkdir);
+#endif
+        SYSCALL(mkdirat);
 #ifdef TARGET_NR_mknod
         SYSCALL(mknod);
 #endif
@@ -12631,6 +12658,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(renameat);
 #endif
         SYSCALL(renameat2);
+#ifdef TARGET_NR_rmdir
+        SYSCALL(rmdir);
+#endif
 #ifdef TARGET_NR_stime
         SYSCALL(stime);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 025/108] linux-user: Split out acct, pipe, pipe2, times, umount2
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (23 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 024/108] linux-user: Split out dup, mkdir, mkdirat, rmdir Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 026/108] linux-user: Split out ioctl Richard Henderson
                   ` (86 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define pipe2 and umount2; remove the ifdefs.
Merge do_pipe2 into its only user.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 148 +++++++++++++++++++++++++------------------
 1 file changed, 88 insertions(+), 60 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index f22d45d2cb..81e142f091 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1561,24 +1561,25 @@ static abi_long do_old_select(abi_ulong arg1)
 #endif
 #endif
 
-static abi_long do_pipe2(int host_pipe[], int flags)
-{
-#ifdef CONFIG_PIPE2
-    return pipe2(host_pipe, flags);
-#else
-    return -ENOSYS;
-#endif
-}
-
 static abi_long do_pipe(void *cpu_env, abi_ulong pipedes,
                         int flags, int is_pipe2)
 {
     int host_pipe[2];
     abi_long ret;
-    ret = flags ? do_pipe2(host_pipe, flags) : pipe(host_pipe);
 
-    if (is_error(ret))
-        return get_errno(ret);
+    if (flags) {
+#ifdef CONFIG_PIPE2
+        ret = pipe2(host_pipe, flags);
+#else
+        return -ENOSYS;
+#endif
+    } else {
+        ret = pipe(host_pipe);
+    }
+    ret = get_errno(ret);
+    if (is_error(ret)) {
+        return ret;
+    }
 
     /* Several targets have special calling conventions for the original
        pipe syscall, but didn't replicate this into the pipe2 syscall.  */
@@ -1599,9 +1600,10 @@ static abi_long do_pipe(void *cpu_env, abi_ulong pipedes,
     }
 
     if (put_user_s32(host_pipe[0], pipedes)
-        || put_user_s32(host_pipe[1], pipedes + sizeof(host_pipe[0])))
+        || put_user_s32(host_pipe[1], pipedes + sizeof(host_pipe[0]))) {
         return -TARGET_EFAULT;
-    return get_errno(ret);
+    }
+    return ret;
 }
 
 static inline abi_long target_to_host_ip_mreq(struct ip_mreqn *mreqn,
@@ -7884,6 +7886,23 @@ IMPL(access)
 }
 #endif
 
+IMPL(acct)
+{
+    if (arg1 == 0) {
+        return get_errno(acct(NULL));
+    } else {
+        char *p = lock_user_string(arg1);
+        abi_long ret;
+
+        if (!p) {
+            return -TARGET_EFAULT;
+        }
+        ret = get_errno(acct(path(p)));
+        unlock_user(p, arg1, 0);
+        return ret;
+    }
+}
+
 #ifdef TARGET_NR_alarm
 IMPL(alarm)
 {
@@ -8435,6 +8454,19 @@ IMPL(pause)
 }
 #endif
 
+#ifdef TARGET_NR_pipe
+IMPL(pipe)
+{
+    return do_pipe(cpu_env, arg1, 0, 0);
+}
+#endif
+
+IMPL(pipe2)
+{
+    return do_pipe(cpu_env, arg1,
+                   target_to_host_bitmask(arg2, fcntl_flags_tbl), 1);
+}
+
 IMPL(read)
 {
     abi_long ret;
@@ -8552,6 +8584,28 @@ IMPL(time)
 }
 #endif
 
+IMPL(times)
+{
+    struct tms tms;
+    abi_long ret = get_errno(times(&tms));
+
+    if (is_error(ret)) {
+        return ret;
+    }
+    if (arg1) {
+        struct target_tms *tmsp
+            = lock_user(VERIFY_WRITE, arg1, sizeof(struct target_tms), 0);
+        if (!tmsp) {
+            return -TARGET_EFAULT;
+        }
+        tmsp->tms_utime = tswapal(host_to_target_clock_t(tms.tms_utime));
+        tmsp->tms_stime = tswapal(host_to_target_clock_t(tms.tms_stime));
+        tmsp->tms_cutime = tswapal(host_to_target_clock_t(tms.tms_cutime));
+        tmsp->tms_cstime = tswapal(host_to_target_clock_t(tms.tms_cstime));
+    }
+    return host_to_target_clock_t(ret);
+}
+
 #ifdef TARGET_NR_umount
 IMPL(umount)
 {
@@ -8567,6 +8621,19 @@ IMPL(umount)
 }
 #endif
 
+IMPL(umount2)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(umount2(p, arg2));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+
 #ifdef TARGET_NR_unlink
 IMPL(unlink)
 {
@@ -8717,52 +8784,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_pipe
-    case TARGET_NR_pipe:
-        return do_pipe(cpu_env, arg1, 0, 0);
-#endif
-#ifdef TARGET_NR_pipe2
-    case TARGET_NR_pipe2:
-        return do_pipe(cpu_env, arg1,
-                       target_to_host_bitmask(arg2, fcntl_flags_tbl), 1);
-#endif
-    case TARGET_NR_times:
-        {
-            struct target_tms *tmsp;
-            struct tms tms;
-            ret = get_errno(times(&tms));
-            if (arg1) {
-                tmsp = lock_user(VERIFY_WRITE, arg1, sizeof(struct target_tms), 0);
-                if (!tmsp)
-                    return -TARGET_EFAULT;
-                tmsp->tms_utime = tswapal(host_to_target_clock_t(tms.tms_utime));
-                tmsp->tms_stime = tswapal(host_to_target_clock_t(tms.tms_stime));
-                tmsp->tms_cutime = tswapal(host_to_target_clock_t(tms.tms_cutime));
-                tmsp->tms_cstime = tswapal(host_to_target_clock_t(tms.tms_cstime));
-            }
-            if (!is_error(ret))
-                ret = host_to_target_clock_t(ret);
-        }
-        return ret;
-    case TARGET_NR_acct:
-        if (arg1 == 0) {
-            ret = get_errno(acct(NULL));
-        } else {
-            if (!(p = lock_user_string(arg1))) {
-                return -TARGET_EFAULT;
-            }
-            ret = get_errno(acct(path(p)));
-            unlock_user(p, arg1, 0);
-        }
-        return ret;
-#ifdef TARGET_NR_umount2
-    case TARGET_NR_umount2:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(umount2(p, arg2));
-        unlock_user(p, arg1, 0);
-        return ret;
-#endif
     case TARGET_NR_ioctl:
         return do_ioctl(arg1, arg2, arg3);
 #ifdef TARGET_NR_fcntl
@@ -12591,6 +12612,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_access
         SYSCALL(access);
 #endif
+        SYSCALL(acct);
 #ifdef TARGET_NR_alarm
         SYSCALL(alarm);
 #endif
@@ -12650,6 +12672,10 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_pause
         SYSCALL(pause);
 #endif
+#ifdef TARGET_NR_pipe
+        SYSCALL(pipe);
+#endif
+        SYSCALL(pipe2);
         SYSCALL(read);
 #ifdef TARGET_NR_rename
         SYSCALL(rename);
@@ -12671,9 +12697,11 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_time
         SYSCALL(time);
 #endif
+        SYSCALL(times);
 #ifdef TARGET_NR_umount
         SYSCALL(umount);
 #endif
+        SYSCALL(umount2);
 #ifdef TARGET_NR_unlink
         SYSCALL(unlink);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 026/108] linux-user: Split out ioctl
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (24 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 025/108] linux-user: Split out acct, pipe, pipe2, times, umount2 Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 027/108] linux-user: Split out chroot, dup2, dup3, fcntl, setpgid, umask Richard Henderson
                   ` (85 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

At the same time, merge do_ioctl into the new function.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 184 ++++++++++++++++++++++---------------------
 1 file changed, 94 insertions(+), 90 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 81e142f091..ebe57d86aa 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5754,94 +5754,6 @@ static IOCTLEntry ioctl_entries[] = {
     { 0, 0, },
 };
 
-/* ??? Implement proper locking for ioctls.  */
-/* do_ioctl() Must return target values and target errnos. */
-static abi_long do_ioctl(int fd, int cmd, abi_long arg)
-{
-    const IOCTLEntry *ie;
-    const argtype *arg_type;
-    abi_long ret;
-    uint8_t buf_temp[MAX_STRUCT_SIZE];
-    int target_size;
-    void *argptr;
-
-    ie = ioctl_entries;
-    for(;;) {
-        if (ie->target_cmd == 0) {
-            gemu_log("Unsupported ioctl: cmd=0x%04lx\n", (long)cmd);
-            return -TARGET_ENOSYS;
-        }
-        if (ie->target_cmd == cmd)
-            break;
-        ie++;
-    }
-    arg_type = ie->arg_type;
-    if (ie->do_ioctl) {
-        return ie->do_ioctl(ie, buf_temp, fd, cmd, arg);
-    } else if (!ie->host_cmd) {
-        /* Some architectures define BSD ioctls in their headers
-           that are not implemented in Linux.  */
-        return -TARGET_ENOSYS;
-    }
-
-    switch(arg_type[0]) {
-    case TYPE_NULL:
-        /* no argument */
-        ret = get_errno(safe_ioctl(fd, ie->host_cmd));
-        break;
-    case TYPE_PTRVOID:
-    case TYPE_INT:
-        ret = get_errno(safe_ioctl(fd, ie->host_cmd, arg));
-        break;
-    case TYPE_PTR:
-        arg_type++;
-        target_size = thunk_type_size(arg_type, 0);
-        switch(ie->access) {
-        case IOC_R:
-            ret = get_errno(safe_ioctl(fd, ie->host_cmd, buf_temp));
-            if (!is_error(ret)) {
-                argptr = lock_user(VERIFY_WRITE, arg, target_size, 0);
-                if (!argptr)
-                    return -TARGET_EFAULT;
-                thunk_convert(argptr, buf_temp, arg_type, THUNK_TARGET);
-                unlock_user(argptr, arg, target_size);
-            }
-            break;
-        case IOC_W:
-            argptr = lock_user(VERIFY_READ, arg, target_size, 1);
-            if (!argptr)
-                return -TARGET_EFAULT;
-            thunk_convert(buf_temp, argptr, arg_type, THUNK_HOST);
-            unlock_user(argptr, arg, 0);
-            ret = get_errno(safe_ioctl(fd, ie->host_cmd, buf_temp));
-            break;
-        default:
-        case IOC_RW:
-            argptr = lock_user(VERIFY_READ, arg, target_size, 1);
-            if (!argptr)
-                return -TARGET_EFAULT;
-            thunk_convert(buf_temp, argptr, arg_type, THUNK_HOST);
-            unlock_user(argptr, arg, 0);
-            ret = get_errno(safe_ioctl(fd, ie->host_cmd, buf_temp));
-            if (!is_error(ret)) {
-                argptr = lock_user(VERIFY_WRITE, arg, target_size, 0);
-                if (!argptr)
-                    return -TARGET_EFAULT;
-                thunk_convert(argptr, buf_temp, arg_type, THUNK_TARGET);
-                unlock_user(argptr, arg, target_size);
-            }
-            break;
-        }
-        break;
-    default:
-        gemu_log("Unsupported ioctl type: cmd=0x%04lx type=%d\n",
-                 (long)cmd, arg_type[0]);
-        ret = -TARGET_ENOSYS;
-        break;
-    }
-    return ret;
-}
-
 static const bitmask_transtbl iflag_tbl[] = {
         { TARGET_IGNBRK, TARGET_IGNBRK, IGNBRK, IGNBRK },
         { TARGET_BRKINT, TARGET_BRKINT, BRKINT, BRKINT },
@@ -8179,6 +8091,99 @@ IMPL(getxpid)
 }
 #endif
 
+/* ??? Implement proper locking for ioctls.  */
+IMPL(ioctl)
+{
+    abi_long fd = arg1;
+    abi_long cmd = arg2;
+    abi_long arg = arg3;
+    const IOCTLEntry *ie;
+    const argtype *arg_type;
+    abi_long ret;
+    uint8_t buf_temp[MAX_STRUCT_SIZE];
+    int target_size;
+    void *argptr;
+
+    for (ie = ioctl_entries; ; ie++) {
+        if (ie->target_cmd == 0) {
+            gemu_log("Unsupported ioctl: cmd=0x%04lx\n", (long)cmd);
+            return -TARGET_ENOSYS;
+        }
+        if (ie->target_cmd == cmd) {
+            break;
+        }
+    }
+    arg_type = ie->arg_type;
+    if (ie->do_ioctl) {
+        return ie->do_ioctl(ie, buf_temp, fd, cmd, arg);
+    } else if (!ie->host_cmd) {
+        /* Some architectures define BSD ioctls in their headers
+           that are not implemented in Linux.  */
+        return -TARGET_ENOSYS;
+    }
+
+    switch (arg_type[0]) {
+    case TYPE_NULL:
+        /* no argument */
+        ret = get_errno(safe_ioctl(fd, ie->host_cmd));
+        break;
+    case TYPE_PTRVOID:
+    case TYPE_INT:
+        ret = get_errno(safe_ioctl(fd, ie->host_cmd, arg));
+        break;
+    case TYPE_PTR:
+        arg_type++;
+        target_size = thunk_type_size(arg_type, 0);
+        switch (ie->access) {
+        case IOC_R:
+            ret = get_errno(safe_ioctl(fd, ie->host_cmd, buf_temp));
+            if (!is_error(ret)) {
+                argptr = lock_user(VERIFY_WRITE, arg, target_size, 0);
+                if (!argptr) {
+                    return -TARGET_EFAULT;
+                }
+                thunk_convert(argptr, buf_temp, arg_type, THUNK_TARGET);
+                unlock_user(argptr, arg, target_size);
+            }
+            break;
+        case IOC_W:
+            argptr = lock_user(VERIFY_READ, arg, target_size, 1);
+            if (!argptr) {
+                return -TARGET_EFAULT;
+            }
+            thunk_convert(buf_temp, argptr, arg_type, THUNK_HOST);
+            unlock_user(argptr, arg, 0);
+            ret = get_errno(safe_ioctl(fd, ie->host_cmd, buf_temp));
+            break;
+        default:
+        case IOC_RW:
+            argptr = lock_user(VERIFY_READ, arg, target_size, 1);
+            if (!argptr) {
+                return -TARGET_EFAULT;
+            }
+            thunk_convert(buf_temp, argptr, arg_type, THUNK_HOST);
+            unlock_user(argptr, arg, 0);
+            ret = get_errno(safe_ioctl(fd, ie->host_cmd, buf_temp));
+            if (!is_error(ret)) {
+                argptr = lock_user(VERIFY_WRITE, arg, target_size, 0);
+                if (!argptr) {
+                    return -TARGET_EFAULT;
+                }
+                thunk_convert(argptr, buf_temp, arg_type, THUNK_TARGET);
+                unlock_user(argptr, arg, target_size);
+            }
+            break;
+        }
+        break;
+    default:
+        gemu_log("Unsupported ioctl type: cmd=0x%04lx type=%d\n",
+                 (long)cmd, arg_type[0]);
+        ret = -TARGET_ENOSYS;
+        break;
+    }
+    return ret;
+}
+
 IMPL(kill)
 {
     return get_errno(safe_kill(arg1, target_to_host_signal(arg2)));
@@ -8784,8 +8789,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_ioctl:
-        return do_ioctl(arg1, arg2, arg3);
 #ifdef TARGET_NR_fcntl
     case TARGET_NR_fcntl:
         return do_fcntl(arg1, arg2, arg3);
@@ -12641,6 +12644,7 @@ static impl_fn *syscall_table(unsigned num)
 #if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
         SYSCALL(getxpid);
 #endif
+        SYSCALL(ioctl);
         SYSCALL(kill);
 #ifdef TARGET_NR_link
         SYSCALL(link);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 027/108] linux-user: Split out chroot, dup2, dup3, fcntl, setpgid, umask
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (25 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 026/108] linux-user: Split out ioctl Richard Henderson
@ 2018-06-10  3:00 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 028/108] linux-user: Split out getpgrp, getppid, setsid Richard Henderson
                   ` (84 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define dup3; remove the ifdef.

If !CONFIG_DUP3, fall back to dup2 when flags == 0.  This will help
emulation of new targets that do not define the dup2 syscall, using
dup3 as the syscall backing the dup2 posix function.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 113 ++++++++++++++++++++++++++++---------------
 1 file changed, 75 insertions(+), 38 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index ebe57d86aa..8e13a16e91 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7855,6 +7855,19 @@ IMPL(chmod)
 }
 #endif
 
+IMPL(chroot)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(chroot(p));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+
 IMPL(close)
 {
     fd_trans_unregister(arg1);
@@ -7886,6 +7899,41 @@ IMPL(dup)
     return ret;
 }
 
+#ifdef TARGET_NR_dup2
+IMPL(dup2)
+{
+    abi_long ret = get_errno(dup2(arg1, arg2));
+    if (ret >= 0) {
+        fd_trans_dup(arg1, arg2);
+    }
+    return ret;
+}
+#endif
+
+IMPL(dup3)
+{
+    int host_flags = target_to_host_bitmask(arg3, fcntl_flags_tbl);
+    abi_long ret;
+
+    if ((arg3 & ~TARGET_O_CLOEXEC) != 0) {
+        return -EINVAL;
+    }
+#ifdef CONFIG_DUP3
+    ret = dup3(arg1, arg2, host_flags);
+#else
+    if (host_flags == 0) {
+        ret = dup2(arg1, arg2);
+    } else {
+        return -TARGET_ENOSYS;
+    }
+#endif
+    ret = get_errno(ret);
+    if (ret >= 0) {
+        fd_trans_dup(arg1, arg2);
+    }
+    return ret;
+}
+
 IMPL(execve)
 {
     abi_ulong *guest_ptrs;
@@ -8046,6 +8094,13 @@ IMPL(faccessat)
     return ret;
 }
 
+#ifdef TARGET_NR_fcntl
+IMPL(fcntl)
+{
+    return do_fcntl(arg1, arg2, arg3);
+}
+#endif
+
 #ifdef TARGET_NR_fork
 IMPL(fork)
 {
@@ -8553,6 +8608,11 @@ IMPL(rmdir)
 }
 #endif
 
+IMPL(setpgid)
+{
+    return get_errno(setpgid(arg1, arg2));
+}
+
 #ifdef TARGET_NR_stime
 IMPL(stime)
 {
@@ -8611,6 +8671,11 @@ IMPL(times)
     return host_to_target_clock_t(ret);
 }
 
+IMPL(umask)
+{
+    return get_errno(umask(arg1));
+}
+
 #ifdef TARGET_NR_umount
 IMPL(umount)
 {
@@ -8789,44 +8854,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_fcntl
-    case TARGET_NR_fcntl:
-        return do_fcntl(arg1, arg2, arg3);
-#endif
-    case TARGET_NR_setpgid:
-        return get_errno(setpgid(arg1, arg2));
-    case TARGET_NR_umask:
-        return get_errno(umask(arg1));
-    case TARGET_NR_chroot:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(chroot(p));
-        unlock_user(p, arg1, 0);
-        return ret;
-#ifdef TARGET_NR_dup2
-    case TARGET_NR_dup2:
-        ret = get_errno(dup2(arg1, arg2));
-        if (ret >= 0) {
-            fd_trans_dup(arg1, arg2);
-        }
-        return ret;
-#endif
-#if defined(CONFIG_DUP3) && defined(TARGET_NR_dup3)
-    case TARGET_NR_dup3:
-    {
-        int host_flags;
-
-        if ((arg3 & ~TARGET_O_CLOEXEC) != 0) {
-            return -EINVAL;
-        }
-        host_flags = target_to_host_bitmask(arg3, fcntl_flags_tbl);
-        ret = get_errno(dup3(arg1, arg2, host_flags));
-        if (ret >= 0) {
-            fd_trans_dup(arg1, arg2);
-        }
-        return ret;
-    }
-#endif
 #ifdef TARGET_NR_getppid /* not on alpha */
     case TARGET_NR_getppid:
         return get_errno(getppid());
@@ -12622,6 +12649,7 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(brk);
         SYSCALL(close);
         SYSCALL(chdir);
+        SYSCALL(chroot);
 #ifdef TARGET_NR_chmod
         SYSCALL(chmod);
 #endif
@@ -12629,9 +12657,16 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(creat);
 #endif
         SYSCALL(dup);
+#ifdef TARGET_NR_dup2
+        SYSCALL(dup2);
+#endif
+        SYSCALL(dup3);
         SYSCALL(execve);
         SYSCALL(exit);
         SYSCALL(faccessat);
+#ifdef TARGET_NR_fcntl
+        SYSCALL(fcntl);
+#endif
 #ifdef TARGET_NR_fork
         SYSCALL(fork);
 #endif
@@ -12691,6 +12726,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_rmdir
         SYSCALL(rmdir);
 #endif
+        SYSCALL(setpgid);
 #ifdef TARGET_NR_stime
         SYSCALL(stime);
 #endif
@@ -12702,6 +12738,7 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(time);
 #endif
         SYSCALL(times);
+        SYSCALL(umask);
 #ifdef TARGET_NR_umount
         SYSCALL(umount);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 028/108] linux-user: Split out getpgrp, getppid, setsid
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (26 preceding siblings ...)
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 027/108] linux-user: Split out chroot, dup2, dup3, fcntl, setpgid, umask Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 029/108] linux-user: Split out rt_sigaction, sigaction Richard Henderson
                   ` (83 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 36 ++++++++++++++++++++++++++----------
 1 file changed, 26 insertions(+), 10 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8e13a16e91..d78288258a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8131,6 +8131,13 @@ IMPL(futimesat)
 }
 #endif
 
+#ifdef TARGET_NR_getpgrp
+IMPL(getpgrp)
+{
+    return get_errno(getpgrp());
+}
+#endif
+
 #ifdef TARGET_NR_getpid
 IMPL(getpid)
 {
@@ -8138,6 +8145,13 @@ IMPL(getpid)
 }
 #endif
 
+#ifdef TARGET_NR_getppid
+IMPL(getppid)
+{
+    return get_errno(getppid());
+}
+#endif
+
 #if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
 IMPL(getxpid)
 {
@@ -8613,6 +8627,11 @@ IMPL(setpgid)
     return get_errno(setpgid(arg1, arg2));
 }
 
+IMPL(setsid)
+{
+    return get_errno(setsid());
+}
+
 #ifdef TARGET_NR_stime
 IMPL(stime)
 {
@@ -8854,16 +8873,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_getppid /* not on alpha */
-    case TARGET_NR_getppid:
-        return get_errno(getppid());
-#endif
-#ifdef TARGET_NR_getpgrp
-    case TARGET_NR_getpgrp:
-        return get_errno(getpgrp());
-#endif
-    case TARGET_NR_setsid:
-        return get_errno(setsid());
 #ifdef TARGET_NR_sigaction
     case TARGET_NR_sigaction:
         {
@@ -12673,9 +12682,15 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_futimesat
         SYSCALL(futimesat);
 #endif
+#ifdef TARGET_NR_getpgrp
+        SYSCALL(getpgrp);
+#endif
 #ifdef TARGET_NR_getpid
         SYSCALL(getpid);
 #endif
+#ifdef TARGET_NR_getppid
+        SYSCALL(getppid);
+#endif
 #if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
         SYSCALL(getxpid);
 #endif
@@ -12727,6 +12742,7 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(rmdir);
 #endif
         SYSCALL(setpgid);
+        SYSCALL(setsid);
 #ifdef TARGET_NR_stime
         SYSCALL(stime);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 029/108] linux-user: Split out rt_sigaction, sigaction
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (27 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 028/108] linux-user: Split out getpgrp, getppid, setsid Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 030/108] linux-user: Split out rt_sigprocmask, sgetmask, sigprocmask, ssetmask Richard Henderson
                   ` (82 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 325 ++++++++++++++++++++++---------------------
 1 file changed, 165 insertions(+), 160 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index d78288258a..cdb4dd5bb4 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8622,6 +8622,81 @@ IMPL(rmdir)
 }
 #endif
 
+IMPL(rt_sigaction)
+{
+    abi_long ret;
+#ifdef TARGET_ALPHA
+    /* For Alpha and SPARC this is a 5 argument syscall, with
+     * a 'restorer' parameter which must be copied into the
+     * sa_restorer field of the sigaction struct.
+     * For Alpha that 'restorer' is arg5; for SPARC it is arg4,
+     * and arg5 is the sigsetsize.
+     * Alpha also has a separate rt_sigaction struct that it uses
+     * here; SPARC uses the usual sigaction struct.
+     */
+    struct target_rt_sigaction *rt_act;
+    struct target_sigaction act, oact, *pact = 0;
+
+    if (arg4 != sizeof(target_sigset_t)) {
+        return -TARGET_EINVAL;
+    }
+    if (arg2) {
+        if (!lock_user_struct(VERIFY_READ, rt_act, arg2, 1)) {
+            return -TARGET_EFAULT;
+        }
+        act._sa_handler = rt_act->_sa_handler;
+        act.sa_mask = rt_act->sa_mask;
+        act.sa_flags = rt_act->sa_flags;
+        act.sa_restorer = arg5;
+        unlock_user_struct(rt_act, arg2, 0);
+        pact = &act;
+    }
+    ret = get_errno(do_sigaction(arg1, pact, &oact));
+    if (!is_error(ret) && arg3) {
+        if (!lock_user_struct(VERIFY_WRITE, rt_act, arg3, 0)) {
+            return -TARGET_EFAULT;
+        }
+        rt_act->_sa_handler = oact._sa_handler;
+        rt_act->sa_mask = oact.sa_mask;
+        rt_act->sa_flags = oact.sa_flags;
+        unlock_user_struct(rt_act, arg3, 1);
+    }
+#else
+# ifdef TARGET_SPARC
+    target_ulong restorer = arg4;
+    target_ulong sigsetsize = arg5;
+# else
+    target_ulong sigsetsize = arg4;
+# endif
+    struct target_sigaction *act = NULL;
+    struct target_sigaction *oact = NULL;
+
+    if (sigsetsize != sizeof(target_sigset_t)) {
+        return -TARGET_EINVAL;
+    }
+    if (arg2) {
+        if (!lock_user_struct(VERIFY_READ, act, arg2, 1)) {
+            return -TARGET_EFAULT;
+        }
+# ifdef TARGET_ARCH_HAS_KA_RESTORER
+        act->ka_restorer = restorer;
+# endif
+    }
+    if (arg3 && !lock_user_struct(VERIFY_WRITE, oact, arg3, 0)) {
+        ret = -TARGET_EFAULT;
+    } else {
+        ret = get_errno(do_sigaction(arg1, act, oact));
+    }
+    if (act) {
+        unlock_user_struct(act, arg2, 0);
+    }
+    if (oact) {
+        unlock_user_struct(oact, arg3, 1);
+    }
+#endif
+    return ret;
+}
+
 IMPL(setpgid)
 {
     return get_errno(setpgid(arg1, arg2));
@@ -8632,6 +8707,92 @@ IMPL(setsid)
     return get_errno(setsid());
 }
 
+#ifdef TARGET_NR_sigaction
+IMPL(sigaction)
+{
+    abi_long ret;
+# if defined(TARGET_ALPHA)
+    struct target_sigaction act, oact, *pact = NULL;
+    struct target_old_sigaction *old_act;
+    if (arg2) {
+        if (!lock_user_struct(VERIFY_READ, old_act, arg2, 1)) {
+            return -TARGET_EFAULT;
+        }
+        act._sa_handler = old_act->_sa_handler;
+        target_siginitset(&act.sa_mask, old_act->sa_mask);
+        act.sa_flags = old_act->sa_flags;
+        act.sa_restorer = 0;
+        unlock_user_struct(old_act, arg2, 0);
+        pact = &act;
+    }
+    ret = get_errno(do_sigaction(arg1, pact, &oact));
+    if (!is_error(ret) && arg3) {
+        if (!lock_user_struct(VERIFY_WRITE, old_act, arg3, 0)) {
+            return -TARGET_EFAULT;
+        }
+        old_act->_sa_handler = oact._sa_handler;
+        old_act->sa_mask = oact.sa_mask.sig[0];
+        old_act->sa_flags = oact.sa_flags;
+        unlock_user_struct(old_act, arg3, 1);
+    }
+# elif defined(TARGET_MIPS)
+    struct target_sigaction act, oact, *pact = NULL, *old_act;
+    if (arg2) {
+        if (!lock_user_struct(VERIFY_READ, old_act, arg2, 1)) {
+            return -TARGET_EFAULT;
+        }
+        act._sa_handler = old_act->_sa_handler;
+        target_siginitset(&act.sa_mask, old_act->sa_mask.sig[0]);
+        act.sa_flags = old_act->sa_flags;
+        unlock_user_struct(old_act, arg2, 0);
+        pact = &act;
+    }
+    ret = get_errno(do_sigaction(arg1, pact, &oact));
+    if (!is_error(ret) && arg3) {
+        if (!lock_user_struct(VERIFY_WRITE, old_act, arg3, 0)) {
+            return -TARGET_EFAULT;
+        }
+        old_act->_sa_handler = oact._sa_handler;
+        old_act->sa_flags = oact.sa_flags;
+        old_act->sa_mask.sig[0] = oact.sa_mask.sig[0];
+        old_act->sa_mask.sig[1] = 0;
+        old_act->sa_mask.sig[2] = 0;
+        old_act->sa_mask.sig[3] = 0;
+        unlock_user_struct(old_act, arg3, 1);
+    }
+# else
+    struct target_sigaction act, oact, *pact = NULL;
+    struct target_old_sigaction *old_act;
+    if (arg2) {
+        if (!lock_user_struct(VERIFY_READ, old_act, arg2, 1)) {
+            return -TARGET_EFAULT;
+        }
+        act._sa_handler = old_act->_sa_handler;
+        target_siginitset(&act.sa_mask, old_act->sa_mask);
+        act.sa_flags = old_act->sa_flags;
+        act.sa_restorer = old_act->sa_restorer;
+#  ifdef TARGET_ARCH_HAS_KA_RESTORER
+        act.ka_restorer = 0;
+#  endif
+        unlock_user_struct(old_act, arg2, 0);
+        pact = &act;
+    }
+    ret = get_errno(do_sigaction(arg1, pact, &oact));
+    if (!is_error(ret) && arg3) {
+        if (!lock_user_struct(VERIFY_WRITE, old_act, arg3, 0)) {
+            return -TARGET_EFAULT;
+        }
+        old_act->_sa_handler = oact._sa_handler;
+        old_act->sa_mask = oact.sa_mask.sig[0];
+        old_act->sa_flags = oact.sa_flags;
+        old_act->sa_restorer = oact.sa_restorer;
+        unlock_user_struct(old_act, arg3, 1);
+    }
+# endif
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_stime
 IMPL(stime)
 {
@@ -8873,166 +9034,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_sigaction
-    case TARGET_NR_sigaction:
-        {
-#if defined(TARGET_ALPHA)
-            struct target_sigaction act, oact, *pact = 0;
-            struct target_old_sigaction *old_act;
-            if (arg2) {
-                if (!lock_user_struct(VERIFY_READ, old_act, arg2, 1))
-                    return -TARGET_EFAULT;
-                act._sa_handler = old_act->_sa_handler;
-                target_siginitset(&act.sa_mask, old_act->sa_mask);
-                act.sa_flags = old_act->sa_flags;
-                act.sa_restorer = 0;
-                unlock_user_struct(old_act, arg2, 0);
-                pact = &act;
-            }
-            ret = get_errno(do_sigaction(arg1, pact, &oact));
-            if (!is_error(ret) && arg3) {
-                if (!lock_user_struct(VERIFY_WRITE, old_act, arg3, 0))
-                    return -TARGET_EFAULT;
-                old_act->_sa_handler = oact._sa_handler;
-                old_act->sa_mask = oact.sa_mask.sig[0];
-                old_act->sa_flags = oact.sa_flags;
-                unlock_user_struct(old_act, arg3, 1);
-            }
-#elif defined(TARGET_MIPS)
-	    struct target_sigaction act, oact, *pact, *old_act;
-
-	    if (arg2) {
-                if (!lock_user_struct(VERIFY_READ, old_act, arg2, 1))
-                    return -TARGET_EFAULT;
-		act._sa_handler = old_act->_sa_handler;
-		target_siginitset(&act.sa_mask, old_act->sa_mask.sig[0]);
-		act.sa_flags = old_act->sa_flags;
-		unlock_user_struct(old_act, arg2, 0);
-		pact = &act;
-	    } else {
-		pact = NULL;
-	    }
-
-	    ret = get_errno(do_sigaction(arg1, pact, &oact));
-
-	    if (!is_error(ret) && arg3) {
-                if (!lock_user_struct(VERIFY_WRITE, old_act, arg3, 0))
-                    return -TARGET_EFAULT;
-		old_act->_sa_handler = oact._sa_handler;
-		old_act->sa_flags = oact.sa_flags;
-		old_act->sa_mask.sig[0] = oact.sa_mask.sig[0];
-		old_act->sa_mask.sig[1] = 0;
-		old_act->sa_mask.sig[2] = 0;
-		old_act->sa_mask.sig[3] = 0;
-		unlock_user_struct(old_act, arg3, 1);
-	    }
-#else
-            struct target_old_sigaction *old_act;
-            struct target_sigaction act, oact, *pact;
-            if (arg2) {
-                if (!lock_user_struct(VERIFY_READ, old_act, arg2, 1))
-                    return -TARGET_EFAULT;
-                act._sa_handler = old_act->_sa_handler;
-                target_siginitset(&act.sa_mask, old_act->sa_mask);
-                act.sa_flags = old_act->sa_flags;
-                act.sa_restorer = old_act->sa_restorer;
-#ifdef TARGET_ARCH_HAS_KA_RESTORER
-                act.ka_restorer = 0;
-#endif
-                unlock_user_struct(old_act, arg2, 0);
-                pact = &act;
-            } else {
-                pact = NULL;
-            }
-            ret = get_errno(do_sigaction(arg1, pact, &oact));
-            if (!is_error(ret) && arg3) {
-                if (!lock_user_struct(VERIFY_WRITE, old_act, arg3, 0))
-                    return -TARGET_EFAULT;
-                old_act->_sa_handler = oact._sa_handler;
-                old_act->sa_mask = oact.sa_mask.sig[0];
-                old_act->sa_flags = oact.sa_flags;
-                old_act->sa_restorer = oact.sa_restorer;
-                unlock_user_struct(old_act, arg3, 1);
-            }
-#endif
-        }
-        return ret;
-#endif
-    case TARGET_NR_rt_sigaction:
-        {
-#if defined(TARGET_ALPHA)
-            /* For Alpha and SPARC this is a 5 argument syscall, with
-             * a 'restorer' parameter which must be copied into the
-             * sa_restorer field of the sigaction struct.
-             * For Alpha that 'restorer' is arg5; for SPARC it is arg4,
-             * and arg5 is the sigsetsize.
-             * Alpha also has a separate rt_sigaction struct that it uses
-             * here; SPARC uses the usual sigaction struct.
-             */
-            struct target_rt_sigaction *rt_act;
-            struct target_sigaction act, oact, *pact = 0;
-
-            if (arg4 != sizeof(target_sigset_t)) {
-                return -TARGET_EINVAL;
-            }
-            if (arg2) {
-                if (!lock_user_struct(VERIFY_READ, rt_act, arg2, 1))
-                    return -TARGET_EFAULT;
-                act._sa_handler = rt_act->_sa_handler;
-                act.sa_mask = rt_act->sa_mask;
-                act.sa_flags = rt_act->sa_flags;
-                act.sa_restorer = arg5;
-                unlock_user_struct(rt_act, arg2, 0);
-                pact = &act;
-            }
-            ret = get_errno(do_sigaction(arg1, pact, &oact));
-            if (!is_error(ret) && arg3) {
-                if (!lock_user_struct(VERIFY_WRITE, rt_act, arg3, 0))
-                    return -TARGET_EFAULT;
-                rt_act->_sa_handler = oact._sa_handler;
-                rt_act->sa_mask = oact.sa_mask;
-                rt_act->sa_flags = oact.sa_flags;
-                unlock_user_struct(rt_act, arg3, 1);
-            }
-#else
-#ifdef TARGET_SPARC
-            target_ulong restorer = arg4;
-            target_ulong sigsetsize = arg5;
-#else
-            target_ulong sigsetsize = arg4;
-#endif
-            struct target_sigaction *act;
-            struct target_sigaction *oact;
-
-            if (sigsetsize != sizeof(target_sigset_t)) {
-                return -TARGET_EINVAL;
-            }
-            if (arg2) {
-                if (!lock_user_struct(VERIFY_READ, act, arg2, 1)) {
-                    return -TARGET_EFAULT;
-                }
-#ifdef TARGET_ARCH_HAS_KA_RESTORER
-                act->ka_restorer = restorer;
-#endif
-            } else {
-                act = NULL;
-            }
-            if (arg3) {
-                if (!lock_user_struct(VERIFY_WRITE, oact, arg3, 0)) {
-                    ret = -TARGET_EFAULT;
-                    goto rt_sigaction_fail;
-                }
-            } else
-                oact = NULL;
-            ret = get_errno(do_sigaction(arg1, act, oact));
-	rt_sigaction_fail:
-            if (act)
-                unlock_user_struct(act, arg2, 0);
-            if (oact)
-                unlock_user_struct(oact, arg3, 1);
-#endif
-        }
-        return ret;
 #ifdef TARGET_NR_sgetmask /* not on alpha */
     case TARGET_NR_sgetmask:
         {
@@ -12741,8 +12742,12 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_rmdir
         SYSCALL(rmdir);
 #endif
+        SYSCALL(rt_sigaction);
         SYSCALL(setpgid);
         SYSCALL(setsid);
+#ifdef TARGET_NR_sigaction
+        SYSCALL(sigaction);
+#endif
 #ifdef TARGET_NR_stime
         SYSCALL(stime);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 030/108] linux-user: Split out rt_sigprocmask, sgetmask, sigprocmask, ssetmask
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (28 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 029/108] linux-user: Split out rt_sigaction, sigaction Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 031/108] linux-user: Split out rt_sigpending, rt_sigsuspend, sigpending, sigsuspend Richard Henderson
                   ` (81 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 294 +++++++++++++++++++++++--------------------
 1 file changed, 158 insertions(+), 136 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index cdb4dd5bb4..cc818ea65e 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8697,6 +8697,65 @@ IMPL(rt_sigaction)
     return ret;
 }
 
+IMPL(rt_sigprocmask)
+{
+    int how = 0;
+    sigset_t set, oldset, *set_ptr = NULL;
+    abi_long ret;
+    target_sigset_t *p;
+
+    if (arg4 != sizeof(target_sigset_t)) {
+        return -TARGET_EINVAL;
+    }
+
+    if (arg2) {
+        switch (arg1) {
+        case TARGET_SIG_BLOCK:
+            how = SIG_BLOCK;
+            break;
+        case TARGET_SIG_UNBLOCK:
+            how = SIG_UNBLOCK;
+            break;
+        case TARGET_SIG_SETMASK:
+            how = SIG_SETMASK;
+            break;
+        default:
+            return -TARGET_EINVAL;
+        }
+        p = lock_user(VERIFY_READ, arg2, sizeof(target_sigset_t), 1);
+        if (!p) {
+            return -TARGET_EFAULT;
+        }
+        target_to_host_sigset(&set, p);
+        unlock_user(p, arg2, 0);
+        set_ptr = &set;
+    }
+    ret = do_sigprocmask(how, set_ptr, &oldset);
+    if (!is_error(ret) && arg3) {
+        p = lock_user(VERIFY_WRITE, arg3, sizeof(target_sigset_t), 0);
+        if (!p) {
+            return -TARGET_EFAULT;
+        }
+        host_to_target_sigset(p, &oldset);
+        unlock_user(p, arg3, sizeof(target_sigset_t));
+    }
+    return ret;
+}
+
+#ifdef TARGET_NR_sgetmask
+IMPL(sgetmask)
+{
+    sigset_t cur_set;
+    abi_ulong target_set;
+    abi_long ret = do_sigprocmask(0, NULL, &cur_set);
+    if (!ret) {
+        host_to_target_old_sigset(&target_set, &cur_set);
+        ret = target_set;
+    }
+    return ret;
+}
+#endif
+
 IMPL(setpgid)
 {
     return get_errno(setpgid(arg1, arg2));
@@ -8793,6 +8852,95 @@ IMPL(sigaction)
 }
 #endif
 
+#ifdef TARGET_NR_sigprocmask
+IMPL(sigprocmask)
+{
+    abi_long ret;
+# ifdef TARGET_ALPHA
+    sigset_t set, oldset;
+    abi_ulong mask;
+    int how;
+
+    switch (arg1) {
+    case TARGET_SIG_BLOCK:
+        how = SIG_BLOCK;
+        break;
+    case TARGET_SIG_UNBLOCK:
+        how = SIG_UNBLOCK;
+        break;
+    case TARGET_SIG_SETMASK:
+        how = SIG_SETMASK;
+        break;
+    default:
+        return -TARGET_EINVAL;
+    }
+    mask = arg2;
+    target_to_host_old_sigset(&set, &mask);
+
+    ret = do_sigprocmask(how, &set, &oldset);
+    if (!is_error(ret)) {
+        host_to_target_old_sigset(&mask, &oldset);
+        ret = mask;
+        ((CPUAlphaState *)cpu_env)->ir[IR_V0] = 0; /* force no error */
+    }
+# else
+    sigset_t set, oldset, *set_ptr = NULL;
+    int how = 0;
+    abi_ulong *p;
+
+    if (arg2) {
+        switch (arg1) {
+        case TARGET_SIG_BLOCK:
+            how = SIG_BLOCK;
+            break;
+        case TARGET_SIG_UNBLOCK:
+            how = SIG_UNBLOCK;
+            break;
+        case TARGET_SIG_SETMASK:
+            how = SIG_SETMASK;
+            break;
+        default:
+            return -TARGET_EINVAL;
+        }
+        p = lock_user(VERIFY_READ, arg2, sizeof(target_sigset_t), 1);
+        if (!p) {
+            return -TARGET_EFAULT;
+        }
+        target_to_host_old_sigset(&set, p);
+        unlock_user(p, arg2, 0);
+        set_ptr = &set;
+    }
+    ret = do_sigprocmask(how, set_ptr, &oldset);
+    if (!is_error(ret) && arg3) {
+        p = lock_user(VERIFY_WRITE, arg3, sizeof(target_sigset_t), 0);
+        if (!p) {
+            return -TARGET_EFAULT;
+        }
+        host_to_target_old_sigset(p, &oldset);
+        unlock_user(p, arg3, sizeof(target_sigset_t));
+    }
+# endif
+    return ret;
+}
+#endif
+
+#ifdef TARGET_NR_ssetmask
+IMPL(ssetmask)
+{
+    sigset_t set, oset;
+    abi_ulong target_set = arg1;
+    abi_long ret;
+
+    target_to_host_old_sigset(&set, &target_set);
+    ret = do_sigprocmask(SIG_SETMASK, &set, &oset);
+    if (!ret) {
+        host_to_target_old_sigset(&target_set, &oset);
+        ret = target_set;
+    }
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_stime
 IMPL(stime)
 {
@@ -9034,142 +9182,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_sgetmask /* not on alpha */
-    case TARGET_NR_sgetmask:
-        {
-            sigset_t cur_set;
-            abi_ulong target_set;
-            ret = do_sigprocmask(0, NULL, &cur_set);
-            if (!ret) {
-                host_to_target_old_sigset(&target_set, &cur_set);
-                ret = target_set;
-            }
-        }
-        return ret;
-#endif
-#ifdef TARGET_NR_ssetmask /* not on alpha */
-    case TARGET_NR_ssetmask:
-        {
-            sigset_t set, oset;
-            abi_ulong target_set = arg1;
-            target_to_host_old_sigset(&set, &target_set);
-            ret = do_sigprocmask(SIG_SETMASK, &set, &oset);
-            if (!ret) {
-                host_to_target_old_sigset(&target_set, &oset);
-                ret = target_set;
-            }
-        }
-        return ret;
-#endif
-#ifdef TARGET_NR_sigprocmask
-    case TARGET_NR_sigprocmask:
-        {
-#if defined(TARGET_ALPHA)
-            sigset_t set, oldset;
-            abi_ulong mask;
-            int how;
-
-            switch (arg1) {
-            case TARGET_SIG_BLOCK:
-                how = SIG_BLOCK;
-                break;
-            case TARGET_SIG_UNBLOCK:
-                how = SIG_UNBLOCK;
-                break;
-            case TARGET_SIG_SETMASK:
-                how = SIG_SETMASK;
-                break;
-            default:
-                return -TARGET_EINVAL;
-            }
-            mask = arg2;
-            target_to_host_old_sigset(&set, &mask);
-
-            ret = do_sigprocmask(how, &set, &oldset);
-            if (!is_error(ret)) {
-                host_to_target_old_sigset(&mask, &oldset);
-                ret = mask;
-                ((CPUAlphaState *)cpu_env)->ir[IR_V0] = 0; /* force no error */
-            }
-#else
-            sigset_t set, oldset, *set_ptr;
-            int how;
-
-            if (arg2) {
-                switch (arg1) {
-                case TARGET_SIG_BLOCK:
-                    how = SIG_BLOCK;
-                    break;
-                case TARGET_SIG_UNBLOCK:
-                    how = SIG_UNBLOCK;
-                    break;
-                case TARGET_SIG_SETMASK:
-                    how = SIG_SETMASK;
-                    break;
-                default:
-                    return -TARGET_EINVAL;
-                }
-                if (!(p = lock_user(VERIFY_READ, arg2, sizeof(target_sigset_t), 1)))
-                    return -TARGET_EFAULT;
-                target_to_host_old_sigset(&set, p);
-                unlock_user(p, arg2, 0);
-                set_ptr = &set;
-            } else {
-                how = 0;
-                set_ptr = NULL;
-            }
-            ret = do_sigprocmask(how, set_ptr, &oldset);
-            if (!is_error(ret) && arg3) {
-                if (!(p = lock_user(VERIFY_WRITE, arg3, sizeof(target_sigset_t), 0)))
-                    return -TARGET_EFAULT;
-                host_to_target_old_sigset(p, &oldset);
-                unlock_user(p, arg3, sizeof(target_sigset_t));
-            }
-#endif
-        }
-        return ret;
-#endif
-    case TARGET_NR_rt_sigprocmask:
-        {
-            int how = arg1;
-            sigset_t set, oldset, *set_ptr;
-
-            if (arg4 != sizeof(target_sigset_t)) {
-                return -TARGET_EINVAL;
-            }
-
-            if (arg2) {
-                switch(how) {
-                case TARGET_SIG_BLOCK:
-                    how = SIG_BLOCK;
-                    break;
-                case TARGET_SIG_UNBLOCK:
-                    how = SIG_UNBLOCK;
-                    break;
-                case TARGET_SIG_SETMASK:
-                    how = SIG_SETMASK;
-                    break;
-                default:
-                    return -TARGET_EINVAL;
-                }
-                if (!(p = lock_user(VERIFY_READ, arg2, sizeof(target_sigset_t), 1)))
-                    return -TARGET_EFAULT;
-                target_to_host_sigset(&set, p);
-                unlock_user(p, arg2, 0);
-                set_ptr = &set;
-            } else {
-                how = 0;
-                set_ptr = NULL;
-            }
-            ret = do_sigprocmask(how, set_ptr, &oldset);
-            if (!is_error(ret) && arg3) {
-                if (!(p = lock_user(VERIFY_WRITE, arg3, sizeof(target_sigset_t), 0)))
-                    return -TARGET_EFAULT;
-                host_to_target_sigset(p, &oldset);
-                unlock_user(p, arg3, sizeof(target_sigset_t));
-            }
-        }
-        return ret;
 #ifdef TARGET_NR_sigpending
     case TARGET_NR_sigpending:
         {
@@ -12743,11 +12755,21 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(rmdir);
 #endif
         SYSCALL(rt_sigaction);
+        SYSCALL(rt_sigprocmask);
+#ifdef TARGET_NR_sgetmask
+        SYSCALL(sgetmask);
+#endif
         SYSCALL(setpgid);
         SYSCALL(setsid);
 #ifdef TARGET_NR_sigaction
         SYSCALL(sigaction);
 #endif
+#ifdef TARGET_NR_sigprocmask
+        SYSCALL(sigprocmask);
+#endif
+#ifdef TARGET_NR_ssetmask
+        SYSCALL(ssetmask);
+#endif
 #ifdef TARGET_NR_stime
         SYSCALL(stime);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 031/108] linux-user: Split out rt_sigpending, rt_sigsuspend, sigpending, sigsuspend
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (29 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 030/108] linux-user: Split out rt_sigprocmask, sgetmask, sigprocmask, ssetmask Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 032/108] linux-user: Split out rt_sigqueueinfo, rt_sigtimedwait, rt_tgsigqueueinfo Richard Henderson
                   ` (80 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 176 +++++++++++++++++++++++++------------------
 1 file changed, 101 insertions(+), 75 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index cc818ea65e..6869a0db47 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8697,6 +8697,32 @@ IMPL(rt_sigaction)
     return ret;
 }
 
+IMPL(rt_sigpending)
+{
+    sigset_t set;
+    abi_long ret;
+
+    /* Yes, this check is >, not != like most. We follow the kernel's
+     * logic and it does it like this because it implements
+     * NR_sigpending through the same code path, and in that case
+     * the old_sigset_t is smaller in size.
+     */
+    if (arg2 > sizeof(target_sigset_t)) {
+        return -TARGET_EINVAL;
+    }
+    ret = get_errno(sigpending(&set));
+    if (!is_error(ret)) {
+        target_sigset_t *p;
+        p = lock_user(VERIFY_WRITE, arg1, sizeof(target_sigset_t), 0);
+        if (!p) {
+            return -TARGET_EFAULT;
+        }
+        host_to_target_sigset(p, &set);
+        unlock_user(p, arg1, sizeof(target_sigset_t));
+    }
+    return ret;
+}
+
 IMPL(rt_sigprocmask)
 {
     int how = 0;
@@ -8742,6 +8768,29 @@ IMPL(rt_sigprocmask)
     return ret;
 }
 
+IMPL(rt_sigsuspend)
+{
+    CPUState *cpu = ENV_GET_CPU(cpu_env);
+    TaskState *ts = cpu->opaque;
+    target_sigset_t *p;
+    abi_long ret;
+
+    if (arg2 != sizeof(target_sigset_t)) {
+        return -TARGET_EINVAL;
+    }
+    p = lock_user(VERIFY_READ, arg1, sizeof(target_sigset_t), 1);
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    target_to_host_sigset(&ts->sigsuspend_mask, p);
+    unlock_user(p, arg1, 0);
+    ret = get_errno(safe_rt_sigsuspend(&ts->sigsuspend_mask, SIGSET_T_SIZE));
+    if (ret != -TARGET_ERESTARTSYS) {
+        ts->in_sigsuspend = 1;
+    }
+    return ret;
+}
+
 #ifdef TARGET_NR_sgetmask
 IMPL(sgetmask)
 {
@@ -8852,6 +8901,24 @@ IMPL(sigaction)
 }
 #endif
 
+#ifdef TARGET_NR_sigpending
+IMPL(sigpending)
+{
+    sigset_t set;
+    abi_long ret = get_errno(sigpending(&set));
+    if (!is_error(ret)) {
+        abi_ulong *p;
+        p = lock_user(VERIFY_WRITE, arg1, sizeof(target_sigset_t), 0);
+        if (!p) {
+            return -TARGET_EFAULT;
+        }
+        host_to_target_old_sigset(p, &set);
+        unlock_user(p, arg1, sizeof(target_sigset_t));
+    }
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_sigprocmask
 IMPL(sigprocmask)
 {
@@ -8924,6 +8991,32 @@ IMPL(sigprocmask)
 }
 #endif
 
+#ifdef TARGET_NR_sigsuspend
+IMPL(sigsuspend)
+{
+    CPUState *cpu = ENV_GET_CPU(cpu_env);
+    TaskState *ts = cpu->opaque;
+    abi_long ret;
+
+# ifdef TARGET_ALPHA
+    abi_ulong mask = arg1;
+    target_to_host_old_sigset(&ts->sigsuspend_mask, &mask);
+# else
+    abi_ulong *p = lock_user(VERIFY_READ, arg1, sizeof(target_sigset_t), 1);
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    target_to_host_old_sigset(&ts->sigsuspend_mask, p);
+    unlock_user(p, arg1, 0);
+# endif
+    ret = get_errno(safe_rt_sigsuspend(&ts->sigsuspend_mask, SIGSET_T_SIZE));
+    if (ret != -TARGET_ERESTARTSYS) {
+        ts->in_sigsuspend = 1;
+    }
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_ssetmask
 IMPL(ssetmask)
 {
@@ -9182,81 +9275,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_sigpending
-    case TARGET_NR_sigpending:
-        {
-            sigset_t set;
-            ret = get_errno(sigpending(&set));
-            if (!is_error(ret)) {
-                if (!(p = lock_user(VERIFY_WRITE, arg1, sizeof(target_sigset_t), 0)))
-                    return -TARGET_EFAULT;
-                host_to_target_old_sigset(p, &set);
-                unlock_user(p, arg1, sizeof(target_sigset_t));
-            }
-        }
-        return ret;
-#endif
-    case TARGET_NR_rt_sigpending:
-        {
-            sigset_t set;
-
-            /* Yes, this check is >, not != like most. We follow the kernel's
-             * logic and it does it like this because it implements
-             * NR_sigpending through the same code path, and in that case
-             * the old_sigset_t is smaller in size.
-             */
-            if (arg2 > sizeof(target_sigset_t)) {
-                return -TARGET_EINVAL;
-            }
-
-            ret = get_errno(sigpending(&set));
-            if (!is_error(ret)) {
-                if (!(p = lock_user(VERIFY_WRITE, arg1, sizeof(target_sigset_t), 0)))
-                    return -TARGET_EFAULT;
-                host_to_target_sigset(p, &set);
-                unlock_user(p, arg1, sizeof(target_sigset_t));
-            }
-        }
-        return ret;
-#ifdef TARGET_NR_sigsuspend
-    case TARGET_NR_sigsuspend:
-        {
-            TaskState *ts = cpu->opaque;
-#if defined(TARGET_ALPHA)
-            abi_ulong mask = arg1;
-            target_to_host_old_sigset(&ts->sigsuspend_mask, &mask);
-#else
-            if (!(p = lock_user(VERIFY_READ, arg1, sizeof(target_sigset_t), 1)))
-                return -TARGET_EFAULT;
-            target_to_host_old_sigset(&ts->sigsuspend_mask, p);
-            unlock_user(p, arg1, 0);
-#endif
-            ret = get_errno(safe_rt_sigsuspend(&ts->sigsuspend_mask,
-                                               SIGSET_T_SIZE));
-            if (ret != -TARGET_ERESTARTSYS) {
-                ts->in_sigsuspend = 1;
-            }
-        }
-        return ret;
-#endif
-    case TARGET_NR_rt_sigsuspend:
-        {
-            TaskState *ts = cpu->opaque;
-
-            if (arg2 != sizeof(target_sigset_t)) {
-                return -TARGET_EINVAL;
-            }
-            if (!(p = lock_user(VERIFY_READ, arg1, sizeof(target_sigset_t), 1)))
-                return -TARGET_EFAULT;
-            target_to_host_sigset(&ts->sigsuspend_mask, p);
-            unlock_user(p, arg1, 0);
-            ret = get_errno(safe_rt_sigsuspend(&ts->sigsuspend_mask,
-                                               SIGSET_T_SIZE));
-            if (ret != -TARGET_ERESTARTSYS) {
-                ts->in_sigsuspend = 1;
-            }
-        }
-        return ret;
     case TARGET_NR_rt_sigtimedwait:
         {
             sigset_t set;
@@ -12755,7 +12773,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(rmdir);
 #endif
         SYSCALL(rt_sigaction);
+        SYSCALL(rt_sigpending);
         SYSCALL(rt_sigprocmask);
+        SYSCALL(rt_sigsuspend);
 #ifdef TARGET_NR_sgetmask
         SYSCALL(sgetmask);
 #endif
@@ -12764,9 +12784,15 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_sigaction
         SYSCALL(sigaction);
 #endif
+#ifdef TARGET_NR_sigpending
+        SYSCALL(sigpending);
+#endif
 #ifdef TARGET_NR_sigprocmask
         SYSCALL(sigprocmask);
 #endif
+#ifdef TARGET_NR_sigsuspend
+        SYSCALL(sigsuspend);
+#endif
 #ifdef TARGET_NR_ssetmask
         SYSCALL(ssetmask);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 032/108] linux-user: Split out rt_sigqueueinfo, rt_sigtimedwait, rt_tgsigqueueinfo
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (30 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 031/108] linux-user: Split out rt_sigpending, rt_sigsuspend, sigpending, sigsuspend Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 033/108] linux-user: Split out rt_sigreturn, sethostname, setrlimit, sigreturn Richard Henderson
                   ` (79 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 129 ++++++++++++++++++++++---------------------
 1 file changed, 67 insertions(+), 62 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 6869a0db47..94dc773b4c 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8768,6 +8768,20 @@ IMPL(rt_sigprocmask)
     return ret;
 }
 
+IMPL(rt_sigqueueinfo)
+{
+    siginfo_t uinfo;
+    target_siginfo_t *p;
+
+    p = lock_user(VERIFY_READ, arg3, sizeof(target_siginfo_t), 1);
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    target_to_host_siginfo(&uinfo, p);
+    unlock_user(p, arg3, 0);
+    return get_errno(sys_rt_sigqueueinfo(arg1, arg2, &uinfo));
+}
+
 IMPL(rt_sigsuspend)
 {
     CPUState *cpu = ENV_GET_CPU(cpu_env);
@@ -8791,6 +8805,56 @@ IMPL(rt_sigsuspend)
     return ret;
 }
 
+IMPL(rt_sigtimedwait)
+{
+    sigset_t set;
+    struct timespec uts, *puts = NULL;
+    void *p;
+    siginfo_t uinfo;
+    abi_long ret;
+
+    if (arg4 != sizeof(target_sigset_t)) {
+        return -TARGET_EINVAL;
+    }
+    p = lock_user(VERIFY_READ, arg1, sizeof(target_sigset_t), 1);
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    target_to_host_sigset(&set, p);
+    unlock_user(p, arg1, 0);
+    if (arg3) {
+        puts = &uts;
+        target_to_host_timespec(puts, arg3);
+    }
+    ret = get_errno(safe_rt_sigtimedwait(&set, &uinfo, puts, SIGSET_T_SIZE));
+    if (!is_error(ret)) {
+        if (arg2) {
+            p = lock_user(VERIFY_WRITE, arg2, sizeof(target_siginfo_t), 0);
+            if (!p) {
+                return -TARGET_EFAULT;
+            }
+            host_to_target_siginfo(p, &uinfo);
+            unlock_user(p, arg2, sizeof(target_siginfo_t));
+        }
+        ret = host_to_target_signal(ret);
+    }
+    return ret;
+}
+
+IMPL(rt_tgsigqueueinfo)
+{
+    siginfo_t uinfo;
+    target_siginfo_t *p;
+
+    p = lock_user(VERIFY_READ, arg4, sizeof(target_siginfo_t), 1);
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    target_to_host_siginfo(&uinfo, p);
+    unlock_user(p, arg4, 0);
+    return get_errno(sys_rt_tgsigqueueinfo(arg1, arg2, arg3, &uinfo));
+}
+
 #ifdef TARGET_NR_sgetmask
 IMPL(sgetmask)
 {
@@ -9275,68 +9339,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_rt_sigtimedwait:
-        {
-            sigset_t set;
-            struct timespec uts, *puts;
-            siginfo_t uinfo;
-
-            if (arg4 != sizeof(target_sigset_t)) {
-                return -TARGET_EINVAL;
-            }
-
-            if (!(p = lock_user(VERIFY_READ, arg1, sizeof(target_sigset_t), 1)))
-                return -TARGET_EFAULT;
-            target_to_host_sigset(&set, p);
-            unlock_user(p, arg1, 0);
-            if (arg3) {
-                puts = &uts;
-                target_to_host_timespec(puts, arg3);
-            } else {
-                puts = NULL;
-            }
-            ret = get_errno(safe_rt_sigtimedwait(&set, &uinfo, puts,
-                                                 SIGSET_T_SIZE));
-            if (!is_error(ret)) {
-                if (arg2) {
-                    p = lock_user(VERIFY_WRITE, arg2, sizeof(target_siginfo_t),
-                                  0);
-                    if (!p) {
-                        return -TARGET_EFAULT;
-                    }
-                    host_to_target_siginfo(p, &uinfo);
-                    unlock_user(p, arg2, sizeof(target_siginfo_t));
-                }
-                ret = host_to_target_signal(ret);
-            }
-        }
-        return ret;
-    case TARGET_NR_rt_sigqueueinfo:
-        {
-            siginfo_t uinfo;
-
-            p = lock_user(VERIFY_READ, arg3, sizeof(target_siginfo_t), 1);
-            if (!p) {
-                return -TARGET_EFAULT;
-            }
-            target_to_host_siginfo(&uinfo, p);
-            unlock_user(p, arg3, 0);
-            ret = get_errno(sys_rt_sigqueueinfo(arg1, arg2, &uinfo));
-        }
-        return ret;
-    case TARGET_NR_rt_tgsigqueueinfo:
-        {
-            siginfo_t uinfo;
-
-            p = lock_user(VERIFY_READ, arg4, sizeof(target_siginfo_t), 1);
-            if (!p) {
-                return -TARGET_EFAULT;
-            }
-            target_to_host_siginfo(&uinfo, p);
-            unlock_user(p, arg4, 0);
-            ret = get_errno(sys_rt_tgsigqueueinfo(arg1, arg2, arg3, &uinfo));
-        }
-        return ret;
 #ifdef TARGET_NR_sigreturn
     case TARGET_NR_sigreturn:
         if (block_signals()) {
@@ -12775,7 +12777,10 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(rt_sigaction);
         SYSCALL(rt_sigpending);
         SYSCALL(rt_sigprocmask);
+        SYSCALL(rt_sigqueueinfo);
         SYSCALL(rt_sigsuspend);
+        SYSCALL(rt_sigtimedwait);
+        SYSCALL(rt_tgsigqueueinfo);
 #ifdef TARGET_NR_sgetmask
         SYSCALL(sgetmask);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 033/108] linux-user: Split out rt_sigreturn, sethostname, setrlimit, sigreturn
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (31 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 032/108] linux-user: Split out rt_sigqueueinfo, rt_sigtimedwait, rt_tgsigqueueinfo Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 034/108] linux-user: Split out getrlimit, getrusage, gettimeofday, settimeofday Richard Henderson
                   ` (78 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 85 +++++++++++++++++++++++++++-----------------
 1 file changed, 52 insertions(+), 33 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 94dc773b4c..ac3592d776 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8782,6 +8782,14 @@ IMPL(rt_sigqueueinfo)
     return get_errno(sys_rt_sigqueueinfo(arg1, arg2, &uinfo));
 }
 
+IMPL(rt_sigreturn)
+{
+    if (block_signals()) {
+        return -TARGET_ERESTARTSYS;
+    }
+    return do_rt_sigreturn(cpu_env);
+}
+
 IMPL(rt_sigsuspend)
 {
     CPUState *cpu = ENV_GET_CPU(cpu_env);
@@ -8869,11 +8877,39 @@ IMPL(sgetmask)
 }
 #endif
 
+IMPL(sethostname)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(sethostname(p, arg2));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+
 IMPL(setpgid)
 {
     return get_errno(setpgid(arg1, arg2));
 }
 
+IMPL(setrlimit)
+{
+    int resource = target_to_host_resource(arg1);
+    struct target_rlimit *target_rlim;
+    struct rlimit rlim;
+
+    if (!lock_user_struct(VERIFY_READ, target_rlim, arg2, 1)) {
+        return -TARGET_EFAULT;
+    }
+    rlim.rlim_cur = target_to_host_rlim(target_rlim->rlim_cur);
+    rlim.rlim_max = target_to_host_rlim(target_rlim->rlim_max);
+    unlock_user_struct(target_rlim, arg2, 0);
+    return get_errno(setrlimit(resource, &rlim));
+}
+
 IMPL(setsid)
 {
     return get_errno(setsid());
@@ -9055,6 +9091,16 @@ IMPL(sigprocmask)
 }
 #endif
 
+#ifdef TARGET_NR_sigreturn
+IMPL(sigreturn)
+{
+    if (block_signals()) {
+        return -TARGET_ERESTARTSYS;
+    }
+    return do_sigreturn(cpu_env);
+}
+#endif
+
 #ifdef TARGET_NR_sigsuspend
 IMPL(sigsuspend)
 {
@@ -9339,39 +9385,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_sigreturn
-    case TARGET_NR_sigreturn:
-        if (block_signals()) {
-            ret = -TARGET_ERESTARTSYS;
-        } else {
-            ret = do_sigreturn(cpu_env);
-        }
-        return ret;
-#endif
-    case TARGET_NR_rt_sigreturn:
-        if (block_signals()) {
-            return -TARGET_ERESTARTSYS;
-        } else {
-            return do_rt_sigreturn(cpu_env);
-        }
-    case TARGET_NR_sethostname:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(sethostname(p, arg2));
-        unlock_user(p, arg1, 0);
-        return ret;
-    case TARGET_NR_setrlimit:
-        {
-            int resource = target_to_host_resource(arg1);
-            struct target_rlimit *target_rlim;
-            struct rlimit rlim;
-            if (!lock_user_struct(VERIFY_READ, target_rlim, arg2, 1))
-                return -TARGET_EFAULT;
-            rlim.rlim_cur = target_to_host_rlim(target_rlim->rlim_cur);
-            rlim.rlim_max = target_to_host_rlim(target_rlim->rlim_max);
-            unlock_user_struct(target_rlim, arg2, 0);
-            return get_errno(setrlimit(resource, &rlim));
-        }
     case TARGET_NR_getrlimit:
         {
             int resource = target_to_host_resource(arg1);
@@ -12778,13 +12791,16 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(rt_sigpending);
         SYSCALL(rt_sigprocmask);
         SYSCALL(rt_sigqueueinfo);
+        SYSCALL(rt_sigreturn);
         SYSCALL(rt_sigsuspend);
         SYSCALL(rt_sigtimedwait);
         SYSCALL(rt_tgsigqueueinfo);
 #ifdef TARGET_NR_sgetmask
         SYSCALL(sgetmask);
 #endif
+        SYSCALL(sethostname);
         SYSCALL(setpgid);
+        SYSCALL(setrlimit);
         SYSCALL(setsid);
 #ifdef TARGET_NR_sigaction
         SYSCALL(sigaction);
@@ -12795,6 +12811,9 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_sigprocmask
         SYSCALL(sigprocmask);
 #endif
+#ifdef TARGET_NR_sigreturn
+        SYSCALL(sigreturn);
+#endif
 #ifdef TARGET_NR_sigsuspend
         SYSCALL(sigsuspend);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 034/108] linux-user: Split out getrlimit, getrusage, gettimeofday, settimeofday
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (32 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 033/108] linux-user: Split out rt_sigreturn, sethostname, setrlimit, sigreturn Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 035/108] linux-user: Split out select, pselect6, newselect Richard Henderson
                   ` (77 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 117 ++++++++++++++++++++++---------------------
 1 file changed, 61 insertions(+), 56 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index ac3592d776..4c5292efed 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8152,6 +8152,49 @@ IMPL(getppid)
 }
 #endif
 
+IMPL(getrlimit)
+{
+    int resource = target_to_host_resource(arg1);
+    struct target_rlimit *target_rlim;
+    struct rlimit rlim;
+    abi_long ret;
+
+    ret = get_errno(getrlimit(resource, &rlim));
+    if (!is_error(ret)) {
+        if (!lock_user_struct(VERIFY_WRITE, target_rlim, arg2, 0)) {
+            return -TARGET_EFAULT;
+        }
+        target_rlim->rlim_cur = host_to_target_rlim(rlim.rlim_cur);
+        target_rlim->rlim_max = host_to_target_rlim(rlim.rlim_max);
+        unlock_user_struct(target_rlim, arg2, 1);
+    }
+    return ret;
+}
+
+IMPL(getrusage)
+{
+    struct rusage rusage;
+    abi_long ret;
+
+    ret = get_errno(getrusage(arg1, &rusage));
+    if (!is_error(ret) && host_to_target_rusage(arg2, &rusage)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+
+IMPL(gettimeofday)
+{
+    struct timeval tv;
+    abi_long ret;
+
+    ret = get_errno(gettimeofday(&tv, NULL));
+    if (!is_error(ret) && copy_to_user_timeval(arg1, &tv)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+
 #if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
 IMPL(getxpid)
 {
@@ -8910,6 +8953,20 @@ IMPL(setrlimit)
     return get_errno(setrlimit(resource, &rlim));
 }
 
+IMPL(settimeofday)
+{
+    struct timeval tv;
+    struct timezone tz;
+
+    if (arg1 && copy_from_user_timeval(&tv, arg1)) {
+        return -TARGET_EFAULT;
+    }
+    if (arg2 && copy_from_user_timezone(&tz, arg2)) {
+        return -TARGET_EFAULT;
+    }
+    return get_errno(settimeofday(arg1 ? &tv : NULL, arg2 ? &tz : NULL));
+}
+
 IMPL(setsid)
 {
     return get_errno(setsid());
@@ -9385,62 +9442,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_getrlimit:
-        {
-            int resource = target_to_host_resource(arg1);
-            struct target_rlimit *target_rlim;
-            struct rlimit rlim;
-
-            ret = get_errno(getrlimit(resource, &rlim));
-            if (!is_error(ret)) {
-                if (!lock_user_struct(VERIFY_WRITE, target_rlim, arg2, 0))
-                    return -TARGET_EFAULT;
-                target_rlim->rlim_cur = host_to_target_rlim(rlim.rlim_cur);
-                target_rlim->rlim_max = host_to_target_rlim(rlim.rlim_max);
-                unlock_user_struct(target_rlim, arg2, 1);
-            }
-        }
-        return ret;
-    case TARGET_NR_getrusage:
-        {
-            struct rusage rusage;
-            ret = get_errno(getrusage(arg1, &rusage));
-            if (!is_error(ret)) {
-                ret = host_to_target_rusage(arg2, &rusage);
-            }
-        }
-        return ret;
-    case TARGET_NR_gettimeofday:
-        {
-            struct timeval tv;
-            ret = get_errno(gettimeofday(&tv, NULL));
-            if (!is_error(ret)) {
-                if (copy_to_user_timeval(arg1, &tv))
-                    return -TARGET_EFAULT;
-            }
-        }
-        return ret;
-    case TARGET_NR_settimeofday:
-        {
-            struct timeval tv, *ptv = NULL;
-            struct timezone tz, *ptz = NULL;
-
-            if (arg1) {
-                if (copy_from_user_timeval(&tv, arg1)) {
-                    return -TARGET_EFAULT;
-                }
-                ptv = &tv;
-            }
-
-            if (arg2) {
-                if (copy_from_user_timezone(&tz, arg2)) {
-                    return -TARGET_EFAULT;
-                }
-                ptz = &tz;
-            }
-
-            return get_errno(settimeofday(ptv, ptz));
-        }
 #if defined(TARGET_NR_select)
     case TARGET_NR_select:
 #if defined(TARGET_WANT_NI_OLD_SELECT)
@@ -12737,6 +12738,9 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_getppid
         SYSCALL(getppid);
 #endif
+        SYSCALL(getrlimit);
+        SYSCALL(getrusage);
+        SYSCALL(gettimeofday);
 #if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
         SYSCALL(getxpid);
 #endif
@@ -12801,6 +12805,7 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(sethostname);
         SYSCALL(setpgid);
         SYSCALL(setrlimit);
+        SYSCALL(settimeofday);
         SYSCALL(setsid);
 #ifdef TARGET_NR_sigaction
         SYSCALL(sigaction);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 035/108] linux-user: Split out select, pselect6, newselect
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (33 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 034/108] linux-user: Split out getrlimit, getrusage, gettimeofday, settimeofday Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 036/108] linux-user: Split out symlink, symlinkat Richard Henderson
                   ` (76 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define pselect6; remove the ifdef.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 251 ++++++++++++++++++++++---------------------
 1 file changed, 130 insertions(+), 121 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 4c5292efed..326323e377 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8483,6 +8483,13 @@ IMPL(name_to_handle_at)
 }
 #endif
 
+#ifdef TARGET_NR__newselect
+IMPL(_newselect)
+{
+    return do_select(arg1, arg2, arg3, arg4, arg5);
+}
+#endif
+
 #ifdef TARGET_NR_nice
 IMPL(nice)
 {
@@ -8584,6 +8591,107 @@ IMPL(pipe2)
                    target_to_host_bitmask(arg2, fcntl_flags_tbl), 1);
 }
 
+IMPL(pselect6)
+{
+    abi_long rfd_addr, wfd_addr, efd_addr, n, ts_addr;
+    fd_set rfds, wfds, efds;
+    fd_set *rfds_ptr, *wfds_ptr, *efds_ptr;
+    struct timespec ts, *ts_ptr = NULL;
+    target_sigset_t *target_sigset;
+    abi_long ret;
+
+    /*
+     * The 6th arg is actually two args smashed together,
+     * so we cannot use the C library.
+     */
+    sigset_t set;
+    struct {
+        sigset_t *set;
+        size_t size;
+    } sig, *sig_ptr = NULL;
+
+    n = arg1;
+    rfd_addr = arg2;
+    wfd_addr = arg3;
+    efd_addr = arg4;
+    ts_addr = arg5;
+
+    ret = copy_from_user_fdset_ptr(&rfds, &rfds_ptr, rfd_addr, n);
+    if (ret) {
+        return ret;
+    }
+    ret = copy_from_user_fdset_ptr(&wfds, &wfds_ptr, wfd_addr, n);
+    if (ret) {
+        return ret;
+    }
+    ret = copy_from_user_fdset_ptr(&efds, &efds_ptr, efd_addr, n);
+    if (ret) {
+        return ret;
+    }
+
+    /*
+     * This takes a timespec, and not a timeval, so we cannot
+     * use the do_select() helper ...
+     */
+    if (ts_addr) {
+        if (target_to_host_timespec(&ts, ts_addr)) {
+            return -TARGET_EFAULT;
+        }
+        ts_ptr = &ts;
+    }
+
+    /* Extract the two packed args for the sigset */
+    if (arg6) {
+        abi_ulong arg_sigset, arg_sigsize, *arg7;
+
+        sig_ptr = &sig;
+        sig.set = NULL;
+        sig.size = SIGSET_T_SIZE;
+
+        arg7 = lock_user(VERIFY_READ, arg6, sizeof(*arg7) * 2, 1);
+        if (!arg7) {
+            return -TARGET_EFAULT;
+        }
+        arg_sigset = tswapal(arg7[0]);
+        arg_sigsize = tswapal(arg7[1]);
+        unlock_user(arg7, arg6, 0);
+
+        if (arg_sigset) {
+            sig.set = &set;
+            if (arg_sigsize != sizeof(*target_sigset)) {
+                /* Like the kernel, we enforce correct size sigsets */
+                return -TARGET_EINVAL;
+            }
+            target_sigset = lock_user(VERIFY_READ, arg_sigset,
+                                      sizeof(*target_sigset), 1);
+            if (!target_sigset) {
+                return -TARGET_EFAULT;
+            }
+            target_to_host_sigset(&set, target_sigset);
+            unlock_user(target_sigset, arg_sigset, 0);
+        }
+    }
+
+    ret = get_errno(safe_pselect6(n, rfds_ptr, wfds_ptr, efds_ptr,
+                                  ts_ptr, sig_ptr));
+
+    if (!is_error(ret)) {
+        if (rfd_addr && copy_to_user_fdset(rfd_addr, &rfds, n)) {
+            return -TARGET_EFAULT;
+        }
+        if (wfd_addr && copy_to_user_fdset(wfd_addr, &wfds, n)) {
+            return -TARGET_EFAULT;
+        }
+        if (efd_addr && copy_to_user_fdset(efd_addr, &efds, n)) {
+            return -TARGET_EFAULT;
+        }
+        if (ts_addr && host_to_target_timespec(ts_addr, &ts)) {
+            return -TARGET_EFAULT;
+        }
+    }
+    return ret;
+}
+
 IMPL(read)
 {
     abi_long ret;
@@ -8920,6 +9028,17 @@ IMPL(sgetmask)
 }
 #endif
 
+#if defined(TARGET_NR_select) && !defined(TARGET_WANT_NI_OLD_SELECT)
+IMPL(select)
+{
+# ifdef TARGET_WANT_OLD_SYS_SELECT
+    return do_old_select(arg1);
+# else
+    return do_select(arg1, arg2, arg3, arg4, arg5);
+# endif
+}
+#endif
+
 IMPL(sethostname)
 {
     char *p = lock_user_string(arg1);
@@ -9442,123 +9561,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#if defined(TARGET_NR_select)
-    case TARGET_NR_select:
-#if defined(TARGET_WANT_NI_OLD_SELECT)
-        /* some architectures used to have old_select here
-         * but now ENOSYS it.
-         */
-        ret = -TARGET_ENOSYS;
-#elif defined(TARGET_WANT_OLD_SYS_SELECT)
-        ret = do_old_select(arg1);
-#else
-        ret = do_select(arg1, arg2, arg3, arg4, arg5);
-#endif
-        return ret;
-#endif
-#ifdef TARGET_NR_pselect6
-    case TARGET_NR_pselect6:
-        {
-            abi_long rfd_addr, wfd_addr, efd_addr, n, ts_addr;
-            fd_set rfds, wfds, efds;
-            fd_set *rfds_ptr, *wfds_ptr, *efds_ptr;
-            struct timespec ts, *ts_ptr;
-
-            /*
-             * The 6th arg is actually two args smashed together,
-             * so we cannot use the C library.
-             */
-            sigset_t set;
-            struct {
-                sigset_t *set;
-                size_t size;
-            } sig, *sig_ptr;
-
-            abi_ulong arg_sigset, arg_sigsize, *arg7;
-            target_sigset_t *target_sigset;
-
-            n = arg1;
-            rfd_addr = arg2;
-            wfd_addr = arg3;
-            efd_addr = arg4;
-            ts_addr = arg5;
-
-            ret = copy_from_user_fdset_ptr(&rfds, &rfds_ptr, rfd_addr, n);
-            if (ret) {
-                return ret;
-            }
-            ret = copy_from_user_fdset_ptr(&wfds, &wfds_ptr, wfd_addr, n);
-            if (ret) {
-                return ret;
-            }
-            ret = copy_from_user_fdset_ptr(&efds, &efds_ptr, efd_addr, n);
-            if (ret) {
-                return ret;
-            }
-
-            /*
-             * This takes a timespec, and not a timeval, so we cannot
-             * use the do_select() helper ...
-             */
-            if (ts_addr) {
-                if (target_to_host_timespec(&ts, ts_addr)) {
-                    return -TARGET_EFAULT;
-                }
-                ts_ptr = &ts;
-            } else {
-                ts_ptr = NULL;
-            }
-
-            /* Extract the two packed args for the sigset */
-            if (arg6) {
-                sig_ptr = &sig;
-                sig.size = SIGSET_T_SIZE;
-
-                arg7 = lock_user(VERIFY_READ, arg6, sizeof(*arg7) * 2, 1);
-                if (!arg7) {
-                    return -TARGET_EFAULT;
-                }
-                arg_sigset = tswapal(arg7[0]);
-                arg_sigsize = tswapal(arg7[1]);
-                unlock_user(arg7, arg6, 0);
-
-                if (arg_sigset) {
-                    sig.set = &set;
-                    if (arg_sigsize != sizeof(*target_sigset)) {
-                        /* Like the kernel, we enforce correct size sigsets */
-                        return -TARGET_EINVAL;
-                    }
-                    target_sigset = lock_user(VERIFY_READ, arg_sigset,
-                                              sizeof(*target_sigset), 1);
-                    if (!target_sigset) {
-                        return -TARGET_EFAULT;
-                    }
-                    target_to_host_sigset(&set, target_sigset);
-                    unlock_user(target_sigset, arg_sigset, 0);
-                } else {
-                    sig.set = NULL;
-                }
-            } else {
-                sig_ptr = NULL;
-            }
-
-            ret = get_errno(safe_pselect6(n, rfds_ptr, wfds_ptr, efds_ptr,
-                                          ts_ptr, sig_ptr));
-
-            if (!is_error(ret)) {
-                if (rfd_addr && copy_to_user_fdset(rfd_addr, &rfds, n))
-                    return -TARGET_EFAULT;
-                if (wfd_addr && copy_to_user_fdset(wfd_addr, &wfds, n))
-                    return -TARGET_EFAULT;
-                if (efd_addr && copy_to_user_fdset(efd_addr, &efds, n))
-                    return -TARGET_EFAULT;
-
-                if (ts_addr && host_to_target_timespec(ts_addr, &ts))
-                    return -TARGET_EFAULT;
-            }
-        }
-        return ret;
-#endif
 #ifdef TARGET_NR_symlink
     case TARGET_NR_symlink:
         {
@@ -10459,10 +10461,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
         }
         return ret;
 #endif /* TARGET_NR_getdents64 */
-#if defined(TARGET_NR__newselect)
-    case TARGET_NR__newselect:
-        return do_select(arg1, arg2, arg3, arg4, arg5);
-#endif
 #if defined(TARGET_NR_poll) || defined(TARGET_NR_ppoll)
 # ifdef TARGET_NR_poll
     case TARGET_NR_poll:
@@ -12763,6 +12761,9 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef CONFIG_OPEN_BY_HANDLE
         SYSCALL(name_to_handle_at);
 #endif
+#ifdef TARGET_NR__newselect
+        SYSCALL(_newselect);
+#endif
 #ifdef TARGET_NR_nice
         SYSCALL(nice);
 #endif
@@ -12780,6 +12781,7 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(pipe);
 #endif
         SYSCALL(pipe2);
+        SYSCALL(pselect6);
         SYSCALL(read);
 #ifdef TARGET_NR_rename
         SYSCALL(rename);
@@ -12801,6 +12803,13 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(rt_tgsigqueueinfo);
 #ifdef TARGET_NR_sgetmask
         SYSCALL(sgetmask);
+#endif
+#ifdef TARGET_NR_select
+# ifdef TARGET_WANT_NI_OLD_SELECT
+        SYSCALL_WITH(select, enosys);
+# else
+        SYSCALL(select);
+# endif
 #endif
         SYSCALL(sethostname);
         SYSCALL(setpgid);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 036/108] linux-user: Split out symlink, symlinkat
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (34 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 035/108] linux-user: Split out select, pselect6, newselect Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 037/108] linux-user: Split out readlink, readlinkat Richard Henderson
                   ` (75 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define symlinkat; remove the ifdef.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 64 +++++++++++++++++++++++---------------------
 1 file changed, 34 insertions(+), 30 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 326323e377..39d8a70d7d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9331,6 +9331,36 @@ IMPL(stime)
 }
 #endif
 
+#ifdef TARGET_NR_symlink
+IMPL(symlink)
+{
+    char *p1 = lock_user_string(arg1);
+    char *p2 = lock_user_string(arg2);
+    abi_long ret = -TARGET_EFAULT;
+
+    if (p1 && p2) {
+        ret = get_errno(symlink(p1, p2));
+    }
+    unlock_user(p2, arg2, 0);
+    unlock_user(p1, arg1, 0);
+    return ret;
+}
+#endif
+
+IMPL(symlinkat)
+{
+    char *p1 = lock_user_string(arg1);
+    char *p2 = lock_user_string(arg3);
+    abi_long ret = -TARGET_EFAULT;
+
+    if (p1 && p2) {
+        ret = get_errno(symlinkat(p1, arg2, p2));
+    }
+    unlock_user(p2, arg3, 0);
+    unlock_user(p1, arg1, 0);
+    return ret;
+}
+
 IMPL(sync)
 {
     sync();
@@ -9561,36 +9591,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_symlink
-    case TARGET_NR_symlink:
-        {
-            void *p2;
-            p = lock_user_string(arg1);
-            p2 = lock_user_string(arg2);
-            if (!p || !p2)
-                ret = -TARGET_EFAULT;
-            else
-                ret = get_errno(symlink(p, p2));
-            unlock_user(p2, arg2, 0);
-            unlock_user(p, arg1, 0);
-        }
-        return ret;
-#endif
-#if defined(TARGET_NR_symlinkat)
-    case TARGET_NR_symlinkat:
-        {
-            void *p2;
-            p  = lock_user_string(arg1);
-            p2 = lock_user_string(arg3);
-            if (!p || !p2)
-                ret = -TARGET_EFAULT;
-            else
-                ret = get_errno(symlinkat(p, arg2, p2));
-            unlock_user(p2, arg3, 0);
-            unlock_user(p, arg1, 0);
-        }
-        return ret;
-#endif
 #ifdef TARGET_NR_readlink
     case TARGET_NR_readlink:
         {
@@ -12837,6 +12837,10 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_stime
         SYSCALL(stime);
 #endif
+#ifdef TARGET_NR_symlink
+        SYSCALL(symlink);
+#endif
+        SYSCALL(symlinkat);
         SYSCALL(sync);
 #ifdef CONFIG_SYNCFS
         SYSCALL(syncfs);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 037/108] linux-user: Split out readlink, readlinkat
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (35 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 036/108] linux-user: Split out symlink, symlinkat Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 038/108] linux-user: Split out mmap, mmap2, reboot, swapon Richard Henderson
                   ` (74 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define readlinkat; remove the ifdef.
Unify the two with do_readlinkat so that we do not
replicate the /proc/self/exe handling.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 96 ++++++++++++++++++++------------------------
 1 file changed, 43 insertions(+), 53 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 39d8a70d7d..f1123479df 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8712,6 +8712,45 @@ IMPL(read)
     return ret;
 }
 
+static abi_long do_readlinkat(abi_long dirfd, abi_long target_path,
+                              abi_long target_buf, abi_long bufsize)
+{
+    char *host_path, *host_buf;
+    abi_long ret;
+
+    host_path = lock_user_string(target_path);
+    host_buf = lock_user(VERIFY_WRITE, target_buf, bufsize, 0);
+    if (!host_path || !host_buf) {
+        ret = -TARGET_EFAULT;
+    } else if (is_proc_myself(host_path, "exe")) {
+        char real[PATH_MAX], *temp;
+        temp = realpath(exec_path, real);
+        if (temp == NULL) {
+            ret = get_errno(-1);
+        } else {
+            ret = MIN(strlen(real), bufsize);
+            memcpy(host_buf, real, ret);
+        }
+    } else {
+        ret = get_errno(readlinkat(dirfd, path(host_path), host_buf, bufsize));
+    }
+    unlock_user(host_buf, target_buf, ret);
+    unlock_user(host_path, target_path, 0);
+    return ret;
+}
+
+#ifdef TARGET_NR_readlink
+IMPL(readlink)
+{
+    return do_readlinkat(AT_FDCWD, arg1, arg2, arg3);
+}
+#endif
+
+IMPL(readlinkat)
+{
+    return do_readlinkat(arg1, arg2, arg3, arg4);
+}
+
 #ifdef TARGET_NR_rename
 IMPL(rename)
 {
@@ -9591,59 +9630,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_readlink
-    case TARGET_NR_readlink:
-        {
-            void *p2;
-            p = lock_user_string(arg1);
-            p2 = lock_user(VERIFY_WRITE, arg2, arg3, 0);
-            if (!p || !p2) {
-                ret = -TARGET_EFAULT;
-            } else if (!arg3) {
-                /* Short circuit this for the magic exe check. */
-                ret = -TARGET_EINVAL;
-            } else if (is_proc_myself((const char *)p, "exe")) {
-                char real[PATH_MAX], *temp;
-                temp = realpath(exec_path, real);
-                /* Return value is # of bytes that we wrote to the buffer. */
-                if (temp == NULL) {
-                    ret = get_errno(-1);
-                } else {
-                    /* Don't worry about sign mismatch as earlier mapping
-                     * logic would have thrown a bad address error. */
-                    ret = MIN(strlen(real), arg3);
-                    /* We cannot NUL terminate the string. */
-                    memcpy(p2, real, ret);
-                }
-            } else {
-                ret = get_errno(readlink(path(p), p2, arg3));
-            }
-            unlock_user(p2, arg2, ret);
-            unlock_user(p, arg1, 0);
-        }
-        return ret;
-#endif
-#if defined(TARGET_NR_readlinkat)
-    case TARGET_NR_readlinkat:
-        {
-            void *p2;
-            p  = lock_user_string(arg2);
-            p2 = lock_user(VERIFY_WRITE, arg3, arg4, 0);
-            if (!p || !p2) {
-                ret = -TARGET_EFAULT;
-            } else if (is_proc_myself((const char *)p, "exe")) {
-                char real[PATH_MAX], *temp;
-                temp = realpath(exec_path, real);
-                ret = temp == NULL ? get_errno(-1) : strlen(real) ;
-                snprintf((char *)p2, arg4, "%s", real);
-            } else {
-                ret = get_errno(readlinkat(arg1, path(p), p2, arg4));
-            }
-            unlock_user(p2, arg3, ret);
-            unlock_user(p, arg2, 0);
-        }
-        return ret;
-#endif
 #ifdef TARGET_NR_swapon
     case TARGET_NR_swapon:
         if (!(p = lock_user_string(arg1)))
@@ -12783,6 +12769,10 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(pipe2);
         SYSCALL(pselect6);
         SYSCALL(read);
+#ifdef TARGET_NR_readlink
+        SYSCALL(readlink);
+#endif
+        SYSCALL(readlinkat);
 #ifdef TARGET_NR_rename
         SYSCALL(rename);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 038/108] linux-user: Split out mmap, mmap2, reboot, swapon
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (36 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 037/108] linux-user: Split out readlink, readlinkat Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 039/108] linux-user: Split out mprotect, mremap, msync, munmap Richard Henderson
                   ` (73 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define swapon; remove the ifdef.
Add a comment noting the incorrect implementation of mmap2.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 142 ++++++++++++++++++++++++-------------------
 1 file changed, 81 insertions(+), 61 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index f1123479df..a3374955da 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8392,6 +8392,49 @@ IMPL(mknodat)
     return ret;
 }
 
+#ifdef TARGET_NR_mmap
+IMPL(mmap)
+{
+# if (defined(TARGET_I386) && defined(TARGET_ABI32)) \
+  || (defined(TARGET_ARM) && defined(TARGET_ABI32)) \
+  || defined(TARGET_M68K) || defined(TARGET_CRIS) \
+  || defined(TARGET_MICROBLAZE) || defined(TARGET_S390X)
+    abi_ulong orig_arg1 = arg1;
+    abi_ulong *v = lock_user(VERIFY_READ, arg1, 6 * sizeof(abi_ulong), 1);
+
+    if (!v) {
+        return -TARGET_EFAULT;
+    }
+    arg1 = tswapal(v[0]);
+    arg2 = tswapal(v[1]);
+    arg3 = tswapal(v[2]);
+    arg4 = tswapal(v[3]);
+    arg5 = tswapal(v[4]);
+    arg6 = tswapal(v[5]);
+    unlock_user(v, orig_arg1, 0);
+# endif
+    return get_errno(target_mmap(arg1, arg2, arg3,
+                                 target_to_host_bitmask(arg4, mmap_flags_tbl),
+                                 arg5, arg6));
+}
+#endif
+
+#ifdef TARGET_NR_mmap2
+IMPL(mmap2)
+{
+#ifndef MMAP_SHIFT
+#define MMAP_SHIFT 12
+#endif
+    /* ??? The argument to target_mmap is abi_ulong.  Therefore this
+     * truncates the true offset for ABI32, which are the only users
+     * (and only point) of this syscall.
+     */
+    return get_errno(target_mmap(arg1, arg2, arg3,
+                                 target_to_host_bitmask(arg4, mmap_flags_tbl),
+                                 arg5, arg6 << MMAP_SHIFT));
+}
+#endif
+
 IMPL(mount)
 {
     char *p1 = NULL, *p2, *p3 = NULL;
@@ -8751,6 +8794,23 @@ IMPL(readlinkat)
     return do_readlinkat(arg1, arg2, arg3, arg4);
 }
 
+IMPL(reboot)
+{
+    abi_long ret;
+    if (arg3 == LINUX_REBOOT_CMD_RESTART2) {
+        /* arg4 must be ignored in all other cases */
+        char *p = lock_user_string(arg4);
+        if (!p) {
+            return -TARGET_EFAULT;
+        }
+        ret = get_errno(reboot(arg1, arg2, arg3, p));
+        unlock_user(p, arg4, 0);
+    } else {
+        ret = get_errno(reboot(arg1, arg2, arg3, NULL));
+    }
+    return ret;
+}
+
 #ifdef TARGET_NR_rename
 IMPL(rename)
 {
@@ -9370,6 +9430,19 @@ IMPL(stime)
 }
 #endif
 
+IMPL(swapon)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(swapon(p, arg2));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+
 #ifdef TARGET_NR_symlink
 IMPL(symlink)
 {
@@ -9630,67 +9703,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_swapon
-    case TARGET_NR_swapon:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(swapon(p, arg2));
-        unlock_user(p, arg1, 0);
-        return ret;
-#endif
-    case TARGET_NR_reboot:
-        if (arg3 == LINUX_REBOOT_CMD_RESTART2) {
-           /* arg4 must be ignored in all other cases */
-           p = lock_user_string(arg4);
-           if (!p) {
-               return -TARGET_EFAULT;
-           }
-           ret = get_errno(reboot(arg1, arg2, arg3, p));
-           unlock_user(p, arg4, 0);
-        } else {
-           ret = get_errno(reboot(arg1, arg2, arg3, NULL));
-        }
-        return ret;
-#ifdef TARGET_NR_mmap
-    case TARGET_NR_mmap:
-#if (defined(TARGET_I386) && defined(TARGET_ABI32)) || \
-    (defined(TARGET_ARM) && defined(TARGET_ABI32)) || \
-    defined(TARGET_M68K) || defined(TARGET_CRIS) || defined(TARGET_MICROBLAZE) \
-    || defined(TARGET_S390X)
-        {
-            abi_ulong *v;
-            abi_ulong v1, v2, v3, v4, v5, v6;
-            if (!(v = lock_user(VERIFY_READ, arg1, 6 * sizeof(abi_ulong), 1)))
-                return -TARGET_EFAULT;
-            v1 = tswapal(v[0]);
-            v2 = tswapal(v[1]);
-            v3 = tswapal(v[2]);
-            v4 = tswapal(v[3]);
-            v5 = tswapal(v[4]);
-            v6 = tswapal(v[5]);
-            unlock_user(v, arg1, 0);
-            ret = get_errno(target_mmap(v1, v2, v3,
-                                        target_to_host_bitmask(v4, mmap_flags_tbl),
-                                        v5, v6));
-        }
-#else
-        ret = get_errno(target_mmap(arg1, arg2, arg3,
-                                    target_to_host_bitmask(arg4, mmap_flags_tbl),
-                                    arg5,
-                                    arg6));
-#endif
-        return ret;
-#endif
-#ifdef TARGET_NR_mmap2
-    case TARGET_NR_mmap2:
-#ifndef MMAP_SHIFT
-#define MMAP_SHIFT 12
-#endif
-        ret = target_mmap(arg1, arg2, arg3,
-                          target_to_host_bitmask(arg4, mmap_flags_tbl),
-                          arg5, arg6 << MMAP_SHIFT);
-        return get_errno(ret);
-#endif
     case TARGET_NR_munmap:
         return get_errno(target_munmap(arg1, arg2));
     case TARGET_NR_mprotect:
@@ -12743,6 +12755,12 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(mknod);
 #endif
         SYSCALL(mknodat);
+#ifdef TARGET_NR_mmap
+        SYSCALL(mmap);
+#endif
+#ifdef TARGET_NR_mmap2
+        SYSCALL(mmap2);
+#endif
         SYSCALL(mount);
 #ifdef CONFIG_OPEN_BY_HANDLE
         SYSCALL(name_to_handle_at);
@@ -12773,6 +12791,7 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(readlink);
 #endif
         SYSCALL(readlinkat);
+        SYSCALL(reboot);
 #ifdef TARGET_NR_rename
         SYSCALL(rename);
 #endif
@@ -12827,6 +12846,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_stime
         SYSCALL(stime);
 #endif
+        SYSCALL(swapon);
 #ifdef TARGET_NR_symlink
         SYSCALL(symlink);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 039/108] linux-user: Split out mprotect, mremap, msync, munmap
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (37 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 038/108] linux-user: Split out mmap, mmap2, reboot, swapon Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 040/108] linux-user: Split out mlock, mlockall, munlock, munlockall Richard Henderson
                   ` (72 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define all of these; remove the ifdefs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 61 ++++++++++++++++++++++++++------------------
 1 file changed, 36 insertions(+), 25 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index a3374955da..7504ad74b5 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8471,6 +8471,37 @@ IMPL(mount)
     return ret;
 }
 
+IMPL(mprotect)
+{
+    /* Special hack to detect libc making the stack executable.  */
+    if (arg3 & PROT_GROWSDOWN) {
+        CPUState *cpu = ENV_GET_CPU(cpu_env);
+        TaskState *ts = cpu->opaque;
+
+        if (arg1 >= ts->info->stack_limit && arg1 <= ts->info->start_stack) {
+            arg3 &= ~PROT_GROWSDOWN;
+            arg2 = arg2 + arg1 - ts->info->stack_limit;
+            arg1 = ts->info->stack_limit;
+        }
+    }
+    return get_errno(target_mprotect(arg1, arg2, arg3));
+}
+
+IMPL(mremap)
+{
+    return get_errno(target_mremap(arg1, arg2, arg3, arg4, arg5));
+}
+
+IMPL(msync)
+{
+    return get_errno(msync(g2h(arg1), arg2, arg3));
+}
+
+IMPL(munmap)
+{
+    return get_errno(target_munmap(arg1, arg2));
+}
+
 #ifdef CONFIG_OPEN_BY_HANDLE
 IMPL(name_to_handle_at)
 {
@@ -9696,37 +9727,13 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
                             abi_long arg5, abi_long arg6, abi_long arg7,
                             abi_long arg8)
 {
-    CPUState *cpu = ENV_GET_CPU(cpu_env);
+    CPUState *cpu __attribute__((unused)) = ENV_GET_CPU(cpu_env);
     abi_long ret;
     struct stat st;
     struct statfs stfs;
     void *p;
 
     switch(num) {
-    case TARGET_NR_munmap:
-        return get_errno(target_munmap(arg1, arg2));
-    case TARGET_NR_mprotect:
-        {
-            TaskState *ts = cpu->opaque;
-            /* Special hack to detect libc making the stack executable.  */
-            if ((arg3 & PROT_GROWSDOWN)
-                && arg1 >= ts->info->stack_limit
-                && arg1 <= ts->info->start_stack) {
-                arg3 &= ~PROT_GROWSDOWN;
-                arg2 = arg2 + arg1 - ts->info->stack_limit;
-                arg1 = ts->info->stack_limit;
-            }
-        }
-        return get_errno(target_mprotect(arg1, arg2, arg3));
-#ifdef TARGET_NR_mremap
-    case TARGET_NR_mremap:
-        return get_errno(target_mremap(arg1, arg2, arg3, arg4, arg5));
-#endif
-        /* ??? msync/mlock/munlock are broken for softmmu.  */
-#ifdef TARGET_NR_msync
-    case TARGET_NR_msync:
-        return get_errno(msync(g2h(arg1), arg2, arg3));
-#endif
 #ifdef TARGET_NR_mlock
     case TARGET_NR_mlock:
         return get_errno(mlock(g2h(arg1), arg2));
@@ -12762,6 +12769,10 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(mmap2);
 #endif
         SYSCALL(mount);
+        SYSCALL(mprotect);
+        SYSCALL(mremap);
+        SYSCALL(msync);
+        SYSCALL(munmap);
 #ifdef CONFIG_OPEN_BY_HANDLE
         SYSCALL(name_to_handle_at);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 040/108] linux-user: Split out mlock, mlockall, munlock, munlockall
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (38 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 039/108] linux-user: Split out mprotect, mremap, msync, munmap Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 041/108] linux-user: Split out fchmod, fchmodat, ftruncate, truncate Richard Henderson
                   ` (71 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define all of these; remove the ifdefs.
Merge target_to_host_mlockall_arg into its only caller.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 62 ++++++++++++++++++++++----------------------
 1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 7504ad74b5..f79aebe869 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7144,21 +7144,6 @@ static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
     return 0;
 }
 
-#if defined(TARGET_NR_mlockall)
-static inline int target_to_host_mlockall_arg(int arg)
-{
-    int result = 0;
-
-    if (arg & TARGET_MLOCKALL_MCL_CURRENT) {
-        result |= MCL_CURRENT;
-    }
-    if (arg & TARGET_MLOCKALL_MCL_FUTURE) {
-        result |= MCL_FUTURE;
-    }
-    return result;
-}
-#endif
-
 static inline abi_long host_to_target_stat64(void *cpu_env,
                                              abi_ulong target_addr,
                                              struct stat *host_st)
@@ -8392,6 +8377,23 @@ IMPL(mknodat)
     return ret;
 }
 
+IMPL(mlock)
+{
+    return get_errno(mlock(g2h(arg1), arg2));
+}
+
+IMPL(mlockall)
+{
+    int host_flags = 0;
+    if (arg1 & TARGET_MLOCKALL_MCL_CURRENT) {
+        host_flags |= MCL_CURRENT;
+    }
+    if (arg1 & TARGET_MLOCKALL_MCL_FUTURE) {
+        host_flags |= MCL_FUTURE;
+    }
+    return get_errno(mlockall(host_flags));
+}
+
 #ifdef TARGET_NR_mmap
 IMPL(mmap)
 {
@@ -8497,6 +8499,16 @@ IMPL(msync)
     return get_errno(msync(g2h(arg1), arg2, arg3));
 }
 
+IMPL(munlock)
+{
+    return get_errno(munlock(g2h(arg1), arg2));
+}
+
+IMPL(munlockall)
+{
+    return get_errno(munlockall());
+}
+
 IMPL(munmap)
 {
     return get_errno(target_munmap(arg1, arg2));
@@ -9734,22 +9746,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_mlock
-    case TARGET_NR_mlock:
-        return get_errno(mlock(g2h(arg1), arg2));
-#endif
-#ifdef TARGET_NR_munlock
-    case TARGET_NR_munlock:
-        return get_errno(munlock(g2h(arg1), arg2));
-#endif
-#ifdef TARGET_NR_mlockall
-    case TARGET_NR_mlockall:
-        return get_errno(mlockall(target_to_host_mlockall_arg(arg1)));
-#endif
-#ifdef TARGET_NR_munlockall
-    case TARGET_NR_munlockall:
-        return get_errno(munlockall());
-#endif
     case TARGET_NR_truncate:
         if (!(p = lock_user_string(arg1)))
             return -TARGET_EFAULT;
@@ -12762,6 +12758,8 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(mknod);
 #endif
         SYSCALL(mknodat);
+        SYSCALL(mlock);
+        SYSCALL(mlockall);
 #ifdef TARGET_NR_mmap
         SYSCALL(mmap);
 #endif
@@ -12772,6 +12770,8 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(mprotect);
         SYSCALL(mremap);
         SYSCALL(msync);
+        SYSCALL(munlock);
+        SYSCALL(munlockall);
         SYSCALL(munmap);
 #ifdef CONFIG_OPEN_BY_HANDLE
         SYSCALL(name_to_handle_at);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 041/108] linux-user: Split out fchmod, fchmodat, ftruncate, truncate
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (39 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 040/108] linux-user: Split out mlock, mlockall, munlock, munlockall Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 042/108] linux-user: Split out fstatfs, fstatfs64, statfs, statfs64 Richard Henderson
                   ` (70 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define fchmodat; remove the ifdef.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 58 ++++++++++++++++++++++++++++++--------------
 1 file changed, 40 insertions(+), 18 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index f79aebe869..df8422cd3a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8079,6 +8079,24 @@ IMPL(faccessat)
     return ret;
 }
 
+IMPL(fchmod)
+{
+    return get_errno(fchmod(arg1, arg2));
+}
+
+IMPL(fchmodat)
+{
+    char *p = lock_user_string(arg2);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(fchmodat(arg1, p, arg3, 0));
+    unlock_user(p, arg2, 0);
+    return ret;
+}
+
 #ifdef TARGET_NR_fcntl
 IMPL(fcntl)
 {
@@ -8093,6 +8111,11 @@ IMPL(fork)
 }
 #endif
 
+IMPL(ftruncate)
+{
+    return get_errno(ftruncate(arg1, arg2));
+}
+
 #ifdef TARGET_NR_futimesat
 IMPL(futimesat)
 {
@@ -9563,6 +9586,19 @@ IMPL(times)
     return host_to_target_clock_t(ret);
 }
 
+IMPL(truncate)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(truncate(p, arg2));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+
 IMPL(umask)
 {
     return get_errno(umask(arg1));
@@ -9746,24 +9782,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_truncate:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(truncate(p, arg2));
-        unlock_user(p, arg1, 0);
-        return ret;
-    case TARGET_NR_ftruncate:
-        return get_errno(ftruncate(arg1, arg2));
-    case TARGET_NR_fchmod:
-        return get_errno(fchmod(arg1, arg2));
-#if defined(TARGET_NR_fchmodat)
-    case TARGET_NR_fchmodat:
-        if (!(p = lock_user_string(arg2)))
-            return -TARGET_EFAULT;
-        ret = get_errno(fchmodat(arg1, p, arg3, 0));
-        unlock_user(p, arg2, 0);
-        return ret;
-#endif
     case TARGET_NR_getpriority:
         /* Note that negative values are valid for getpriority, so we must
            differentiate based on errno settings.  */
@@ -12719,12 +12737,15 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(execve);
         SYSCALL(exit);
         SYSCALL(faccessat);
+        SYSCALL(fchmod);
+        SYSCALL(fchmodat);
 #ifdef TARGET_NR_fcntl
         SYSCALL(fcntl);
 #endif
 #ifdef TARGET_NR_fork
         SYSCALL(fork);
 #endif
+        SYSCALL(ftruncate);
 #ifdef TARGET_NR_futimesat
         SYSCALL(futimesat);
 #endif
@@ -12870,6 +12891,7 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(time);
 #endif
         SYSCALL(times);
+        SYSCALL(truncate);
         SYSCALL(umask);
 #ifdef TARGET_NR_umount
         SYSCALL(umount);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 042/108] linux-user: Split out fstatfs, fstatfs64, statfs, statfs64
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (40 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 041/108] linux-user: Split out fchmod, fchmodat, ftruncate, truncate Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 043/108] linux-user: Split out getpriority, setpriority Richard Henderson
                   ` (69 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 193 ++++++++++++++++++++++++++++---------------
 1 file changed, 125 insertions(+), 68 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index df8422cd3a..86583988c4 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7207,6 +7207,61 @@ static inline abi_long host_to_target_stat64(void *cpu_env,
     return 0;
 }
 
+static abi_long host_to_target_statfs(abi_ulong target_addr,
+                                      struct statfs *stfs)
+{
+    struct target_statfs *target_stfs;
+
+    if (!lock_user_struct(VERIFY_WRITE, target_stfs, target_addr, 0)) {
+        return -TARGET_EFAULT;
+    }
+    __put_user(stfs->f_type, &target_stfs->f_type);
+    __put_user(stfs->f_bsize, &target_stfs->f_bsize);
+    __put_user(stfs->f_blocks, &target_stfs->f_blocks);
+    __put_user(stfs->f_bfree, &target_stfs->f_bfree);
+    __put_user(stfs->f_bavail, &target_stfs->f_bavail);
+    __put_user(stfs->f_files, &target_stfs->f_files);
+    __put_user(stfs->f_ffree, &target_stfs->f_ffree);
+    __put_user(stfs->f_fsid.__val[0], &target_stfs->f_fsid.val[0]);
+    __put_user(stfs->f_fsid.__val[1], &target_stfs->f_fsid.val[1]);
+    __put_user(stfs->f_namelen, &target_stfs->f_namelen);
+    __put_user(stfs->f_frsize, &target_stfs->f_frsize);
+#ifdef _STATFS_F_FLAGS
+    __put_user(stfs->f_flags, &target_stfs->f_flags);
+#else
+    __put_user(0, &target_stfs->f_flags);
+#endif
+    memset(target_stfs->f_spare, 0, sizeof(target_stfs->f_spare));
+    unlock_user_struct(target_stfs, target_addr, 1);
+    return 0;
+}
+
+#ifdef TARGET_NR_statfs64
+static abi_long host_to_target_statfs64(abi_ulong target_addr,
+                                        struct statfs *stfs)
+{
+    struct target_statfs64 *target_stfs;
+
+    if (!lock_user_struct(VERIFY_WRITE, target_stfs, target_addr, 0)) {
+        return -TARGET_EFAULT;
+    }
+    __put_user(stfs->f_type, &target_stfs->f_type);
+    __put_user(stfs->f_bsize, &target_stfs->f_bsize);
+    __put_user(stfs->f_blocks, &target_stfs->f_blocks);
+    __put_user(stfs->f_bfree, &target_stfs->f_bfree);
+    __put_user(stfs->f_bavail, &target_stfs->f_bavail);
+    __put_user(stfs->f_files, &target_stfs->f_files);
+    __put_user(stfs->f_ffree, &target_stfs->f_ffree);
+    __put_user(stfs->f_fsid.__val[0], &target_stfs->f_fsid.val[0]);
+    __put_user(stfs->f_fsid.__val[1], &target_stfs->f_fsid.val[1]);
+    __put_user(stfs->f_namelen, &target_stfs->f_namelen);
+    __put_user(stfs->f_frsize, &target_stfs->f_frsize);
+    memset(target_stfs->f_spare, 0, sizeof(target_stfs->f_spare));
+    unlock_user_struct(target_stfs, target_addr, 1);
+    return 0;
+}
+#endif
+
 /* ??? Using host futex calls even when target atomic operations
    are not really atomic probably breaks things.  However implementing
    futexes locally would make futexes shared between multiple processes
@@ -8111,6 +8166,32 @@ IMPL(fork)
 }
 #endif
 
+IMPL(fstatfs)
+{
+    struct statfs stfs;
+    abi_long ret;
+
+    ret = get_errno(fstatfs(arg1, &stfs));
+    if (!is_error(ret) && host_to_target_statfs(arg2, &stfs)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+
+#ifdef TARGET_NR_fstatfs64
+IMPL(fstatfs64)
+{
+    struct statfs stfs;
+    abi_long ret;
+
+    ret = get_errno(fstatfs(arg1, &stfs));
+    if (!is_error(ret) && host_to_target_statfs64(arg3, &stfs)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+#endif
+
 IMPL(ftruncate)
 {
     return get_errno(ftruncate(arg1, arg2));
@@ -9485,6 +9566,42 @@ IMPL(ssetmask)
 }
 #endif
 
+IMPL(statfs)
+{
+    char *p = lock_user_string(arg1);
+    struct statfs stfs;
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(statfs(path(p), &stfs));
+    unlock_user(p, arg1, 0);
+    if (!is_error(ret) && host_to_target_statfs(arg2, &stfs)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+
+#ifdef TARGET_NR_statfs64
+IMPL(statfs64)
+{
+    char *p = lock_user_string(arg1);
+    struct statfs stfs;
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(statfs(path(p), &stfs));
+    unlock_user(p, arg1, 0);
+    if (!is_error(ret) && host_to_target_statfs64(arg3, &stfs)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_stime
 IMPL(stime)
 {
@@ -9778,7 +9895,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     CPUState *cpu __attribute__((unused)) = ENV_GET_CPU(cpu_env);
     abi_long ret;
     struct stat st;
-    struct statfs stfs;
     void *p;
 
     switch(num) {
@@ -9800,73 +9916,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
         return ret;
     case TARGET_NR_setpriority:
         return get_errno(setpriority(arg1, arg2, arg3));
-    case TARGET_NR_statfs:
-        if (!(p = lock_user_string(arg1))) {
-            return -TARGET_EFAULT;
-        }
-        ret = get_errno(statfs(path(p), &stfs));
-        unlock_user(p, arg1, 0);
-    convert_statfs:
-        if (!is_error(ret)) {
-            struct target_statfs *target_stfs;
-
-            if (!lock_user_struct(VERIFY_WRITE, target_stfs, arg2, 0))
-                return -TARGET_EFAULT;
-            __put_user(stfs.f_type, &target_stfs->f_type);
-            __put_user(stfs.f_bsize, &target_stfs->f_bsize);
-            __put_user(stfs.f_blocks, &target_stfs->f_blocks);
-            __put_user(stfs.f_bfree, &target_stfs->f_bfree);
-            __put_user(stfs.f_bavail, &target_stfs->f_bavail);
-            __put_user(stfs.f_files, &target_stfs->f_files);
-            __put_user(stfs.f_ffree, &target_stfs->f_ffree);
-            __put_user(stfs.f_fsid.__val[0], &target_stfs->f_fsid.val[0]);
-            __put_user(stfs.f_fsid.__val[1], &target_stfs->f_fsid.val[1]);
-            __put_user(stfs.f_namelen, &target_stfs->f_namelen);
-            __put_user(stfs.f_frsize, &target_stfs->f_frsize);
-#ifdef _STATFS_F_FLAGS
-            __put_user(stfs.f_flags, &target_stfs->f_flags);
-#else
-            __put_user(0, &target_stfs->f_flags);
-#endif
-            memset(target_stfs->f_spare, 0, sizeof(target_stfs->f_spare));
-            unlock_user_struct(target_stfs, arg2, 1);
-        }
-        return ret;
-    case TARGET_NR_fstatfs:
-        ret = get_errno(fstatfs(arg1, &stfs));
-        goto convert_statfs;
-#ifdef TARGET_NR_statfs64
-    case TARGET_NR_statfs64:
-        if (!(p = lock_user_string(arg1))) {
-            return -TARGET_EFAULT;
-        }
-        ret = get_errno(statfs(path(p), &stfs));
-        unlock_user(p, arg1, 0);
-    convert_statfs64:
-        if (!is_error(ret)) {
-            struct target_statfs64 *target_stfs;
-
-            if (!lock_user_struct(VERIFY_WRITE, target_stfs, arg3, 0))
-                return -TARGET_EFAULT;
-            __put_user(stfs.f_type, &target_stfs->f_type);
-            __put_user(stfs.f_bsize, &target_stfs->f_bsize);
-            __put_user(stfs.f_blocks, &target_stfs->f_blocks);
-            __put_user(stfs.f_bfree, &target_stfs->f_bfree);
-            __put_user(stfs.f_bavail, &target_stfs->f_bavail);
-            __put_user(stfs.f_files, &target_stfs->f_files);
-            __put_user(stfs.f_ffree, &target_stfs->f_ffree);
-            __put_user(stfs.f_fsid.__val[0], &target_stfs->f_fsid.val[0]);
-            __put_user(stfs.f_fsid.__val[1], &target_stfs->f_fsid.val[1]);
-            __put_user(stfs.f_namelen, &target_stfs->f_namelen);
-            __put_user(stfs.f_frsize, &target_stfs->f_frsize);
-            memset(target_stfs->f_spare, 0, sizeof(target_stfs->f_spare));
-            unlock_user_struct(target_stfs, arg3, 1);
-        }
-        return ret;
-    case TARGET_NR_fstatfs64:
-        ret = get_errno(fstatfs(arg1, &stfs));
-        goto convert_statfs64;
-#endif
 #ifdef TARGET_NR_socketcall
     case TARGET_NR_socketcall:
         return do_socketcall(arg1, arg2);
@@ -12744,6 +12793,10 @@ static impl_fn *syscall_table(unsigned num)
 #endif
 #ifdef TARGET_NR_fork
         SYSCALL(fork);
+#endif
+        SYSCALL(fstatfs);
+#ifdef TARGET_NR_fstatfs64
+        SYSCALL(fstatfs64);
 #endif
         SYSCALL(ftruncate);
 #ifdef TARGET_NR_futimesat
@@ -12874,6 +12927,10 @@ static impl_fn *syscall_table(unsigned num)
 #endif
 #ifdef TARGET_NR_ssetmask
         SYSCALL(ssetmask);
+#endif
+        SYSCALL(statfs);
+#ifdef TARGET_NR_statfs64
+        SYSCALL(statfs64);
 #endif
 #ifdef TARGET_NR_stime
         SYSCALL(stime);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 043/108] linux-user: Split out getpriority, setpriority
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (41 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 042/108] linux-user: Split out fstatfs, fstatfs64, statfs, statfs64 Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 044/108] linux-user: Split out socketcall Richard Henderson
                   ` (68 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 46 +++++++++++++++++++++++++++-----------------
 1 file changed, 28 insertions(+), 18 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 86583988c4..6d8d2eb780 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8241,6 +8241,27 @@ IMPL(getppid)
 }
 #endif
 
+IMPL(getpriority)
+{
+    abi_long ret;
+
+    /* Note that negative values are valid for getpriority, so we must
+       differentiate based on errno settings.  */
+    errno = 0;
+    ret = getpriority(arg1, arg2);
+    if (ret == -1 && errno != 0) {
+        return -host_to_target_errno(errno);
+    }
+#ifdef TARGET_ALPHA
+    /* Return value is the unbiased priority.  Signal no error.  */
+    ((CPUAlphaState *)cpu_env)->ir[IR_V0] = 0;
+    return ret;
+#else
+    /* Return value is a biased priority to avoid negative numbers.  */
+    return 20 - ret;
+#endif
+}
+
 IMPL(getrlimit)
 {
     int resource = target_to_host_resource(arg1);
@@ -9303,6 +9324,11 @@ IMPL(setpgid)
     return get_errno(setpgid(arg1, arg2));
 }
 
+IMPL(setpriority)
+{
+    return get_errno(setpriority(arg1, arg2, arg3));
+}
+
 IMPL(setrlimit)
 {
     int resource = target_to_host_resource(arg1);
@@ -9898,24 +9924,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_getpriority:
-        /* Note that negative values are valid for getpriority, so we must
-           differentiate based on errno settings.  */
-        errno = 0;
-        ret = getpriority(arg1, arg2);
-        if (ret == -1 && errno != 0) {
-            return -host_to_target_errno(errno);
-        }
-#ifdef TARGET_ALPHA
-        /* Return value is the unbiased priority.  Signal no error.  */
-        ((CPUAlphaState *)cpu_env)->ir[IR_V0] = 0;
-#else
-        /* Return value is a biased priority to avoid negative numbers.  */
-        ret = 20 - ret;
-#endif
-        return ret;
-    case TARGET_NR_setpriority:
-        return get_errno(setpriority(arg1, arg2, arg3));
 #ifdef TARGET_NR_socketcall
     case TARGET_NR_socketcall:
         return do_socketcall(arg1, arg2);
@@ -12811,6 +12819,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_getppid
         SYSCALL(getppid);
 #endif
+        SYSCALL(getpriority);
         SYSCALL(getrlimit);
         SYSCALL(getrusage);
         SYSCALL(gettimeofday);
@@ -12907,6 +12916,7 @@ static impl_fn *syscall_table(unsigned num)
 #endif
         SYSCALL(sethostname);
         SYSCALL(setpgid);
+        SYSCALL(setpriority);
         SYSCALL(setrlimit);
         SYSCALL(settimeofday);
         SYSCALL(setsid);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 044/108] linux-user: Split out socketcall
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (42 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 043/108] linux-user: Split out getpriority, setpriority Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 045/108] linux-user: Split out accept, accept4, bind, connect Richard Henderson
                   ` (67 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

At the same time, merge do_socketcall into the new function.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 194 +++++++++++++++++++++----------------------
 1 file changed, 97 insertions(+), 97 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 6d8d2eb780..d50c84614e 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4184,99 +4184,6 @@ fail:
     return ret;
 }
 
-#ifdef TARGET_NR_socketcall
-/* do_socketcall() must return target values and target errnos. */
-static abi_long do_socketcall(int num, abi_ulong vptr)
-{
-    static const unsigned nargs[] = { /* number of arguments per operation */
-        [TARGET_SYS_SOCKET] = 3,      /* domain, type, protocol */
-        [TARGET_SYS_BIND] = 3,        /* fd, addr, addrlen */
-        [TARGET_SYS_CONNECT] = 3,     /* fd, addr, addrlen */
-        [TARGET_SYS_LISTEN] = 2,      /* fd, backlog */
-        [TARGET_SYS_ACCEPT] = 3,      /* fd, addr, addrlen */
-        [TARGET_SYS_GETSOCKNAME] = 3, /* fd, addr, addrlen */
-        [TARGET_SYS_GETPEERNAME] = 3, /* fd, addr, addrlen */
-        [TARGET_SYS_SOCKETPAIR] = 4,  /* domain, type, protocol, tab */
-        [TARGET_SYS_SEND] = 4,        /* fd, msg, len, flags */
-        [TARGET_SYS_RECV] = 4,        /* fd, msg, len, flags */
-        [TARGET_SYS_SENDTO] = 6,      /* fd, msg, len, flags, addr, addrlen */
-        [TARGET_SYS_RECVFROM] = 6,    /* fd, msg, len, flags, addr, addrlen */
-        [TARGET_SYS_SHUTDOWN] = 2,    /* fd, how */
-        [TARGET_SYS_SETSOCKOPT] = 5,  /* fd, level, optname, optval, optlen */
-        [TARGET_SYS_GETSOCKOPT] = 5,  /* fd, level, optname, optval, optlen */
-        [TARGET_SYS_SENDMSG] = 3,     /* fd, msg, flags */
-        [TARGET_SYS_RECVMSG] = 3,     /* fd, msg, flags */
-        [TARGET_SYS_ACCEPT4] = 4,     /* fd, addr, addrlen, flags */
-        [TARGET_SYS_RECVMMSG] = 4,    /* fd, msgvec, vlen, flags */
-        [TARGET_SYS_SENDMMSG] = 4,    /* fd, msgvec, vlen, flags */
-    };
-    abi_long a[6]; /* max 6 args */
-    unsigned i;
-
-    /* check the range of the first argument num */
-    /* (TARGET_SYS_SENDMMSG is the highest among TARGET_SYS_xxx) */
-    if (num < 1 || num > TARGET_SYS_SENDMMSG) {
-        return -TARGET_EINVAL;
-    }
-    /* ensure we have space for args */
-    if (nargs[num] > ARRAY_SIZE(a)) {
-        return -TARGET_EINVAL;
-    }
-    /* collect the arguments in a[] according to nargs[] */
-    for (i = 0; i < nargs[num]; ++i) {
-        if (get_user_ual(a[i], vptr + i * sizeof(abi_long)) != 0) {
-            return -TARGET_EFAULT;
-        }
-    }
-    /* now when we have the args, invoke the appropriate underlying function */
-    switch (num) {
-    case TARGET_SYS_SOCKET: /* domain, type, protocol */
-        return do_socket(a[0], a[1], a[2]);
-    case TARGET_SYS_BIND: /* sockfd, addr, addrlen */
-        return do_bind(a[0], a[1], a[2]);
-    case TARGET_SYS_CONNECT: /* sockfd, addr, addrlen */
-        return do_connect(a[0], a[1], a[2]);
-    case TARGET_SYS_LISTEN: /* sockfd, backlog */
-        return get_errno(listen(a[0], a[1]));
-    case TARGET_SYS_ACCEPT: /* sockfd, addr, addrlen */
-        return do_accept4(a[0], a[1], a[2], 0);
-    case TARGET_SYS_GETSOCKNAME: /* sockfd, addr, addrlen */
-        return do_getsockname(a[0], a[1], a[2]);
-    case TARGET_SYS_GETPEERNAME: /* sockfd, addr, addrlen */
-        return do_getpeername(a[0], a[1], a[2]);
-    case TARGET_SYS_SOCKETPAIR: /* domain, type, protocol, tab */
-        return do_socketpair(a[0], a[1], a[2], a[3]);
-    case TARGET_SYS_SEND: /* sockfd, msg, len, flags */
-        return do_sendto(a[0], a[1], a[2], a[3], 0, 0);
-    case TARGET_SYS_RECV: /* sockfd, msg, len, flags */
-        return do_recvfrom(a[0], a[1], a[2], a[3], 0, 0);
-    case TARGET_SYS_SENDTO: /* sockfd, msg, len, flags, addr, addrlen */
-        return do_sendto(a[0], a[1], a[2], a[3], a[4], a[5]);
-    case TARGET_SYS_RECVFROM: /* sockfd, msg, len, flags, addr, addrlen */
-        return do_recvfrom(a[0], a[1], a[2], a[3], a[4], a[5]);
-    case TARGET_SYS_SHUTDOWN: /* sockfd, how */
-        return get_errno(shutdown(a[0], a[1]));
-    case TARGET_SYS_SETSOCKOPT: /* sockfd, level, optname, optval, optlen */
-        return do_setsockopt(a[0], a[1], a[2], a[3], a[4]);
-    case TARGET_SYS_GETSOCKOPT: /* sockfd, level, optname, optval, optlen */
-        return do_getsockopt(a[0], a[1], a[2], a[3], a[4]);
-    case TARGET_SYS_SENDMSG: /* sockfd, msg, flags */
-        return do_sendrecvmsg(a[0], a[1], a[2], 1);
-    case TARGET_SYS_RECVMSG: /* sockfd, msg, flags */
-        return do_sendrecvmsg(a[0], a[1], a[2], 0);
-    case TARGET_SYS_ACCEPT4: /* sockfd, addr, addrlen, flags */
-        return do_accept4(a[0], a[1], a[2], a[3]);
-    case TARGET_SYS_RECVMMSG: /* sockfd, msgvec, vlen, flags */
-        return do_sendrecvmmsg(a[0], a[1], a[2], a[3], 0);
-    case TARGET_SYS_SENDMMSG: /* sockfd, msgvec, vlen, flags */
-        return do_sendrecvmmsg(a[0], a[1], a[2], a[3], 1);
-    default:
-        gemu_log("Unsupported socketcall: %d\n", num);
-        return -TARGET_EINVAL;
-    }
-}
-#endif
-
 #define N_SHM_REGIONS	32
 
 static struct shm_region {
@@ -9575,6 +9482,100 @@ IMPL(sigsuspend)
 }
 #endif
 
+#ifdef TARGET_NR_socketcall
+IMPL(socketcall)
+{
+    static const unsigned nargs[] = { /* number of arguments per operation */
+        [TARGET_SYS_SOCKET] = 3,      /* domain, type, protocol */
+        [TARGET_SYS_BIND] = 3,        /* fd, addr, addrlen */
+        [TARGET_SYS_CONNECT] = 3,     /* fd, addr, addrlen */
+        [TARGET_SYS_LISTEN] = 2,      /* fd, backlog */
+        [TARGET_SYS_ACCEPT] = 3,      /* fd, addr, addrlen */
+        [TARGET_SYS_GETSOCKNAME] = 3, /* fd, addr, addrlen */
+        [TARGET_SYS_GETPEERNAME] = 3, /* fd, addr, addrlen */
+        [TARGET_SYS_SOCKETPAIR] = 4,  /* domain, type, protocol, tab */
+        [TARGET_SYS_SEND] = 4,        /* fd, msg, len, flags */
+        [TARGET_SYS_RECV] = 4,        /* fd, msg, len, flags */
+        [TARGET_SYS_SENDTO] = 6,      /* fd, msg, len, flags, addr, addrlen */
+        [TARGET_SYS_RECVFROM] = 6,    /* fd, msg, len, flags, addr, addrlen */
+        [TARGET_SYS_SHUTDOWN] = 2,    /* fd, how */
+        [TARGET_SYS_SETSOCKOPT] = 5,  /* fd, level, optname, optval, optlen */
+        [TARGET_SYS_GETSOCKOPT] = 5,  /* fd, level, optname, optval, optlen */
+        [TARGET_SYS_SENDMSG] = 3,     /* fd, msg, flags */
+        [TARGET_SYS_RECVMSG] = 3,     /* fd, msg, flags */
+        [TARGET_SYS_ACCEPT4] = 4,     /* fd, addr, addrlen, flags */
+        [TARGET_SYS_RECVMMSG] = 4,    /* fd, msgvec, vlen, flags */
+        [TARGET_SYS_SENDMMSG] = 4,    /* fd, msgvec, vlen, flags */
+    };
+    abi_ulong vptr = arg2;
+    abi_long a[6]; /* max 6 args */
+    unsigned i;
+
+    /* check the range of the first argument num */
+    num = arg1;
+    /* (TARGET_SYS_SENDMMSG is the highest among TARGET_SYS_xxx) */
+    if (num < 1 || num > TARGET_SYS_SENDMMSG) {
+        return -TARGET_EINVAL;
+    }
+    /* ensure we have space for args */
+    if (nargs[num] > ARRAY_SIZE(a)) {
+        return -TARGET_EINVAL;
+    }
+    /* collect the arguments in a[] according to nargs[] */
+    for (i = 0; i < nargs[num]; ++i) {
+        if (get_user_ual(a[i], vptr + i * sizeof(abi_long)) != 0) {
+            return -TARGET_EFAULT;
+        }
+    }
+    /* now when we have the args, invoke the appropriate underlying function */
+    switch (num) {
+    case TARGET_SYS_SOCKET: /* domain, type, protocol */
+        return do_socket(a[0], a[1], a[2]);
+    case TARGET_SYS_BIND: /* sockfd, addr, addrlen */
+        return do_bind(a[0], a[1], a[2]);
+    case TARGET_SYS_CONNECT: /* sockfd, addr, addrlen */
+        return do_connect(a[0], a[1], a[2]);
+    case TARGET_SYS_LISTEN: /* sockfd, backlog */
+        return get_errno(listen(a[0], a[1]));
+    case TARGET_SYS_ACCEPT: /* sockfd, addr, addrlen */
+        return do_accept4(a[0], a[1], a[2], 0);
+    case TARGET_SYS_GETSOCKNAME: /* sockfd, addr, addrlen */
+        return do_getsockname(a[0], a[1], a[2]);
+    case TARGET_SYS_GETPEERNAME: /* sockfd, addr, addrlen */
+        return do_getpeername(a[0], a[1], a[2]);
+    case TARGET_SYS_SOCKETPAIR: /* domain, type, protocol, tab */
+        return do_socketpair(a[0], a[1], a[2], a[3]);
+    case TARGET_SYS_SEND: /* sockfd, msg, len, flags */
+        return do_sendto(a[0], a[1], a[2], a[3], 0, 0);
+    case TARGET_SYS_RECV: /* sockfd, msg, len, flags */
+        return do_recvfrom(a[0], a[1], a[2], a[3], 0, 0);
+    case TARGET_SYS_SENDTO: /* sockfd, msg, len, flags, addr, addrlen */
+        return do_sendto(a[0], a[1], a[2], a[3], a[4], a[5]);
+    case TARGET_SYS_RECVFROM: /* sockfd, msg, len, flags, addr, addrlen */
+        return do_recvfrom(a[0], a[1], a[2], a[3], a[4], a[5]);
+    case TARGET_SYS_SHUTDOWN: /* sockfd, how */
+        return get_errno(shutdown(a[0], a[1]));
+    case TARGET_SYS_SETSOCKOPT: /* sockfd, level, optname, optval, optlen */
+        return do_setsockopt(a[0], a[1], a[2], a[3], a[4]);
+    case TARGET_SYS_GETSOCKOPT: /* sockfd, level, optname, optval, optlen */
+        return do_getsockopt(a[0], a[1], a[2], a[3], a[4]);
+    case TARGET_SYS_SENDMSG: /* sockfd, msg, flags */
+        return do_sendrecvmsg(a[0], a[1], a[2], 1);
+    case TARGET_SYS_RECVMSG: /* sockfd, msg, flags */
+        return do_sendrecvmsg(a[0], a[1], a[2], 0);
+    case TARGET_SYS_ACCEPT4: /* sockfd, addr, addrlen, flags */
+        return do_accept4(a[0], a[1], a[2], a[3]);
+    case TARGET_SYS_RECVMMSG: /* sockfd, msgvec, vlen, flags */
+        return do_sendrecvmmsg(a[0], a[1], a[2], a[3], 0);
+    case TARGET_SYS_SENDMMSG: /* sockfd, msgvec, vlen, flags */
+        return do_sendrecvmmsg(a[0], a[1], a[2], a[3], 1);
+    default:
+        gemu_log("Unsupported socketcall: %d\n", num);
+        return -TARGET_EINVAL;
+    }
+}
+#endif
+
 #ifdef TARGET_NR_ssetmask
 IMPL(ssetmask)
 {
@@ -9924,10 +9925,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_socketcall
-    case TARGET_NR_socketcall:
-        return do_socketcall(arg1, arg2);
-#endif
 #ifdef TARGET_NR_accept
     case TARGET_NR_accept:
         return do_accept4(arg1, arg2, arg3, 0);
@@ -12935,6 +12932,9 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_sigsuspend
         SYSCALL(sigsuspend);
 #endif
+#ifdef TARGET_NR_socketcall
+        SYSCALL(socketcall);
+#endif
 #ifdef TARGET_NR_ssetmask
         SYSCALL(ssetmask);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 045/108] linux-user: Split out accept, accept4, bind, connect
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (43 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 044/108] linux-user: Split out socketcall Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 046/108] linux-user: Split out 7 syscalls Richard Henderson
                   ` (66 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define accept4; remove the ifdef.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 52 ++++++++++++++++++++++++++++++--------------
 1 file changed, 36 insertions(+), 16 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index d50c84614e..155da4f523 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7730,6 +7730,18 @@ static abi_long impl_##NAME(void *cpu_env, unsigned num, abi_long arg1,   \
                             abi_long arg5, abi_long arg6, abi_long arg7,  \
                             abi_long arg8)
 
+#ifdef TARGET_NR_accept
+IMPL(accept)
+{
+    return do_accept4(arg1, arg2, arg3, 0);
+}
+#endif
+
+IMPL(accept4)
+{
+    return do_accept4(arg1, arg2, arg3, arg4);
+}
+
 #ifdef TARGET_NR_access
 IMPL(access)
 {
@@ -7769,6 +7781,13 @@ IMPL(alarm)
 }
 #endif
 
+#ifdef TARGET_NR_bind
+IMPL(bind)
+{
+    return do_bind(arg1, arg2, arg3);
+}
+#endif
+
 IMPL(brk)
 {
     return do_brk(arg1);
@@ -7821,6 +7840,13 @@ IMPL(close)
     return get_errno(close(arg1));
 }
 
+#ifdef TARGET_NR_connect
+IMPL(connect)
+{
+    return do_connect(arg1, arg2, arg3);
+}
+#endif
+
 #ifdef TARGET_NR_creat
 IMPL(creat)
 {
@@ -9925,22 +9951,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_accept
-    case TARGET_NR_accept:
-        return do_accept4(arg1, arg2, arg3, 0);
-#endif
-#ifdef TARGET_NR_accept4
-    case TARGET_NR_accept4:
-        return do_accept4(arg1, arg2, arg3, arg4);
-#endif
-#ifdef TARGET_NR_bind
-    case TARGET_NR_bind:
-        return do_bind(arg1, arg2, arg3);
-#endif
-#ifdef TARGET_NR_connect
-    case TARGET_NR_connect:
-        return do_connect(arg1, arg2, arg3);
-#endif
 #ifdef TARGET_NR_getpeername
     case TARGET_NR_getpeername:
         return do_getpeername(arg1, arg2, arg3);
@@ -12769,9 +12779,16 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_access
         SYSCALL(access);
 #endif
+#ifdef TARGET_NR_accept
+        SYSCALL(accept);
+#endif
+        SYSCALL(accept4);
         SYSCALL(acct);
 #ifdef TARGET_NR_alarm
         SYSCALL(alarm);
+#endif
+#ifdef TARGET_NR_bind
+        SYSCALL(bind);
 #endif
         SYSCALL(brk);
         SYSCALL(close);
@@ -12780,6 +12797,9 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_chmod
         SYSCALL(chmod);
 #endif
+#ifdef TARGET_NR_connect
+        SYSCALL(connect);
+#endif
 #ifdef TARGET_NR_creat
         SYSCALL(creat);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 046/108] linux-user: Split out 7 syscalls
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (44 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 045/108] linux-user: Split out accept, accept4, bind, connect Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 047/108] linux-user: Split out recvmmsg, send, sendmmsg, sendmsg, sendto Richard Henderson
                   ` (65 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Handle getpeername, getsockname, getsockopt,
listen, recv, recvfrom, recvmsg.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 98 +++++++++++++++++++++++++++++++-------------
 1 file changed, 70 insertions(+), 28 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 155da4f523..98a982f83f 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8153,6 +8153,13 @@ IMPL(futimesat)
 }
 #endif
 
+#ifdef TARGET_NR_getpeername
+IMPL(getpeername)
+{
+    return do_getpeername(arg1, arg2, arg3);
+}
+#endif
+
 #ifdef TARGET_NR_getpgrp
 IMPL(getpgrp)
 {
@@ -8226,6 +8233,20 @@ IMPL(getrusage)
     return ret;
 }
 
+#ifdef TARGET_NR_getsockname
+IMPL(getsockname)
+{
+    return do_getsockname(arg1, arg2, arg3);
+}
+#endif
+
+#ifdef TARGET_NR_getsockopt
+IMPL(getsockopt)
+{
+    return do_getsockopt(arg1, arg2, arg3, arg4, arg5);
+}
+#endif
+
 IMPL(gettimeofday)
 {
     struct timeval tv;
@@ -8374,6 +8395,13 @@ IMPL(linkat)
     return ret;
 }
 
+#ifdef TARGET_NR_listen
+IMPL(listen)
+{
+    return get_errno(listen(arg1, arg2));
+}
+#endif
+
 IMPL(lseek)
 {
     return get_errno(lseek(arg1, arg2, arg3));
@@ -8912,6 +8940,27 @@ IMPL(reboot)
     return ret;
 }
 
+#ifdef TARGET_NR_recv
+IMPL(recv)
+{
+    return do_recvfrom(arg1, arg2, arg3, arg4, 0, 0);
+}
+#endif
+
+#ifdef TARGET_NR_recvfrom
+IMPL(recvfrom)
+{
+    return do_recvfrom(arg1, arg2, arg3, arg4, arg5, arg6);
+}
+#endif
+
+#ifdef TARGET_NR_recvmsg
+IMPL(recvmsg)
+{
+    return do_sendrecvmsg(arg1, arg2, arg3, 0);
+}
+#endif
+
 #ifdef TARGET_NR_rename
 IMPL(rename)
 {
@@ -9951,34 +10000,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_getpeername
-    case TARGET_NR_getpeername:
-        return do_getpeername(arg1, arg2, arg3);
-#endif
-#ifdef TARGET_NR_getsockname
-    case TARGET_NR_getsockname:
-        return do_getsockname(arg1, arg2, arg3);
-#endif
-#ifdef TARGET_NR_getsockopt
-    case TARGET_NR_getsockopt:
-        return do_getsockopt(arg1, arg2, arg3, arg4, arg5);
-#endif
-#ifdef TARGET_NR_listen
-    case TARGET_NR_listen:
-        return get_errno(listen(arg1, arg2));
-#endif
-#ifdef TARGET_NR_recv
-    case TARGET_NR_recv:
-        return do_recvfrom(arg1, arg2, arg3, arg4, 0, 0);
-#endif
-#ifdef TARGET_NR_recvfrom
-    case TARGET_NR_recvfrom:
-        return do_recvfrom(arg1, arg2, arg3, arg4, arg5, arg6);
-#endif
-#ifdef TARGET_NR_recvmsg
-    case TARGET_NR_recvmsg:
-        return do_sendrecvmsg(arg1, arg2, arg3, 0);
-#endif
 #ifdef TARGET_NR_send
     case TARGET_NR_send:
         return do_sendto(arg1, arg2, arg3, arg4, 0, 0);
@@ -12827,6 +12848,9 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_futimesat
         SYSCALL(futimesat);
 #endif
+#ifdef TARGET_NR_getpeername
+        SYSCALL(getpeername);
+#endif
 #ifdef TARGET_NR_getpgrp
         SYSCALL(getpgrp);
 #endif
@@ -12839,6 +12863,12 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(getpriority);
         SYSCALL(getrlimit);
         SYSCALL(getrusage);
+#ifdef TARGET_NR_getsockname
+        SYSCALL(getsockname);
+#endif
+#ifdef TARGET_NR_getsockopt
+        SYSCALL(getsockopt);
+#endif
         SYSCALL(gettimeofday);
 #if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
         SYSCALL(getxpid);
@@ -12849,6 +12879,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(link);
 #endif
         SYSCALL(linkat);
+#ifdef TARGET_NR_listen
+        SYSCALL(listen);
+#endif
         SYSCALL(lseek);
 #ifdef TARGET_NR_mkdir
         SYSCALL(mkdir);
@@ -12903,6 +12936,15 @@ static impl_fn *syscall_table(unsigned num)
 #endif
         SYSCALL(readlinkat);
         SYSCALL(reboot);
+#ifdef TARGET_NR_recv
+        SYSCALL(recv);
+#endif
+#ifdef TARGET_NR_recvfrom
+        SYSCALL(recvfrom);
+#endif
+#ifdef TARGET_NR_recvmsg
+        SYSCALL(recvmsg);
+#endif
 #ifdef TARGET_NR_rename
         SYSCALL(rename);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 047/108] linux-user: Split out recvmmsg, send, sendmmsg, sendmsg, sendto
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (45 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 046/108] linux-user: Split out 7 syscalls Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 048/108] linux-user: Split out getrandom, shutdown, setsockopt, socket, socketpair Richard Henderson
                   ` (64 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 68 ++++++++++++++++++++++++++++++++------------
 1 file changed, 50 insertions(+), 18 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 98a982f83f..977f61610c 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8954,6 +8954,13 @@ IMPL(recvfrom)
 }
 #endif
 
+#ifdef TARGET_NR_recvmmsg
+IMPL(recvmmsg)
+{
+    return do_sendrecvmmsg(arg1, arg2, arg3, arg4, 0);
+}
+#endif
+
 #ifdef TARGET_NR_recvmsg
 IMPL(recvmsg)
 {
@@ -9288,6 +9295,34 @@ IMPL(select)
 }
 #endif
 
+#ifdef TARGET_NR_send
+IMPL(send)
+{
+    return do_sendto(arg1, arg2, arg3, arg4, 0, 0);
+}
+#endif
+
+#ifdef TARGET_NR_sendmsg
+IMPL(sendmsg)
+{
+    return do_sendrecvmsg(arg1, arg2, arg3, 1);
+}
+#endif
+
+#ifdef TARGET_NR_sendmmsg
+IMPL(sendmmsg)
+{
+    return do_sendrecvmmsg(arg1, arg2, arg3, arg4, 1);
+}
+#endif
+
+#ifdef TARGET_NR_sendto
+IMPL(sendto)
+{
+    return do_sendto(arg1, arg2, arg3, arg4, arg5, arg6);
+}
+#endif
+
 IMPL(sethostname)
 {
     char *p = lock_user_string(arg1);
@@ -10000,24 +10035,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_send
-    case TARGET_NR_send:
-        return do_sendto(arg1, arg2, arg3, arg4, 0, 0);
-#endif
-#ifdef TARGET_NR_sendmsg
-    case TARGET_NR_sendmsg:
-        return do_sendrecvmsg(arg1, arg2, arg3, 1);
-#endif
-#ifdef TARGET_NR_sendmmsg
-    case TARGET_NR_sendmmsg:
-        return do_sendrecvmmsg(arg1, arg2, arg3, arg4, 1);
-    case TARGET_NR_recvmmsg:
-        return do_sendrecvmmsg(arg1, arg2, arg3, arg4, 0);
-#endif
-#ifdef TARGET_NR_sendto
-    case TARGET_NR_sendto:
-        return do_sendto(arg1, arg2, arg3, arg4, arg5, arg6);
-#endif
 #ifdef TARGET_NR_shutdown
     case TARGET_NR_shutdown:
         return get_errno(shutdown(arg1, arg2));
@@ -12942,6 +12959,9 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_recvfrom
         SYSCALL(recvfrom);
 #endif
+#ifdef TARGET_NR_recvmmsg
+        SYSCALL(recvmmsg);
+#endif
 #ifdef TARGET_NR_recvmsg
         SYSCALL(recvmsg);
 #endif
@@ -12972,6 +12992,18 @@ static impl_fn *syscall_table(unsigned num)
 # else
         SYSCALL(select);
 # endif
+#endif
+#ifdef TARGET_NR_send
+        SYSCALL(send);
+#endif
+#ifdef TARGET_NR_sendmmsg
+        SYSCALL(sendmmsg);
+#endif
+#ifdef TARGET_NR_sendmsg
+        SYSCALL(sendmsg);
+#endif
+#ifdef TARGET_NR_sendto
+        SYSCALL(sendto);
 #endif
         SYSCALL(sethostname);
         SYSCALL(setpgid);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 048/108] linux-user: Split out getrandom, shutdown, setsockopt, socket, socketpair
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (46 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 047/108] linux-user: Split out recvmmsg, send, sendmmsg, sendmsg, sendto Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 049/108] linux-user: Fix stub gettid Richard Henderson
                   ` (63 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define getrandom; remove the ifdef.
Define a stub if the host __NR_getrandom is not defined.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 90 ++++++++++++++++++++++++++++++--------------
 1 file changed, 62 insertions(+), 28 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 977f61610c..4dc2312ae6 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -249,6 +249,14 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,	\
 #define TARGET_NR__llseek TARGET_NR_llseek
 #endif
 
+/* These definitions produce an ENOSYS from the host kernel.
+ * Performing a bogus syscall is lazier than boilerplating
+ * the replacement functions here in C.
+ */
+#ifndef __NR_getrandom
+#define __NR_getrandom  -1
+#endif
+
 #ifdef __NR_gettid
 _syscall0(int, gettid)
 #else
@@ -315,9 +323,7 @@ _syscall2(int, ioprio_get, int, which, int, who)
 #if defined(TARGET_NR_ioprio_set) && defined(__NR_ioprio_set)
 _syscall3(int, ioprio_set, int, which, int, who, int, ioprio)
 #endif
-#if defined(TARGET_NR_getrandom) && defined(__NR_getrandom)
 _syscall3(int, getrandom, void *, buf, size_t, buflen, unsigned int, flags)
-#endif
 
 #if defined(TARGET_NR_kcmp) && defined(__NR_kcmp)
 _syscall5(int, kcmp, pid_t, pid1, pid_t, pid2, int, type,
@@ -8202,6 +8208,19 @@ IMPL(getpriority)
 #endif
 }
 
+IMPL(getrandom)
+{
+    char *p = lock_user(VERIFY_WRITE, arg1, arg2, 0);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(getrandom(p, arg2, arg3));
+    unlock_user(p, arg1, ret);
+    return ret;
+}
+
 IMPL(getrlimit)
 {
     int resource = target_to_host_resource(arg1);
@@ -9284,6 +9303,13 @@ IMPL(sgetmask)
 }
 #endif
 
+#ifdef TARGET_NR_shutdown
+IMPL(shutdown)
+{
+    return get_errno(shutdown(arg1, arg2));
+}
+#endif
+
 #if defined(TARGET_NR_select) && !defined(TARGET_WANT_NI_OLD_SELECT)
 IMPL(select)
 {
@@ -9361,6 +9387,13 @@ IMPL(setrlimit)
     return get_errno(setrlimit(resource, &rlim));
 }
 
+#ifdef TARGET_NR_setsockopt
+IMPL(setsockopt)
+{
+    return do_setsockopt(arg1, arg2, arg3, arg4, (socklen_t) arg5);
+}
+#endif
+
 IMPL(settimeofday)
 {
     struct timeval tv;
@@ -9592,6 +9625,13 @@ IMPL(sigsuspend)
 }
 #endif
 
+#ifdef TARGET_NR_socket
+IMPL(socket)
+{
+    return do_socket(arg1, arg2, arg3);
+}
+#endif
+
 #ifdef TARGET_NR_socketcall
 IMPL(socketcall)
 {
@@ -9686,6 +9726,13 @@ IMPL(socketcall)
 }
 #endif
 
+#ifdef TARGET_NR_socketpair
+IMPL(socketpair)
+{
+    return do_socketpair(arg1, arg2, arg3, arg4);
+}
+#endif
+
 #ifdef TARGET_NR_ssetmask
 IMPL(ssetmask)
 {
@@ -10035,32 +10082,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_shutdown
-    case TARGET_NR_shutdown:
-        return get_errno(shutdown(arg1, arg2));
-#endif
-#if defined(TARGET_NR_getrandom) && defined(__NR_getrandom)
-    case TARGET_NR_getrandom:
-        p = lock_user(VERIFY_WRITE, arg1, arg2, 0);
-        if (!p) {
-            return -TARGET_EFAULT;
-        }
-        ret = get_errno(getrandom(p, arg2, arg3));
-        unlock_user(p, arg1, ret);
-        return ret;
-#endif
-#ifdef TARGET_NR_socket
-    case TARGET_NR_socket:
-        return do_socket(arg1, arg2, arg3);
-#endif
-#ifdef TARGET_NR_socketpair
-    case TARGET_NR_socketpair:
-        return do_socketpair(arg1, arg2, arg3, arg4);
-#endif
-#ifdef TARGET_NR_setsockopt
-    case TARGET_NR_setsockopt:
-        return do_setsockopt(arg1, arg2, arg3, arg4, (socklen_t) arg5);
-#endif
 #if defined(TARGET_NR_syslog)
     case TARGET_NR_syslog:
         {
@@ -12878,6 +12899,7 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(getppid);
 #endif
         SYSCALL(getpriority);
+        SYSCALL(getrandom);
         SYSCALL(getrlimit);
         SYSCALL(getrusage);
 #ifdef TARGET_NR_getsockname
@@ -12986,6 +13008,9 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_sgetmask
         SYSCALL(sgetmask);
 #endif
+#ifdef TARGET_NR_shutdown
+        SYSCALL(shutdown);
+#endif
 #ifdef TARGET_NR_select
 # ifdef TARGET_WANT_NI_OLD_SELECT
         SYSCALL_WITH(select, enosys);
@@ -13009,6 +13034,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(setpgid);
         SYSCALL(setpriority);
         SYSCALL(setrlimit);
+#ifdef TARGET_NR_setsockopt
+        SYSCALL(setsockopt);
+#endif
         SYSCALL(settimeofday);
         SYSCALL(setsid);
 #ifdef TARGET_NR_sigaction
@@ -13026,9 +13054,15 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_sigsuspend
         SYSCALL(sigsuspend);
 #endif
+#ifdef TARGET_NR_socket
+        SYSCALL(socket);
+#endif
 #ifdef TARGET_NR_socketcall
         SYSCALL(socketcall);
 #endif
+#ifdef TARGET_NR_socketpair
+        SYSCALL(socketpair);
+#endif
 #ifdef TARGET_NR_ssetmask
         SYSCALL(ssetmask);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 049/108] linux-user: Fix stub gettid
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (47 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 048/108] linux-user: Split out getrandom, shutdown, setsockopt, socket, socketpair Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 050/108] linux-user: Split out getitimer, setitimer, syslog Richard Henderson
                   ` (62 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

A "proper" implementation of the stub would assign ENOSYS to
errno and return -1.  As it is, the subsequent get_error will
return whatever garbage value was in errno.

Use the bogus syscall method for defining the stub function.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 4dc2312ae6..46c7c485fd 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -256,17 +256,12 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,	\
 #ifndef __NR_getrandom
 #define __NR_getrandom  -1
 #endif
-
-#ifdef __NR_gettid
-_syscall0(int, gettid)
-#else
-/* This is a replacement for the host gettid() and must return a host
-   errno. */
-static int gettid(void) {
-    return -ENOSYS;
-}
+#ifndef __NR_gettid
+#define __NR_gettid  -1
 #endif
 
+_syscall0(int, gettid)
+
 /* For the 64-bit guest on 32-bit host case we must emulate
  * getdents using getdents64, because otherwise the host
  * might hand us back more dirent records than we can fit
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 050/108] linux-user: Split out getitimer, setitimer, syslog
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (48 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 049/108] linux-user: Fix stub gettid Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 051/108] linux-user: Split out fstat, lstat, stat Richard Henderson
                   ` (61 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define syslog; remove the ifdef.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 155 ++++++++++++++++++++++---------------------
 1 file changed, 79 insertions(+), 76 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 46c7c485fd..c8fc7fc908 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8154,6 +8154,20 @@ IMPL(futimesat)
 }
 #endif
 
+IMPL(getitimer)
+{
+    struct itimerval value;
+    abi_long ret = get_errno(getitimer(arg1, &value));
+
+    if (!is_error(ret) && arg2 &&
+        (copy_to_user_timeval(arg2, &value.it_interval) ||
+         copy_to_user_timeval(arg2 + sizeof(struct target_timeval),
+                              &value.it_value))) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+
 #ifdef TARGET_NR_getpeername
 IMPL(getpeername)
 {
@@ -9357,6 +9371,28 @@ IMPL(sethostname)
     return ret;
 }
 
+IMPL(setitimer)
+{
+    struct itimerval ivalue, ovalue;
+    abi_long ret;
+
+    if (arg2 &&
+        (copy_from_user_timeval(&ivalue.it_interval, arg2) ||
+         copy_from_user_timeval(&ivalue.it_value,
+                                arg2 + sizeof(struct target_timeval)))) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(setitimer(arg1, arg2 ? &ivalue : NULL,
+                              arg3 ? &ovalue : NULL));
+    if (!is_error(ret) && arg3 &&
+        (copy_to_user_timeval(arg3, &ovalue.it_interval) ||
+         copy_to_user_timeval(arg3 + sizeof(struct target_timeval),
+                              &ovalue.it_value))) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+
 IMPL(setpgid)
 {
     return get_errno(setpgid(arg1, arg2));
@@ -9848,6 +9884,46 @@ IMPL(syncfs)
 }
 #endif
 
+IMPL(syslog)
+{
+    abi_long ret;
+    char *p;
+    int len;
+
+    switch (arg1) {
+    case TARGET_SYSLOG_ACTION_CLOSE:         /* Close log */
+    case TARGET_SYSLOG_ACTION_OPEN:          /* Open log */
+    case TARGET_SYSLOG_ACTION_CLEAR:         /* Clear ring buffer */
+    case TARGET_SYSLOG_ACTION_CONSOLE_OFF:   /* Disable logging */
+    case TARGET_SYSLOG_ACTION_CONSOLE_ON:    /* Enable logging */
+    case TARGET_SYSLOG_ACTION_CONSOLE_LEVEL: /* Set messages level */
+    case TARGET_SYSLOG_ACTION_SIZE_UNREAD:   /* Number of chars */
+    case TARGET_SYSLOG_ACTION_SIZE_BUFFER:   /* Size of the buffer */
+        return get_errno(sys_syslog((int)arg1, NULL, (int)arg3));
+
+    case TARGET_SYSLOG_ACTION_READ:          /* Read from log */
+    case TARGET_SYSLOG_ACTION_READ_CLEAR:    /* Read/clear msgs */
+    case TARGET_SYSLOG_ACTION_READ_ALL:      /* Read last messages */
+        len = arg2;
+        if (len < 0) {
+            return -TARGET_EINVAL;
+        }
+        if (len == 0) {
+            return 0;
+        }
+        p = lock_user(VERIFY_WRITE, arg2, arg3, 0);
+        if (!p) {
+            return -TARGET_EFAULT;
+        }
+        ret = get_errno(sys_syslog((int)arg1, p, (int)arg3));
+        unlock_user(p, arg2, arg3);
+        return ret;
+
+    default:
+        return -TARGET_EINVAL;
+    }
+}
+
 #ifdef TARGET_NR_time
 IMPL(time)
 {
@@ -10077,82 +10153,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#if defined(TARGET_NR_syslog)
-    case TARGET_NR_syslog:
-        {
-            int len = arg2;
-
-            switch (arg1) {
-            case TARGET_SYSLOG_ACTION_CLOSE:         /* Close log */
-            case TARGET_SYSLOG_ACTION_OPEN:          /* Open log */
-            case TARGET_SYSLOG_ACTION_CLEAR:         /* Clear ring buffer */
-            case TARGET_SYSLOG_ACTION_CONSOLE_OFF:   /* Disable logging */
-            case TARGET_SYSLOG_ACTION_CONSOLE_ON:    /* Enable logging */
-            case TARGET_SYSLOG_ACTION_CONSOLE_LEVEL: /* Set messages level */
-            case TARGET_SYSLOG_ACTION_SIZE_UNREAD:   /* Number of chars */
-            case TARGET_SYSLOG_ACTION_SIZE_BUFFER:   /* Size of the buffer */
-                return get_errno(sys_syslog((int)arg1, NULL, (int)arg3));
-            case TARGET_SYSLOG_ACTION_READ:          /* Read from log */
-            case TARGET_SYSLOG_ACTION_READ_CLEAR:    /* Read/clear msgs */
-            case TARGET_SYSLOG_ACTION_READ_ALL:      /* Read last messages */
-                {
-                    if (len < 0) {
-                        return -TARGET_EINVAL;
-                    }
-                    if (len == 0) {
-                        return 0;
-                    }
-                    p = lock_user(VERIFY_WRITE, arg2, arg3, 0);
-                    if (!p) {
-                        return -TARGET_EFAULT;
-                    }
-                    ret = get_errno(sys_syslog((int)arg1, p, (int)arg3));
-                    unlock_user(p, arg2, arg3);
-                }
-                return ret;
-            default:
-                return -TARGET_EINVAL;
-            }
-        }
-        break;
-#endif
-    case TARGET_NR_setitimer:
-        {
-            struct itimerval value, ovalue, *pvalue;
-
-            if (arg2) {
-                pvalue = &value;
-                if (copy_from_user_timeval(&pvalue->it_interval, arg2)
-                    || copy_from_user_timeval(&pvalue->it_value,
-                                              arg2 + sizeof(struct target_timeval)))
-                    return -TARGET_EFAULT;
-            } else {
-                pvalue = NULL;
-            }
-            ret = get_errno(setitimer(arg1, pvalue, &ovalue));
-            if (!is_error(ret) && arg3) {
-                if (copy_to_user_timeval(arg3,
-                                         &ovalue.it_interval)
-                    || copy_to_user_timeval(arg3 + sizeof(struct target_timeval),
-                                            &ovalue.it_value))
-                    return -TARGET_EFAULT;
-            }
-        }
-        return ret;
-    case TARGET_NR_getitimer:
-        {
-            struct itimerval value;
-
-            ret = get_errno(getitimer(arg1, &value));
-            if (!is_error(ret) && arg2) {
-                if (copy_to_user_timeval(arg2,
-                                         &value.it_interval)
-                    || copy_to_user_timeval(arg2 + sizeof(struct target_timeval),
-                                            &value.it_value))
-                    return -TARGET_EFAULT;
-            }
-        }
-        return ret;
 #ifdef TARGET_NR_stat
     case TARGET_NR_stat:
         if (!(p = lock_user_string(arg1))) {
@@ -12881,6 +12881,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_futimesat
         SYSCALL(futimesat);
 #endif
+        SYSCALL(getitimer);
 #ifdef TARGET_NR_getpeername
         SYSCALL(getpeername);
 #endif
@@ -13026,6 +13027,7 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(sendto);
 #endif
         SYSCALL(sethostname);
+        SYSCALL(setitimer);
         SYSCALL(setpgid);
         SYSCALL(setpriority);
         SYSCALL(setrlimit);
@@ -13077,6 +13079,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef CONFIG_SYNCFS
         SYSCALL(syncfs);
 #endif
+        SYSCALL(syslog);
 #ifdef TARGET_NR_time
         SYSCALL(time);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 051/108] linux-user: Split out fstat, lstat, stat
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (49 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 050/108] linux-user: Split out getitimer, setitimer, syslog Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 052/108] linux-user: Unwrap TARGET_NR_syscall early Richard Henderson
                   ` (60 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 129 +++++++++++++++++++++++++++----------------
 1 file changed, 82 insertions(+), 47 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index c8fc7fc908..4f6c01092b 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7052,6 +7052,31 @@ static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
     return 0;
 }
 
+static abi_long host_to_target_stat(abi_ulong target_addr, struct stat *st)
+{
+    struct target_stat *target_st;
+
+    if (!lock_user_struct(VERIFY_WRITE, target_st, target_addr, 0)) {
+        return -TARGET_EFAULT;
+    }
+    memset(target_st, 0, sizeof(*target_st));
+    __put_user(st->st_dev, &target_st->st_dev);
+    __put_user(st->st_ino, &target_st->st_ino);
+    __put_user(st->st_mode, &target_st->st_mode);
+    __put_user(st->st_uid, &target_st->st_uid);
+    __put_user(st->st_gid, &target_st->st_gid);
+    __put_user(st->st_nlink, &target_st->st_nlink);
+    __put_user(st->st_rdev, &target_st->st_rdev);
+    __put_user(st->st_size, &target_st->st_size);
+    __put_user(st->st_blksize, &target_st->st_blksize);
+    __put_user(st->st_blocks, &target_st->st_blocks);
+    __put_user(st->st_atime, &target_st->target_st_atime);
+    __put_user(st->st_mtime, &target_st->target_st_mtime);
+    __put_user(st->st_ctime, &target_st->target_st_ctime);
+    unlock_user_struct(target_st, target_addr, 1);
+    return 0;
+}
+
 static inline abi_long host_to_target_stat64(void *cpu_env,
                                              abi_ulong target_addr,
                                              struct stat *host_st)
@@ -8100,6 +8125,18 @@ IMPL(fork)
 }
 #endif
 
+IMPL(fstat)
+{
+    struct stat st;
+    abi_long ret;
+
+    ret = get_errno(fstat(arg1, &st));
+    if (!is_error(ret) && host_to_target_stat(arg2, &st)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+
 IMPL(fstatfs)
 {
     struct statfs stfs;
@@ -8435,6 +8472,25 @@ IMPL(lseek)
     return get_errno(lseek(arg1, arg2, arg3));
 }
 
+#ifdef TARGET_NR_lstat
+IMPL(lstat)
+{
+    char *p = lock_user_string(arg1);
+    struct stat st;
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(lstat(path(p), &st));
+    unlock_user(p, arg1, 0);
+    if (!is_error(ret) && host_to_target_stat(arg2, &st)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_mkdir
 IMPL(mkdir)
 {
@@ -9781,6 +9837,25 @@ IMPL(ssetmask)
 }
 #endif
 
+#ifdef TARGET_NR_stat
+IMPL(stat)
+{
+    char *p = lock_user_string(arg1);
+    struct stat st;
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(stat(path(p), &st));
+    unlock_user(p, arg1, 0);
+    if (!is_error(ret) && host_to_target_stat(arg2, &st)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+#endif
+
 IMPL(statfs)
 {
     char *p = lock_user_string(arg1);
@@ -10153,53 +10228,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_stat
-    case TARGET_NR_stat:
-        if (!(p = lock_user_string(arg1))) {
-            return -TARGET_EFAULT;
-        }
-        ret = get_errno(stat(path(p), &st));
-        unlock_user(p, arg1, 0);
-        goto do_stat;
-#endif
-#ifdef TARGET_NR_lstat
-    case TARGET_NR_lstat:
-        if (!(p = lock_user_string(arg1))) {
-            return -TARGET_EFAULT;
-        }
-        ret = get_errno(lstat(path(p), &st));
-        unlock_user(p, arg1, 0);
-        goto do_stat;
-#endif
-    case TARGET_NR_fstat:
-        {
-            ret = get_errno(fstat(arg1, &st));
-#if defined(TARGET_NR_stat) || defined(TARGET_NR_lstat)
-        do_stat:
-#endif
-            if (!is_error(ret)) {
-                struct target_stat *target_st;
-
-                if (!lock_user_struct(VERIFY_WRITE, target_st, arg2, 0))
-                    return -TARGET_EFAULT;
-                memset(target_st, 0, sizeof(*target_st));
-                __put_user(st.st_dev, &target_st->st_dev);
-                __put_user(st.st_ino, &target_st->st_ino);
-                __put_user(st.st_mode, &target_st->st_mode);
-                __put_user(st.st_uid, &target_st->st_uid);
-                __put_user(st.st_gid, &target_st->st_gid);
-                __put_user(st.st_nlink, &target_st->st_nlink);
-                __put_user(st.st_rdev, &target_st->st_rdev);
-                __put_user(st.st_size, &target_st->st_size);
-                __put_user(st.st_blksize, &target_st->st_blksize);
-                __put_user(st.st_blocks, &target_st->st_blocks);
-                __put_user(st.st_atime, &target_st->target_st_atime);
-                __put_user(st.st_mtime, &target_st->target_st_mtime);
-                __put_user(st.st_ctime, &target_st->target_st_ctime);
-                unlock_user_struct(target_st, arg2, 1);
-            }
-        }
-        return ret;
     case TARGET_NR_vhangup:
         return get_errno(vhangup());
 #ifdef TARGET_NR_syscall
@@ -12873,6 +12901,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_fork
         SYSCALL(fork);
 #endif
+        SYSCALL(fstat);
         SYSCALL(fstatfs);
 #ifdef TARGET_NR_fstatfs64
         SYSCALL(fstatfs64);
@@ -12918,6 +12947,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(listen);
 #endif
         SYSCALL(lseek);
+#ifdef TARGET_NR_lstat
+        SYSCALL(lstat);
+#endif
 #ifdef TARGET_NR_mkdir
         SYSCALL(mkdir);
 #endif
@@ -13062,6 +13094,9 @@ static impl_fn *syscall_table(unsigned num)
 #endif
 #ifdef TARGET_NR_ssetmask
         SYSCALL(ssetmask);
+#endif
+#ifdef TARGET_NR_stat
+        SYSCALL(stat);
 #endif
         SYSCALL(statfs);
 #ifdef TARGET_NR_statfs64
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 052/108] linux-user: Unwrap TARGET_NR_syscall early
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (50 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 051/108] linux-user: Split out fstat, lstat, stat Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 053/108] linux-user: Split out swapoff, sysinfo, vhangup, wait4 Richard Henderson
                   ` (59 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Unwrapping early produces a much nicer log output.
Disallow recursive syscall, as per ARM and MIPS.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 31 ++++++++++++++++++++++++++-----
 1 file changed, 26 insertions(+), 5 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 4f6c01092b..87374014b1 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -10230,11 +10230,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     switch(num) {
     case TARGET_NR_vhangup:
         return get_errno(vhangup());
-#ifdef TARGET_NR_syscall
-    case TARGET_NR_syscall:
-        return do_syscall(cpu_env, arg1 & 0xffff, arg2, arg3, arg4, arg5,
-                          arg6, arg7, arg8, 0);
-#endif
     case TARGET_NR_wait4:
         {
             int status;
@@ -13171,6 +13166,32 @@ abi_long do_syscall(void *cpu_env, unsigned num, abi_long arg1,
         }
     }
 #endif
+#ifdef TARGET_NR_syscall
+    /* For the benefit of strace, unwrap NR_syscall now.  */
+    if (num == TARGET_NR_syscall) {
+        num = arg1 & 0xffff;
+        if (num == TARGET_NR_syscall) {
+            /* Do not allow recursion.  */
+            ret = -TARGET_ENOSYS;
+            trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4,
+                                     arg5, arg6, arg7, arg8);
+            if (unlikely(do_strace)) {
+                print_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6);
+                print_syscall_ret(num, ret);
+            }
+            trace_guest_user_syscall_ret(cpu, num, ret);
+            return ret;
+        }
+        arg1 = arg2;
+        arg2 = arg3;
+        arg3 = arg4;
+        arg4 = arg5;
+        arg5 = arg6;
+        arg6 = arg7;
+        arg7 = arg8;
+        arg8 = 0;
+    }
+#endif
 
     trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4,
                              arg5, arg6, arg7, arg8);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 053/108] linux-user: Split out swapoff, sysinfo, vhangup, wait4
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (51 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 052/108] linux-user: Unwrap TARGET_NR_syscall early Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 054/108] linux-user: Split out ipc Richard Henderson
                   ` (58 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define swapoff; remove the ifdef.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 140 +++++++++++++++++++++++--------------------
 1 file changed, 76 insertions(+), 64 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 87374014b1..a0fbbbbb4a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9903,6 +9903,19 @@ IMPL(stime)
 }
 #endif
 
+IMPL(swapoff)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(swapoff(p));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+
 IMPL(swapon)
 {
     char *p = lock_user_string(arg1);
@@ -9959,6 +9972,36 @@ IMPL(syncfs)
 }
 #endif
 
+IMPL(sysinfo)
+{
+    struct sysinfo value;
+    abi_long ret = get_errno(sysinfo(&value));
+
+    if (!is_error(ret) && arg1) {
+        struct target_sysinfo *target_value;
+
+        if (!lock_user_struct(VERIFY_WRITE, target_value, arg1, 0)) {
+            return -TARGET_EFAULT;
+        }
+        __put_user(value.uptime, &target_value->uptime);
+        __put_user(value.loads[0], &target_value->loads[0]);
+        __put_user(value.loads[1], &target_value->loads[1]);
+        __put_user(value.loads[2], &target_value->loads[2]);
+        __put_user(value.totalram, &target_value->totalram);
+        __put_user(value.freeram, &target_value->freeram);
+        __put_user(value.sharedram, &target_value->sharedram);
+        __put_user(value.bufferram, &target_value->bufferram);
+        __put_user(value.totalswap, &target_value->totalswap);
+        __put_user(value.freeswap, &target_value->freeswap);
+        __put_user(value.procs, &target_value->procs);
+        __put_user(value.totalhigh, &target_value->totalhigh);
+        __put_user(value.freehigh, &target_value->freehigh);
+        __put_user(value.mem_unit, &target_value->mem_unit);
+        unlock_user_struct(target_value, arg1, 1);
+    }
+    return ret;
+}
+
 IMPL(syslog)
 {
     abi_long ret;
@@ -10156,6 +10199,35 @@ IMPL(utimes)
 }
 #endif
 
+IMPL(vhangup)
+{
+    return get_errno(vhangup());
+}
+
+IMPL(wait4)
+{
+    int status;
+    struct rusage rusage;
+    abi_long ret;
+
+    ret = get_errno(safe_wait4(arg1, &status, arg3, &rusage));
+    if (!is_error(ret)) {
+        if (ret && arg2) {
+            status = host_to_target_waitstatus(status);
+            if (put_user_s32(status, arg2)) {
+                return -TARGET_EFAULT;
+            }
+        }
+        if (arg4) {
+            abi_long err = host_to_target_rusage(arg4, &rusage);
+            if (err) {
+                return err;
+            }
+        }
+    }
+    return ret;
+}
+
 IMPL(waitid)
 {
     siginfo_t info;
@@ -10228,70 +10300,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_vhangup:
-        return get_errno(vhangup());
-    case TARGET_NR_wait4:
-        {
-            int status;
-            abi_long status_ptr = arg2;
-            struct rusage rusage, *rusage_ptr;
-            abi_ulong target_rusage = arg4;
-            abi_long rusage_err;
-            if (target_rusage)
-                rusage_ptr = &rusage;
-            else
-                rusage_ptr = NULL;
-            ret = get_errno(safe_wait4(arg1, &status, arg3, rusage_ptr));
-            if (!is_error(ret)) {
-                if (status_ptr && ret) {
-                    status = host_to_target_waitstatus(status);
-                    if (put_user_s32(status, status_ptr))
-                        return -TARGET_EFAULT;
-                }
-                if (target_rusage) {
-                    rusage_err = host_to_target_rusage(target_rusage, &rusage);
-                    if (rusage_err) {
-                        ret = rusage_err;
-                    }
-                }
-            }
-        }
-        return ret;
-#ifdef TARGET_NR_swapoff
-    case TARGET_NR_swapoff:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(swapoff(p));
-        unlock_user(p, arg1, 0);
-        return ret;
-#endif
-    case TARGET_NR_sysinfo:
-        {
-            struct target_sysinfo *target_value;
-            struct sysinfo value;
-            ret = get_errno(sysinfo(&value));
-            if (!is_error(ret) && arg1)
-            {
-                if (!lock_user_struct(VERIFY_WRITE, target_value, arg1, 0))
-                    return -TARGET_EFAULT;
-                __put_user(value.uptime, &target_value->uptime);
-                __put_user(value.loads[0], &target_value->loads[0]);
-                __put_user(value.loads[1], &target_value->loads[1]);
-                __put_user(value.loads[2], &target_value->loads[2]);
-                __put_user(value.totalram, &target_value->totalram);
-                __put_user(value.freeram, &target_value->freeram);
-                __put_user(value.sharedram, &target_value->sharedram);
-                __put_user(value.bufferram, &target_value->bufferram);
-                __put_user(value.totalswap, &target_value->totalswap);
-                __put_user(value.freeswap, &target_value->freeswap);
-                __put_user(value.procs, &target_value->procs);
-                __put_user(value.totalhigh, &target_value->totalhigh);
-                __put_user(value.freehigh, &target_value->freehigh);
-                __put_user(value.mem_unit, &target_value->mem_unit);
-                unlock_user_struct(target_value, arg1, 1);
-            }
-        }
-        return ret;
 #ifdef TARGET_NR_ipc
     case TARGET_NR_ipc:
         return do_ipc(cpu_env, arg1, arg2, arg3, arg4, arg5, arg6);
@@ -13100,6 +13108,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_stime
         SYSCALL(stime);
 #endif
+        SYSCALL(swapoff);
         SYSCALL(swapon);
 #ifdef TARGET_NR_symlink
         SYSCALL(symlink);
@@ -13109,6 +13118,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef CONFIG_SYNCFS
         SYSCALL(syncfs);
 #endif
+        SYSCALL(sysinfo);
         SYSCALL(syslog);
 #ifdef TARGET_NR_time
         SYSCALL(time);
@@ -13130,6 +13140,8 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_utimes
         SYSCALL(utimes);
 #endif
+        SYSCALL(vhangup);
+        SYSCALL(wait4);
         SYSCALL(waitid);
 #ifdef TARGET_NR_waitpid
         SYSCALL(waitpid);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 054/108] linux-user: Split out ipc
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (52 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 053/108] linux-user: Split out swapoff, sysinfo, vhangup, wait4 Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 055/108] linux-user: Split out ipc syscalls Richard Henderson
                   ` (57 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

At the same time, merge do_ipc into the new function.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 193 ++++++++++++++++++-------------------------
 1 file changed, 82 insertions(+), 111 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index a0fbbbbb4a..6ac7532ea6 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4962,113 +4962,6 @@ static inline abi_long do_shmdt(abi_ulong shmaddr)
     return rv;
 }
 
-#ifdef TARGET_NR_ipc
-/* ??? This only works with linear mappings.  */
-/* do_ipc() must return target values and target errnos. */
-static abi_long do_ipc(CPUArchState *cpu_env,
-                       unsigned int call, abi_long first,
-                       abi_long second, abi_long third,
-                       abi_long ptr, abi_long fifth)
-{
-    int version;
-    abi_long ret = 0;
-
-    version = call >> 16;
-    call &= 0xffff;
-
-    switch (call) {
-    case IPCOP_semop:
-        ret = do_semop(first, ptr, second);
-        break;
-
-    case IPCOP_semget:
-        ret = get_errno(semget(first, second, third));
-        break;
-
-    case IPCOP_semctl: {
-        /* The semun argument to semctl is passed by value, so dereference the
-         * ptr argument. */
-        abi_ulong atptr;
-        get_user_ual(atptr, ptr);
-        ret = do_semctl(first, second, third, atptr);
-        break;
-    }
-
-    case IPCOP_msgget:
-        ret = get_errno(msgget(first, second));
-        break;
-
-    case IPCOP_msgsnd:
-        ret = do_msgsnd(first, ptr, second, third);
-        break;
-
-    case IPCOP_msgctl:
-        ret = do_msgctl(first, second, ptr);
-        break;
-
-    case IPCOP_msgrcv:
-        switch (version) {
-        case 0:
-            {
-                struct target_ipc_kludge {
-                    abi_long msgp;
-                    abi_long msgtyp;
-                } *tmp;
-
-                if (!lock_user_struct(VERIFY_READ, tmp, ptr, 1)) {
-                    ret = -TARGET_EFAULT;
-                    break;
-                }
-
-                ret = do_msgrcv(first, tswapal(tmp->msgp), second, tswapal(tmp->msgtyp), third);
-
-                unlock_user_struct(tmp, ptr, 0);
-                break;
-            }
-        default:
-            ret = do_msgrcv(first, ptr, second, fifth, third);
-        }
-        break;
-
-    case IPCOP_shmat:
-        switch (version) {
-        default:
-        {
-            abi_ulong raddr;
-            raddr = do_shmat(cpu_env, first, ptr, second);
-            if (is_error(raddr))
-                return get_errno(raddr);
-            if (put_user_ual(raddr, third))
-                return -TARGET_EFAULT;
-            break;
-        }
-        case 1:
-            ret = -TARGET_EINVAL;
-            break;
-        }
-	break;
-    case IPCOP_shmdt:
-        ret = do_shmdt(ptr);
-	break;
-
-    case IPCOP_shmget:
-	/* IPC_* flag values are the same on all linux platforms */
-	ret = get_errno(shmget(first, second, third));
-	break;
-
-	/* IPC_* and SHM_* command values are the same on all linux platforms */
-    case IPCOP_shmctl:
-        ret = do_shmctl(first, second, ptr);
-        break;
-    default:
-	gemu_log("Unsupported ipc call: %d (version %d)\n", call, version);
-	ret = -TARGET_ENOSYS;
-	break;
-    }
-    return ret;
-}
-#endif
-
 /* kernel structure types definitions */
 
 #define STRUCT(name, ...) STRUCT_ ## name,
@@ -8425,6 +8318,85 @@ IMPL(ioctl)
     return ret;
 }
 
+#ifdef TARGET_NR_ipc
+IMPL(ipc)
+{
+    unsigned int call = arg1;
+    abi_long first = arg2;
+    abi_long second = arg3;
+    abi_long third = arg4;
+    abi_long ptr = arg5;
+    abi_long fifth = arg6;
+    int version;
+    abi_long ret;
+    abi_ulong atptr;
+
+    version = call >> 16;
+    call &= 0xffff;
+
+    /* IPC_* and SHM_* command values are the same on all linux platforms */
+    switch (call) {
+    case IPCOP_semop:
+        return do_semop(first, ptr, second);
+    case IPCOP_semget:
+        return get_errno(semget(first, second, third));
+    case IPCOP_semctl:
+        /* The semun argument to semctl is passed by value,
+         * so dereference the ptr argument.
+         */
+        get_user_ual(atptr, ptr);
+        return do_semctl(first, second, third, atptr);
+
+    case IPCOP_msgget:
+        return get_errno(msgget(first, second));
+    case IPCOP_msgsnd:
+        return do_msgsnd(first, ptr, second, third);
+    case IPCOP_msgctl:
+        return do_msgctl(first, second, ptr);
+    case IPCOP_msgrcv:
+        if (version == 0) {
+            struct target_ipc_kludge {
+                abi_long msgp;
+                abi_long msgtyp;
+            } *tmp;
+
+            if (!lock_user_struct(VERIFY_READ, tmp, ptr, 1)) {
+                return -TARGET_EFAULT;
+            }
+
+            ret = do_msgrcv(first, tswapal(tmp->msgp), second,
+                            tswapal(tmp->msgtyp), third);
+            unlock_user_struct(tmp, ptr, 0);
+            return ret;
+        }
+        return do_msgrcv(first, ptr, second, fifth, third);
+
+    case IPCOP_shmat:
+        if (version == 1) {
+            return -TARGET_EINVAL;
+        }
+        ret = do_shmat(cpu_env, first, ptr, second);
+        if (is_error(ret)) {
+            return get_errno(ret);
+        }
+        if (put_user_ual(ret, third)) {
+            return -TARGET_EFAULT;
+        }
+        return ret;
+    case IPCOP_shmdt:
+        return do_shmdt(ptr);
+    case IPCOP_shmget:
+        return get_errno(shmget(first, second, third));
+    case IPCOP_shmctl:
+        return do_shmctl(first, second, ptr);
+
+    default:
+        gemu_log("Unsupported ipc call: %d (version %d)\n", call, version);
+        return -TARGET_ENOSYS;
+    }
+}
+#endif
+
 IMPL(kill)
 {
     return get_errno(safe_kill(arg1, target_to_host_signal(arg2)));
@@ -10300,10 +10272,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_ipc
-    case TARGET_NR_ipc:
-        return do_ipc(cpu_env, arg1, arg2, arg3, arg4, arg5, arg6);
-#endif
 #ifdef TARGET_NR_semget
     case TARGET_NR_semget:
         return get_errno(semget(arg1, arg2, arg3));
@@ -12941,6 +12909,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(getxpid);
 #endif
         SYSCALL(ioctl);
+#ifdef TARGET_NR_ipc
+        SYSCALL(ipc);
+#endif
         SYSCALL(kill);
 #ifdef TARGET_NR_link
         SYSCALL(link);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 055/108] linux-user: Split out ipc syscalls
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (53 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 054/108] linux-user: Split out ipc Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 056/108] linux-user: Split out clone, exit_group, fsync Richard Henderson
                   ` (56 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

This is msgctl, msgget, msgrcv, msgsnd, shmat, shmctl,
shmdt, shmget, semctl, semget, semop.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 154 ++++++++++++++++++++++++++++++-------------
 1 file changed, 110 insertions(+), 44 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 6ac7532ea6..1c3a4590fb 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8636,6 +8636,34 @@ IMPL(mremap)
     return get_errno(target_mremap(arg1, arg2, arg3, arg4, arg5));
 }
 
+#ifdef TARGET_NR_msgctl
+IMPL(msgctl)
+{
+    return do_msgctl(arg1, arg2, arg3);
+}
+#endif
+
+#ifdef TARGET_NR_msgget
+IMPL(msgget)
+{
+    return get_errno(msgget(arg1, arg2));
+}
+#endif
+
+#ifdef TARGET_NR_msgrcv
+IMPL(msgrcv)
+{
+    return do_msgrcv(arg1, arg2, arg3, arg4, arg5);
+}
+#endif
+
+#ifdef TARGET_NR_msgsnd
+IMPL(msgsnd)
+{
+    return do_msgsnd(arg1, arg2, arg3, arg4);
+}
+#endif
+
 IMPL(msync)
 {
     return get_errno(msync(g2h(arg1), arg2, arg3));
@@ -9340,6 +9368,34 @@ IMPL(sgetmask)
 }
 #endif
 
+#ifdef TARGET_NR_shmat
+IMPL(shmat)
+{
+    return do_shmat(cpu_env, arg1, arg2, arg3);
+}
+#endif
+
+#ifdef TARGET_NR_shmctl
+IMPL(shmctl)
+{
+    return do_shmctl(arg1, arg2, arg3);
+}
+#endif
+
+#ifdef TARGET_NR_shmdt
+IMPL(shmdt)
+{
+    return do_shmdt(arg1);
+}
+#endif
+
+#ifdef TARGET_NR_shmget
+IMPL(shmget)
+{
+    return get_errno(shmget(arg1, arg2, arg3));
+}
+#endif
+
 #ifdef TARGET_NR_shutdown
 IMPL(shutdown)
 {
@@ -9358,6 +9414,27 @@ IMPL(select)
 }
 #endif
 
+#ifdef TARGET_NR_semctl
+IMPL(semctl)
+{
+    return do_semctl(arg1, arg2, arg3, arg4);
+}
+#endif
+
+#ifdef TARGET_NR_semget
+IMPL(semget)
+{
+    return get_errno(semget(arg1, arg2, arg3));
+}
+#endif
+
+#ifdef TARGET_NR_semop
+IMPL(semop)
+{
+    return do_semop(arg1, arg2, arg3);
+}
+#endif
+
 #ifdef TARGET_NR_send
 IMPL(send)
 {
@@ -10272,50 +10349,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_semget
-    case TARGET_NR_semget:
-        return get_errno(semget(arg1, arg2, arg3));
-#endif
-#ifdef TARGET_NR_semop
-    case TARGET_NR_semop:
-        return do_semop(arg1, arg2, arg3);
-#endif
-#ifdef TARGET_NR_semctl
-    case TARGET_NR_semctl:
-        return do_semctl(arg1, arg2, arg3, arg4);
-#endif
-#ifdef TARGET_NR_msgctl
-    case TARGET_NR_msgctl:
-        return do_msgctl(arg1, arg2, arg3);
-#endif
-#ifdef TARGET_NR_msgget
-    case TARGET_NR_msgget:
-        return get_errno(msgget(arg1, arg2));
-#endif
-#ifdef TARGET_NR_msgrcv
-    case TARGET_NR_msgrcv:
-        return do_msgrcv(arg1, arg2, arg3, arg4, arg5);
-#endif
-#ifdef TARGET_NR_msgsnd
-    case TARGET_NR_msgsnd:
-        return do_msgsnd(arg1, arg2, arg3, arg4);
-#endif
-#ifdef TARGET_NR_shmget
-    case TARGET_NR_shmget:
-        return get_errno(shmget(arg1, arg2, arg3));
-#endif
-#ifdef TARGET_NR_shmctl
-    case TARGET_NR_shmctl:
-        return do_shmctl(arg1, arg2, arg3);
-#endif
-#ifdef TARGET_NR_shmat
-    case TARGET_NR_shmat:
-        return do_shmat(cpu_env, arg1, arg2, arg3);
-#endif
-#ifdef TARGET_NR_shmdt
-    case TARGET_NR_shmdt:
-        return do_shmdt(arg1);
-#endif
     case TARGET_NR_fsync:
         return get_errno(fsync(arg1));
     case TARGET_NR_clone:
@@ -12943,6 +12976,18 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(mount);
         SYSCALL(mprotect);
         SYSCALL(mremap);
+#ifdef TARGET_NR_msgctl
+        SYSCALL(msgctl);
+#endif
+#ifdef TARGET_NR_msgget
+        SYSCALL(msgget);
+#endif
+#ifdef TARGET_NR_msgrcv
+        SYSCALL(msgrcv);
+#endif
+#ifdef TARGET_NR_msgsnd
+        SYSCALL(msgsnd);
+#endif
         SYSCALL(msync);
         SYSCALL(munlock);
         SYSCALL(munlockall);
@@ -13010,6 +13055,18 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_sgetmask
         SYSCALL(sgetmask);
 #endif
+#ifdef TARGET_NR_shmat
+        SYSCALL(shmat);
+#endif
+#ifdef TARGET_NR_shmctl
+        SYSCALL(shmctl);
+#endif
+#ifdef TARGET_NR_shmdt
+        SYSCALL(shmdt);
+#endif
+#ifdef TARGET_NR_shmget
+        SYSCALL(shmget);
+#endif
 #ifdef TARGET_NR_shutdown
         SYSCALL(shutdown);
 #endif
@@ -13020,6 +13077,15 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(select);
 # endif
 #endif
+#ifdef TARGET_NR_semctl
+        SYSCALL(semctl);
+#endif
+#ifdef TARGET_NR_semget
+        SYSCALL(semget);
+#endif
+#ifdef TARGET_NR_semop
+        SYSCALL(semop);
+#endif
 #ifdef TARGET_NR_send
         SYSCALL(send);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 056/108] linux-user: Split out clone, exit_group, fsync
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (54 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 055/108] linux-user: Split out ipc syscalls Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 057/108] linux-user: Split out modify_ldt, setdomainname, uname Richard Henderson
                   ` (55 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 70 ++++++++++++++++++++++++++------------------
 1 file changed, 42 insertions(+), 28 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1c3a4590fb..41facf4b44 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7753,6 +7753,25 @@ IMPL(chroot)
     return ret;
 }
 
+IMPL(clone)
+{
+    /* Linux manages to have three different orderings for its
+     * arguments to clone(); the BACKWARDS and BACKWARDS2 defines
+     * match the kernel's CONFIG_CLONE_* settings.
+     * Microblaze is further special in that it uses a sixth
+     * implicit argument to clone for the TLS pointer.
+     */
+#if defined(TARGET_MICROBLAZE)
+    return get_errno(do_fork(cpu_env, arg1, arg2, arg4, arg6, arg5));
+#elif defined(TARGET_CLONE_BACKWARDS)
+    return get_errno(do_fork(cpu_env, arg1, arg2, arg3, arg4, arg5));
+#elif defined(TARGET_CLONE_BACKWARDS2)
+    return get_errno(do_fork(cpu_env, arg2, arg1, arg3, arg5, arg4));
+#else
+    return get_errno(do_fork(cpu_env, arg1, arg2, arg3, arg5, arg4));
+#endif
+}
+
 IMPL(close)
 {
     fd_trans_unregister(arg1);
@@ -7973,6 +7992,17 @@ IMPL(exit)
     g_assert_not_reached();
 }
 
+#ifdef __NR_exit_group
+IMPL(exit_group)
+{
+# ifdef TARGET_GPROF
+    _mcleanup();
+# endif
+    gdb_exit(cpu_env, arg1);
+    return get_errno(exit_group(arg1));
+}
+#endif
+
 IMPL(faccessat)
 {
     char *p = lock_user_string(arg2);
@@ -8056,6 +8086,11 @@ IMPL(fstatfs64)
 }
 #endif
 
+IMPL(fsync)
+{
+    return get_errno(fsync(arg1));
+}
+
 IMPL(ftruncate)
 {
     return get_errno(ftruncate(arg1, arg2));
@@ -10349,34 +10384,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_fsync:
-        return get_errno(fsync(arg1));
-    case TARGET_NR_clone:
-        /* Linux manages to have three different orderings for its
-         * arguments to clone(); the BACKWARDS and BACKWARDS2 defines
-         * match the kernel's CONFIG_CLONE_* settings.
-         * Microblaze is further special in that it uses a sixth
-         * implicit argument to clone for the TLS pointer.
-         */
-#if defined(TARGET_MICROBLAZE)
-        ret = get_errno(do_fork(cpu_env, arg1, arg2, arg4, arg6, arg5));
-#elif defined(TARGET_CLONE_BACKWARDS)
-        ret = get_errno(do_fork(cpu_env, arg1, arg2, arg3, arg4, arg5));
-#elif defined(TARGET_CLONE_BACKWARDS2)
-        ret = get_errno(do_fork(cpu_env, arg2, arg1, arg3, arg5, arg4));
-#else
-        ret = get_errno(do_fork(cpu_env, arg1, arg2, arg3, arg5, arg4));
-#endif
-        return ret;
-#ifdef __NR_exit_group
-        /* new thread calls */
-    case TARGET_NR_exit_group:
-#ifdef TARGET_GPROF
-        _mcleanup();
-#endif
-        gdb_exit(cpu_env, arg1);
-        return get_errno(exit_group(arg1));
-#endif
     case TARGET_NR_setdomainname:
         if (!(p = lock_user_string(arg1)))
             return -TARGET_EFAULT;
@@ -12877,6 +12884,7 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(bind);
 #endif
         SYSCALL(brk);
+        SYSCALL(clone);
         SYSCALL(close);
         SYSCALL(chdir);
         SYSCALL(chroot);
@@ -12896,6 +12904,11 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(dup3);
         SYSCALL(execve);
         SYSCALL(exit);
+#ifdef __NR_exit_group
+        SYSCALL(exit_group);
+#else
+        SYSCALL_WITH(exit_group, enosys);
+#endif
         SYSCALL(faccessat);
         SYSCALL(fchmod);
         SYSCALL(fchmodat);
@@ -12910,6 +12923,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_fstatfs64
         SYSCALL(fstatfs64);
 #endif
+        SYSCALL(fsync);
         SYSCALL(ftruncate);
 #ifdef TARGET_NR_futimesat
         SYSCALL(futimesat);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 057/108] linux-user: Split out modify_ldt, setdomainname, uname
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (55 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 056/108] linux-user: Split out clone, exit_group, fsync Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 058/108] linux-user: Split out adjtimex, clock_adjtime, vm86 Richard Henderson
                   ` (54 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

At the same time, merge do_modify_ldt into the new function.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 123 +++++++++++++++++++++++--------------------
 1 file changed, 66 insertions(+), 57 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 41facf4b44..4967b84f21 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5755,7 +5755,6 @@ static bitmask_transtbl mmap_flags_tbl[] = {
 };
 
 #if defined(TARGET_I386)
-
 /* NOTE: there is really one LDT for all the threads */
 static uint8_t *ldt_table;
 
@@ -5870,29 +5869,6 @@ install:
     return 0;
 }
 
-/* specific and weird i386 syscalls */
-static abi_long do_modify_ldt(CPUX86State *env, int func, abi_ulong ptr,
-                              unsigned long bytecount)
-{
-    abi_long ret;
-
-    switch (func) {
-    case 0:
-        ret = read_ldt(ptr, bytecount);
-        break;
-    case 1:
-        ret = write_ldt(env, ptr, bytecount, 1);
-        break;
-    case 0x11:
-        ret = write_ldt(env, ptr, bytecount, 0);
-        break;
-    default:
-        ret = -TARGET_ENOSYS;
-        break;
-    }
-    return ret;
-}
-
 #if defined(TARGET_I386) && defined(TARGET_ABI32)
 abi_long do_set_thread_area(CPUX86State *env, abi_ulong ptr)
 {
@@ -8614,6 +8590,28 @@ IMPL(mmap2)
 }
 #endif
 
+#ifdef TARGET_I386
+/* ??? Other TARGET_NR_modify_ldt should be deleted.  */
+IMPL(modify_ldt)
+{
+    CPUX86State *env = cpu_env;
+    int func = arg1;
+    abi_ulong ptr = arg2;
+    abi_ulong bytecount = arg3;
+
+    switch (func) {
+    case 0:
+        return read_ldt(ptr, bytecount);
+    case 1:
+        return write_ldt(env, ptr, bytecount, 1);
+    case 0x11:
+        return write_ldt(env, ptr, bytecount, 0);
+    default:
+        return -TARGET_ENOSYS;
+    }
+}
+#endif
+
 IMPL(mount)
 {
     char *p1 = NULL, *p2, *p3 = NULL;
@@ -9498,6 +9496,19 @@ IMPL(sendto)
 }
 #endif
 
+IMPL(setdomainname)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(setdomainname(p, arg2));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+
 IMPL(sethostname)
 {
     char *p = lock_user_string(arg1);
@@ -10206,6 +10217,31 @@ IMPL(umount2)
     return ret;
 }
 
+IMPL(uname)
+{
+    struct new_utsname *buf;
+    abi_long ret;
+
+    if (!lock_user_struct(VERIFY_WRITE, buf, arg1, 0)) {
+        return -TARGET_EFAULT;
+    }
+    /* No need to transcode because we use the linux syscall.  */
+    ret = get_errno(sys_uname(buf));
+    if (!is_error(ret)) {
+        /* Overwrite the native machine name with whatever is being
+           emulated. */
+        g_strlcpy(buf->machine, cpu_to_uname_machine(cpu_env),
+                  sizeof(buf->machine));
+        /* Allow the user to override the reported release.  */
+        if (qemu_uname_release && *qemu_uname_release) {
+            g_strlcpy(buf->release, qemu_uname_release,
+                      sizeof(buf->release));
+        }
+    }
+    unlock_user_struct(buf, arg1, 1);
+    return ret;
+}
+
 #ifdef TARGET_NR_unlink
 IMPL(unlink)
 {
@@ -10384,41 +10420,9 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_setdomainname:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(setdomainname(p, arg2));
-        unlock_user(p, arg1, 0);
-        return ret;
-    case TARGET_NR_uname:
-        /* no need to transcode because we use the linux syscall */
-        {
-            struct new_utsname * buf;
-
-            if (!lock_user_struct(VERIFY_WRITE, buf, arg1, 0))
-                return -TARGET_EFAULT;
-            ret = get_errno(sys_uname(buf));
-            if (!is_error(ret)) {
-                /* Overwrite the native machine name with whatever is being
-                   emulated. */
-                g_strlcpy(buf->machine, cpu_to_uname_machine(cpu_env),
-                          sizeof(buf->machine));
-                /* Allow the user to override the reported release.  */
-                if (qemu_uname_release && *qemu_uname_release) {
-                    g_strlcpy(buf->release, qemu_uname_release,
-                              sizeof(buf->release));
-                }
-            }
-            unlock_user_struct(buf, arg1, 1);
-        }
-        return ret;
-#ifdef TARGET_I386
-    case TARGET_NR_modify_ldt:
-        return do_modify_ldt(cpu_env, arg1, arg2, arg3);
-#if !defined(TARGET_X86_64)
+#if defined(TARGET_I386) && !defined(TARGET_X86_64)
     case TARGET_NR_vm86:
         return do_vm86(cpu_env, arg1, arg2);
-#endif
 #endif
     case TARGET_NR_adjtimex:
         {
@@ -12986,6 +12990,9 @@ static impl_fn *syscall_table(unsigned num)
 #endif
 #ifdef TARGET_NR_mmap2
         SYSCALL(mmap2);
+#endif
+#ifdef TARGET_I386
+        SYSCALL(modify_ldt);
 #endif
         SYSCALL(mount);
         SYSCALL(mprotect);
@@ -13112,6 +13119,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_sendto
         SYSCALL(sendto);
 #endif
+        SYSCALL(setdomainname);
         SYSCALL(sethostname);
         SYSCALL(setitimer);
         SYSCALL(setpgid);
@@ -13181,6 +13189,7 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(umount);
 #endif
         SYSCALL(umount2);
+        SYSCALL(uname);
 #ifdef TARGET_NR_unlink
         SYSCALL(unlink);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 058/108] linux-user: Split out adjtimex, clock_adjtime, vm86
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (56 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 057/108] linux-user: Split out modify_ldt, setdomainname, uname Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 059/108] linux-user: Split out fchdir, getpgid, llseek, personality Richard Henderson
                   ` (53 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define clock_adjtime; remove the ifdef.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 85 +++++++++++++++++++++++++-------------------
 1 file changed, 49 insertions(+), 36 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 4967b84f21..7ff05dd33c 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7669,6 +7669,23 @@ IMPL(acct)
     }
 }
 
+IMPL(adjtimex)
+{
+    struct timex host_buf;
+    abi_long ret;
+
+    if (target_to_host_timex(&host_buf, arg1) != 0) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(adjtimex(&host_buf));
+    if (!is_error(ret)) {
+        if (host_to_target_timex(arg1, &host_buf) != 0) {
+            return -TARGET_EFAULT;
+        }
+    }
+    return ret;
+}
+
 #ifdef TARGET_NR_alarm
 IMPL(alarm)
 {
@@ -7729,6 +7746,23 @@ IMPL(chroot)
     return ret;
 }
 
+#ifdef CONFIG_CLOCK_ADJTIME
+IMPL(clock_adjtime)
+{
+    struct timex htx;
+    abi_long ret;
+
+    if (target_to_host_timex(&htx, arg2)) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(clock_adjtime(arg1, &htx));
+    if (!is_error(ret) && host_to_target_timex(arg2, &htx)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+#endif
+
 IMPL(clone)
 {
     /* Linux manages to have three different orderings for its
@@ -10324,6 +10358,14 @@ IMPL(vhangup)
     return get_errno(vhangup());
 }
 
+#if defined(TARGET_I386) && !defined(TARGET_X86_64)
+/* ??? Other TARGET_NR_vm86 should be deleted.  */
+IMPL(vm86)
+{
+    return do_vm86(cpu_env, arg1, arg2);
+}
+#endif
+
 IMPL(wait4)
 {
     int status;
@@ -10420,42 +10462,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#if defined(TARGET_I386) && !defined(TARGET_X86_64)
-    case TARGET_NR_vm86:
-        return do_vm86(cpu_env, arg1, arg2);
-#endif
-    case TARGET_NR_adjtimex:
-        {
-            struct timex host_buf;
-
-            if (target_to_host_timex(&host_buf, arg1) != 0) {
-                return -TARGET_EFAULT;
-            }
-            ret = get_errno(adjtimex(&host_buf));
-            if (!is_error(ret)) {
-                if (host_to_target_timex(arg1, &host_buf) != 0) {
-                    return -TARGET_EFAULT;
-                }
-            }
-        }
-        return ret;
-#if defined(TARGET_NR_clock_adjtime) && defined(CONFIG_CLOCK_ADJTIME)
-    case TARGET_NR_clock_adjtime:
-        {
-            struct timex htx, *phtx = &htx;
-
-            if (target_to_host_timex(phtx, arg2) != 0) {
-                return -TARGET_EFAULT;
-            }
-            ret = get_errno(clock_adjtime(arg1, phtx));
-            if (!is_error(ret) && phtx) {
-                if (host_to_target_timex(arg2, phtx) != 0) {
-                    return -TARGET_EFAULT;
-                }
-            }
-        }
-        return ret;
-#endif
     case TARGET_NR_getpgid:
         return get_errno(getpgid(arg1));
     case TARGET_NR_fchdir:
@@ -12881,6 +12887,7 @@ static impl_fn *syscall_table(unsigned num)
 #endif
         SYSCALL(accept4);
         SYSCALL(acct);
+        SYSCALL(adjtimex);
 #ifdef TARGET_NR_alarm
         SYSCALL(alarm);
 #endif
@@ -12888,6 +12895,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(bind);
 #endif
         SYSCALL(brk);
+#ifdef CONFIG_CLOCK_ADJTIME
+        SYSCALL(clock_adjtime);
+#endif
         SYSCALL(clone);
         SYSCALL(close);
         SYSCALL(chdir);
@@ -13201,6 +13211,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(utimes);
 #endif
         SYSCALL(vhangup);
+#if defined(TARGET_I386) && !defined(TARGET_X86_64)
+        SYSCALL(vm86);
+#endif
         SYSCALL(wait4);
         SYSCALL(waitid);
 #ifdef TARGET_NR_waitpid
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 059/108] linux-user: Split out fchdir, getpgid, llseek, personality
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (57 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 058/108] linux-user: Split out adjtimex, clock_adjtime, vm86 Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 060/108] linux-user: Split out getdents, getdents64 Richard Henderson
                   ` (52 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Given that we use _LARGEFILE_SOURCE and _FILEOFFSET_BITS == 64, there
is no need to special-case llseek on the host side; always use lseek.
Define _llseek in terms of llseek, rather than the other way around.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 81 +++++++++++++++++++++++---------------------
 1 file changed, 42 insertions(+), 39 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 7ff05dd33c..f5f21658a8 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -240,15 +240,6 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,	\
 #define __NR_sys_inotify_add_watch __NR_inotify_add_watch
 #define __NR_sys_inotify_rm_watch __NR_inotify_rm_watch
 
-#if defined(__alpha__) || defined(__x86_64__) || defined(__s390x__)
-#define __NR__llseek __NR_lseek
-#endif
-
-/* Newer kernel ports have llseek() instead of _llseek() */
-#if defined(TARGET_NR_llseek) && !defined(TARGET_NR__llseek)
-#define TARGET_NR__llseek TARGET_NR_llseek
-#endif
-
 /* These definitions produce an ENOSYS from the host kernel.
  * Performing a bogus syscall is lazier than boilerplating
  * the replacement functions here in C.
@@ -280,10 +271,6 @@ _syscall3(int, sys_getdents, uint, fd, struct linux_dirent *, dirp, uint, count)
     (defined(TARGET_NR_getdents64) && defined(__NR_getdents64))
 _syscall3(int, sys_getdents64, uint, fd, struct linux_dirent64 *, dirp, uint, count);
 #endif
-#if defined(TARGET_NR__llseek) && defined(__NR_llseek)
-_syscall5(int, _llseek,  uint,  fd, ulong, hi, ulong, lo,
-          loff_t *, res, uint, wh);
-#endif
 _syscall3(int, sys_rt_sigqueueinfo, pid_t, pid, int, sig, siginfo_t *, uinfo)
 _syscall4(int, sys_rt_tgsigqueueinfo, pid_t, pid, pid_t, tid, int, sig,
           siginfo_t *, uinfo)
@@ -8026,6 +8013,11 @@ IMPL(faccessat)
     return ret;
 }
 
+IMPL(fchdir)
+{
+    return get_errno(fchdir(arg1));
+}
+
 IMPL(fchmod)
 {
     return get_errno(fchmod(arg1, arg2));
@@ -8150,6 +8142,11 @@ IMPL(getpeername)
 }
 #endif
 
+IMPL(getpgid)
+{
+    return get_errno(getpgid(arg1));
+}
+
 #ifdef TARGET_NR_getpgrp
 IMPL(getpgrp)
 {
@@ -8484,6 +8481,27 @@ IMPL(listen)
 }
 #endif
 
+/* Older kernel ports have _llseek() instead of llseek() */
+#if defined(TARGET_NR__llseek) && !defined(TARGET_NR_llseek)
+#define TARGET_NR_llseek TARGET_NR__llseek
+#endif
+
+#ifdef TARGET_NR_llseek
+IMPL(llseek)
+{
+    off_t res;
+
+    res = lseek(arg1, ((uint64_t)arg2 << 32) | (abi_ulong)arg3, arg5);
+    if (res == -1) {
+        return -host_to_target_errno(errno);
+    }
+    if (put_user_s64(res, arg4)) {
+        return -TARGET_EFAULT;
+    }
+    return 0;
+}
+#endif
+
 IMPL(lseek)
 {
     return get_errno(lseek(arg1, arg2, arg3));
@@ -8901,6 +8919,11 @@ IMPL(pause)
 }
 #endif
 
+IMPL(personality)
+{
+    return get_errno(personality(arg1));
+}
+
 #ifdef TARGET_NR_pipe
 IMPL(pipe)
 {
@@ -10462,32 +10485,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_getpgid:
-        return get_errno(getpgid(arg1));
-    case TARGET_NR_fchdir:
-        return get_errno(fchdir(arg1));
-    case TARGET_NR_personality:
-        return get_errno(personality(arg1));
-#ifdef TARGET_NR__llseek /* Not on alpha */
-    case TARGET_NR__llseek:
-        {
-            int64_t res;
-#if !defined(__NR_llseek)
-            res = lseek(arg1, ((uint64_t)arg2 << 32) | (abi_ulong)arg3, arg5);
-            if (res == -1) {
-                ret = get_errno(res);
-            } else {
-                ret = 0;
-            }
-#else
-            ret = get_errno(_llseek(arg1, arg2, arg3, &res, arg5));
-#endif
-            if ((ret == 0) && put_user_s64(res, arg4)) {
-                return -TARGET_EFAULT;
-            }
-        }
-        return ret;
-#endif
 #ifdef TARGET_NR_getdents
     case TARGET_NR_getdents:
 #ifdef EMULATE_GETDENTS_WITH_GETDENTS
@@ -12924,6 +12921,7 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL_WITH(exit_group, enosys);
 #endif
         SYSCALL(faccessat);
+        SYSCALL(fchdir);
         SYSCALL(fchmod);
         SYSCALL(fchmodat);
 #ifdef TARGET_NR_fcntl
@@ -12946,6 +12944,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_getpeername
         SYSCALL(getpeername);
 #endif
+        SYSCALL(getpgid);
 #ifdef TARGET_NR_getpgrp
         SYSCALL(getpgrp);
 #endif
@@ -12980,6 +12979,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(linkat);
 #ifdef TARGET_NR_listen
         SYSCALL(listen);
+#endif
+#ifdef TARGET_NR_llseek
+        SYSCALL(llseek);
 #endif
         SYSCALL(lseek);
 #ifdef TARGET_NR_lstat
@@ -13042,6 +13044,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_pause
         SYSCALL(pause);
 #endif
+        SYSCALL(personality);
 #ifdef TARGET_NR_pipe
         SYSCALL(pipe);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 060/108] linux-user: Split out getdents, getdents64
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (58 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 059/108] linux-user: Split out fchdir, getpgid, llseek, personality Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 061/108] linux-user: Split out poll, ppoll Richard Henderson
                   ` (51 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 329 ++++++++++++++++++++++---------------------
 1 file changed, 170 insertions(+), 159 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index f5f21658a8..600702ea3e 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8121,6 +8121,170 @@ IMPL(futimesat)
 }
 #endif
 
+#ifdef TARGET_NR_getdents
+IMPL(getdents)
+{
+    abi_long ret;
+# ifdef EMULATE_GETDENTS_WITH_GETDENTS
+#  if TARGET_ABI_BITS == 32 && HOST_LONG_BITS == 64
+    struct target_dirent *target_dirp;
+    struct linux_dirent *dirp;
+    abi_long count = arg3;
+
+    dirp = g_try_malloc(count);
+    if (!dirp) {
+        return -TARGET_ENOMEM;
+    }
+
+    ret = get_errno(sys_getdents(arg1, dirp, count));
+    if (!is_error(ret)) {
+        struct linux_dirent *de;
+        struct target_dirent *tde;
+        int len = ret;
+        int reclen, treclen;
+        int count1, tnamelen;
+
+        count1 = 0;
+        de = dirp;
+        target_dirp = lock_user(VERIFY_WRITE, arg2, count, 0);
+        if (!target_dirp) {
+            return -TARGET_EFAULT;
+        }
+        tde = target_dirp;
+        while (len > 0) {
+            reclen = de->d_reclen;
+            tnamelen = reclen - offsetof(struct linux_dirent, d_name);
+            assert(tnamelen >= 0);
+            treclen = tnamelen + offsetof(struct target_dirent, d_name);
+            assert(count1 + treclen <= count);
+            tde->d_reclen = tswap16(treclen);
+            tde->d_ino = tswapal(de->d_ino);
+            tde->d_off = tswapal(de->d_off);
+            memcpy(tde->d_name, de->d_name, tnamelen);
+            de = (struct linux_dirent *)((char *)de + reclen);
+            len -= reclen;
+            tde = (struct target_dirent *)((char *)tde + treclen);
+            count1 += treclen;
+        }
+        ret = count1;
+        unlock_user(target_dirp, arg2, ret);
+    }
+    g_free(dirp);
+#  else
+    struct linux_dirent *dirp;
+    abi_long count = arg3;
+
+    dirp = lock_user(VERIFY_WRITE, arg2, count, 0);
+    if (!dirp) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(sys_getdents(arg1, dirp, count));
+    if (!is_error(ret)) {
+        struct linux_dirent *de = dirp;
+        int len = ret;
+        int reclen;
+
+        while (len > 0) {
+            reclen = de->d_reclen;
+            if (reclen > len) {
+                break;
+            }
+            de->d_reclen = tswap16(reclen);
+            tswapls(&de->d_ino);
+            tswapls(&de->d_off);
+            de = (struct linux_dirent *)((char *)de + reclen);
+            len -= reclen;
+        }
+    }
+    unlock_user(dirp, arg2, ret);
+#  endif
+# else
+    /* Implement getdents in terms of getdents64 */
+    struct linux_dirent64 *dirp;
+    abi_long count = arg3;
+
+    dirp = lock_user(VERIFY_WRITE, arg2, count, 0);
+    if (!dirp) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(sys_getdents64(arg1, dirp, count));
+    if (!is_error(ret)) {
+        /* Convert the dirent64 structs to target dirent.  We do this
+         * in-place, since we can guarantee that a target_dirent is no
+         * larger than a dirent64; however this means we have to be
+         * careful to read everything before writing in the new format.
+         */
+        struct linux_dirent64 *de = dirp;
+        struct target_dirent *tde = (struct target_dirent *)dirp;
+        int len = ret;
+        int tlen = 0;
+
+        while (len > 0) {
+            int namelen, treclen;
+            int reclen = de->d_reclen;
+            uint64_t ino = de->d_ino;
+            int64_t off = de->d_off;
+            uint8_t type = de->d_type;
+
+            namelen = strlen(de->d_name);
+            treclen = offsetof(struct target_dirent, d_name) + namelen + 2;
+            treclen = QEMU_ALIGN_UP(treclen, sizeof(abi_long));
+
+            memmove(tde->d_name, de->d_name, namelen + 1);
+            tde->d_ino = tswapal(ino);
+            tde->d_off = tswapal(off);
+            tde->d_reclen = tswap16(treclen);
+            /* The target_dirent type is in what was formerly a padding
+             * byte at the end of the structure:
+             */
+            *(((char *)tde) + treclen - 1) = type;
+
+            de = (struct linux_dirent64 *)((char *)de + reclen);
+            tde = (struct target_dirent *)((char *)tde + treclen);
+            len -= reclen;
+            tlen += treclen;
+        }
+        ret = tlen;
+    }
+    unlock_user(dirp, arg2, ret);
+# endif
+    return ret;
+}
+#endif
+
+#if defined(TARGET_NR_getdents64) && defined(__NR_getdents64)
+IMPL(getdents64)
+{
+    struct linux_dirent64 *dirp;
+    abi_long count = arg3;
+    abi_long ret;
+
+    dirp = lock_user(VERIFY_WRITE, arg2, count, 0);
+    if (!dirp) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(sys_getdents64(arg1, dirp, count));
+    if (!is_error(ret)) {
+        struct linux_dirent64 *de = dirp;
+        int len = ret;
+
+        while (len > 0) {
+            int reclen = de->d_reclen;
+            if (reclen > len) {
+                break;
+            }
+            de->d_reclen = tswap16(reclen);
+            tswap64s((uint64_t *)&de->d_ino);
+            tswap64s((uint64_t *)&de->d_off);
+            de = (struct linux_dirent64 *)((char *)de + reclen);
+            len -= reclen;
+        }
+    }
+    unlock_user(dirp, arg2, ret);
+    return ret;
+}
+#endif /* TARGET_NR_getdents64 */
+
 IMPL(getitimer)
 {
     struct itimerval value;
@@ -10485,165 +10649,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_getdents
-    case TARGET_NR_getdents:
-#ifdef EMULATE_GETDENTS_WITH_GETDENTS
-#if TARGET_ABI_BITS == 32 && HOST_LONG_BITS == 64
-        {
-            struct target_dirent *target_dirp;
-            struct linux_dirent *dirp;
-            abi_long count = arg3;
-
-            dirp = g_try_malloc(count);
-            if (!dirp) {
-                return -TARGET_ENOMEM;
-            }
-
-            ret = get_errno(sys_getdents(arg1, dirp, count));
-            if (!is_error(ret)) {
-                struct linux_dirent *de;
-		struct target_dirent *tde;
-                int len = ret;
-                int reclen, treclen;
-		int count1, tnamelen;
-
-		count1 = 0;
-                de = dirp;
-                if (!(target_dirp = lock_user(VERIFY_WRITE, arg2, count, 0)))
-                    return -TARGET_EFAULT;
-		tde = target_dirp;
-                while (len > 0) {
-                    reclen = de->d_reclen;
-                    tnamelen = reclen - offsetof(struct linux_dirent, d_name);
-                    assert(tnamelen >= 0);
-                    treclen = tnamelen + offsetof(struct target_dirent, d_name);
-                    assert(count1 + treclen <= count);
-                    tde->d_reclen = tswap16(treclen);
-                    tde->d_ino = tswapal(de->d_ino);
-                    tde->d_off = tswapal(de->d_off);
-                    memcpy(tde->d_name, de->d_name, tnamelen);
-                    de = (struct linux_dirent *)((char *)de + reclen);
-                    len -= reclen;
-                    tde = (struct target_dirent *)((char *)tde + treclen);
-		    count1 += treclen;
-                }
-		ret = count1;
-                unlock_user(target_dirp, arg2, ret);
-            }
-            g_free(dirp);
-        }
-#else
-        {
-            struct linux_dirent *dirp;
-            abi_long count = arg3;
-
-            if (!(dirp = lock_user(VERIFY_WRITE, arg2, count, 0)))
-                return -TARGET_EFAULT;
-            ret = get_errno(sys_getdents(arg1, dirp, count));
-            if (!is_error(ret)) {
-                struct linux_dirent *de;
-                int len = ret;
-                int reclen;
-                de = dirp;
-                while (len > 0) {
-                    reclen = de->d_reclen;
-                    if (reclen > len)
-                        break;
-                    de->d_reclen = tswap16(reclen);
-                    tswapls(&de->d_ino);
-                    tswapls(&de->d_off);
-                    de = (struct linux_dirent *)((char *)de + reclen);
-                    len -= reclen;
-                }
-            }
-            unlock_user(dirp, arg2, ret);
-        }
-#endif
-#else
-        /* Implement getdents in terms of getdents64 */
-        {
-            struct linux_dirent64 *dirp;
-            abi_long count = arg3;
-
-            dirp = lock_user(VERIFY_WRITE, arg2, count, 0);
-            if (!dirp) {
-                return -TARGET_EFAULT;
-            }
-            ret = get_errno(sys_getdents64(arg1, dirp, count));
-            if (!is_error(ret)) {
-                /* Convert the dirent64 structs to target dirent.  We do this
-                 * in-place, since we can guarantee that a target_dirent is no
-                 * larger than a dirent64; however this means we have to be
-                 * careful to read everything before writing in the new format.
-                 */
-                struct linux_dirent64 *de;
-                struct target_dirent *tde;
-                int len = ret;
-                int tlen = 0;
-
-                de = dirp;
-                tde = (struct target_dirent *)dirp;
-                while (len > 0) {
-                    int namelen, treclen;
-                    int reclen = de->d_reclen;
-                    uint64_t ino = de->d_ino;
-                    int64_t off = de->d_off;
-                    uint8_t type = de->d_type;
-
-                    namelen = strlen(de->d_name);
-                    treclen = offsetof(struct target_dirent, d_name)
-                        + namelen + 2;
-                    treclen = QEMU_ALIGN_UP(treclen, sizeof(abi_long));
-
-                    memmove(tde->d_name, de->d_name, namelen + 1);
-                    tde->d_ino = tswapal(ino);
-                    tde->d_off = tswapal(off);
-                    tde->d_reclen = tswap16(treclen);
-                    /* The target_dirent type is in what was formerly a padding
-                     * byte at the end of the structure:
-                     */
-                    *(((char *)tde) + treclen - 1) = type;
-
-                    de = (struct linux_dirent64 *)((char *)de + reclen);
-                    tde = (struct target_dirent *)((char *)tde + treclen);
-                    len -= reclen;
-                    tlen += treclen;
-                }
-                ret = tlen;
-            }
-            unlock_user(dirp, arg2, ret);
-        }
-#endif
-        return ret;
-#endif /* TARGET_NR_getdents */
-#if defined(TARGET_NR_getdents64) && defined(__NR_getdents64)
-    case TARGET_NR_getdents64:
-        {
-            struct linux_dirent64 *dirp;
-            abi_long count = arg3;
-            if (!(dirp = lock_user(VERIFY_WRITE, arg2, count, 0)))
-                return -TARGET_EFAULT;
-            ret = get_errno(sys_getdents64(arg1, dirp, count));
-            if (!is_error(ret)) {
-                struct linux_dirent64 *de;
-                int len = ret;
-                int reclen;
-                de = dirp;
-                while (len > 0) {
-                    reclen = de->d_reclen;
-                    if (reclen > len)
-                        break;
-                    de->d_reclen = tswap16(reclen);
-                    tswap64s((uint64_t *)&de->d_ino);
-                    tswap64s((uint64_t *)&de->d_off);
-                    de = (struct linux_dirent64 *)((char *)de + reclen);
-                    len -= reclen;
-                }
-            }
-            unlock_user(dirp, arg2, ret);
-        }
-        return ret;
-#endif /* TARGET_NR_getdents64 */
 #if defined(TARGET_NR_poll) || defined(TARGET_NR_ppoll)
 # ifdef TARGET_NR_poll
     case TARGET_NR_poll:
@@ -12939,6 +12944,12 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(ftruncate);
 #ifdef TARGET_NR_futimesat
         SYSCALL(futimesat);
+#endif
+#ifdef TARGET_NR_getdents
+        SYSCALL(getdents);
+#endif
+#if defined(TARGET_NR_getdents64) && defined(__NR_getdents64)
+        SYSCALL(getdents64);
 #endif
         SYSCALL(getitimer);
 #ifdef TARGET_NR_getpeername
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 061/108] linux-user: Split out poll, ppoll
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (59 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 060/108] linux-user: Split out getdents, getdents64 Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 062/108] linux-user: Split out flock, preadv, pwritev, readv, writev Richard Henderson
                   ` (50 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define ppoll; remove the ifdef.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 232 +++++++++++++++++++++++--------------------
 1 file changed, 124 insertions(+), 108 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 600702ea3e..362d315ce8 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9101,6 +9101,126 @@ IMPL(pipe2)
                    target_to_host_bitmask(arg2, fcntl_flags_tbl), 1);
 }
 
+static struct pollfd *get_pollfd(abi_ulong nfds, abi_ulong target_addr,
+                                 struct target_pollfd **ptfd, abi_long *err)
+{
+    struct target_pollfd *target_pfd;
+    struct pollfd *pfd;
+    abi_ulong i;
+
+    if (nfds > (INT_MAX / sizeof(struct target_pollfd))) {
+        *err = -TARGET_EINVAL;
+        return NULL;
+    }
+    pfd = g_try_new(struct pollfd, nfds);
+    if (pfd == NULL) {
+        *err = -TARGET_ENOMEM;
+        return NULL;
+    }
+
+    *ptfd = target_pfd = lock_user(VERIFY_WRITE, target_addr,
+                                   sizeof(struct target_pollfd) * nfds, 1);
+    if (!target_pfd) {
+        *err = -TARGET_EFAULT;
+        g_free(pfd);
+        return NULL;
+    }
+
+    for (i = 0; i < nfds; i++) {
+        pfd[i].fd = tswap32(target_pfd[i].fd);
+        pfd[i].events = tswap16(target_pfd[i].events);
+    }
+
+    *err = 0;
+    return pfd;
+}
+
+static abi_long put_pollfd(abi_ulong nfds, abi_ulong target_addr,
+                           struct pollfd *pfd,
+                           struct target_pollfd *target_pfd, abi_long ret)
+{
+    if (!is_error(ret)) {
+        abi_ulong i;
+        for (i = 0; i < nfds; i++) {
+            target_pfd[i].revents = tswap16(pfd[i].revents);
+        }
+    }
+    unlock_user(target_pfd, target_addr, sizeof(struct target_pollfd) * nfds);
+    g_free(pfd);
+    return ret;
+}
+
+#ifdef TARGET_NR_poll
+IMPL(poll)
+{
+    struct timespec ts, *pts;
+    struct target_pollfd *target_pfd;
+    struct pollfd *pfd;
+    abi_long ret;
+
+    if (arg3 >= 0) {
+        /* Convert ms to secs, ns */
+        ts.tv_sec = arg3 / 1000;
+        ts.tv_nsec = (arg3 % 1000) * 1000000LL;
+        pts = &ts;
+    } else {
+        /* -ve poll() timeout means "infinite" */
+        pts = NULL;
+    }
+
+    pfd = get_pollfd(arg2, arg1, &target_pfd, &ret);
+    if (pfd == NULL) {
+        return ret;
+    }
+    ret = safe_ppoll(pfd, arg2, pts, NULL, 0);
+    return put_pollfd(arg2, arg1, pfd, target_pfd, get_errno(ret));
+}
+#endif
+
+IMPL(ppoll)
+{
+    struct timespec ts;
+    sigset_t set;
+    struct target_pollfd *target_pfd;
+    struct pollfd *pfd;
+    abi_long ret;
+
+    if (arg3) {
+        if (target_to_host_timespec(&ts, arg3)) {
+            return -TARGET_EFAULT;
+        }
+    }
+
+    if (arg4) {
+        target_sigset_t *target_set;
+        if (arg5 != sizeof(target_sigset_t)) {
+            return -TARGET_EINVAL;
+        }
+        target_set = lock_user(VERIFY_READ, arg4, sizeof(target_sigset_t), 1);
+        if (!target_set) {
+            return -TARGET_EFAULT;
+        }
+        target_to_host_sigset(&set, target_set);
+        unlock_user(target_set, arg4, 0);
+    }
+
+    pfd = get_pollfd(arg2, arg1, &target_pfd, &ret);
+    if (pfd == NULL) {
+        return ret;
+    }
+    ret = safe_ppoll(pfd, arg2, arg3 ? &ts : NULL,
+                     arg4 ? &set : NULL, SIGSET_T_SIZE);
+    ret = put_pollfd(arg2, arg1, pfd, target_pfd, get_errno(ret));
+
+    if (!is_error(ret) && arg3) {
+        abi_long err = host_to_target_timespec(arg3, &ts);
+        if (err) {
+            return err;
+        }
+    }
+    return ret;
+}
+
 IMPL(pselect6)
 {
     abi_long rfd_addr, wfd_addr, efd_addr, n, ts_addr;
@@ -10649,114 +10769,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#if defined(TARGET_NR_poll) || defined(TARGET_NR_ppoll)
-# ifdef TARGET_NR_poll
-    case TARGET_NR_poll:
-# endif
-# ifdef TARGET_NR_ppoll
-    case TARGET_NR_ppoll:
-# endif
-        {
-            struct target_pollfd *target_pfd;
-            unsigned int nfds = arg2;
-            struct pollfd *pfd;
-            unsigned int i;
-
-            pfd = NULL;
-            target_pfd = NULL;
-            if (nfds) {
-                if (nfds > (INT_MAX / sizeof(struct target_pollfd))) {
-                    return -TARGET_EINVAL;
-                }
-
-                target_pfd = lock_user(VERIFY_WRITE, arg1,
-                                       sizeof(struct target_pollfd) * nfds, 1);
-                if (!target_pfd) {
-                    return -TARGET_EFAULT;
-                }
-
-                pfd = alloca(sizeof(struct pollfd) * nfds);
-                for (i = 0; i < nfds; i++) {
-                    pfd[i].fd = tswap32(target_pfd[i].fd);
-                    pfd[i].events = tswap16(target_pfd[i].events);
-                }
-            }
-
-            switch (num) {
-# ifdef TARGET_NR_ppoll
-            case TARGET_NR_ppoll:
-            {
-                struct timespec _timeout_ts, *timeout_ts = &_timeout_ts;
-                target_sigset_t *target_set;
-                sigset_t _set, *set = &_set;
-
-                if (arg3) {
-                    if (target_to_host_timespec(timeout_ts, arg3)) {
-                        unlock_user(target_pfd, arg1, 0);
-                        return -TARGET_EFAULT;
-                    }
-                } else {
-                    timeout_ts = NULL;
-                }
-
-                if (arg4) {
-                    if (arg5 != sizeof(target_sigset_t)) {
-                        unlock_user(target_pfd, arg1, 0);
-                        return -TARGET_EINVAL;
-                    }
-
-                    target_set = lock_user(VERIFY_READ, arg4, sizeof(target_sigset_t), 1);
-                    if (!target_set) {
-                        unlock_user(target_pfd, arg1, 0);
-                        return -TARGET_EFAULT;
-                    }
-                    target_to_host_sigset(set, target_set);
-                } else {
-                    set = NULL;
-                }
-
-                ret = get_errno(safe_ppoll(pfd, nfds, timeout_ts,
-                                           set, SIGSET_T_SIZE));
-
-                if (!is_error(ret) && arg3) {
-                    host_to_target_timespec(arg3, timeout_ts);
-                }
-                if (arg4) {
-                    unlock_user(target_set, arg4, 0);
-                }
-                return ret;
-            }
-# endif
-# ifdef TARGET_NR_poll
-            case TARGET_NR_poll:
-            {
-                struct timespec ts, *pts;
-
-                if (arg3 >= 0) {
-                    /* Convert ms to secs, ns */
-                    ts.tv_sec = arg3 / 1000;
-                    ts.tv_nsec = (arg3 % 1000) * 1000000LL;
-                    pts = &ts;
-                } else {
-                    /* -ve poll() timeout means "infinite" */
-                    pts = NULL;
-                }
-                return get_errno(safe_ppoll(pfd, nfds, pts, NULL, 0));
-            }
-# endif
-            default:
-                g_assert_not_reached();
-            }
-
-            if (!is_error(ret)) {
-                for(i = 0; i < nfds; i++) {
-                    target_pfd[i].revents = tswap16(pfd[i].revents);
-                }
-            }
-            unlock_user(target_pfd, arg1, sizeof(struct target_pollfd) * nfds);
-        }
-        return ret;
-#endif
     case TARGET_NR_flock:
         /* NOTE: the flock constant seems to be the same for every
            Linux platform */
@@ -13060,6 +13072,10 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(pipe);
 #endif
         SYSCALL(pipe2);
+#ifdef TARGET_NR_poll
+        SYSCALL(poll);
+#endif
+        SYSCALL(ppoll);
         SYSCALL(pselect6);
         SYSCALL(read);
 #ifdef TARGET_NR_readlink
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 062/108] linux-user: Split out flock, preadv, pwritev, readv, writev
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (60 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 061/108] linux-user: Split out poll, ppoll Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 063/108] linux-user: Split out fdatasync, getsid, _sysctl Richard Henderson
                   ` (49 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define preadv and pwritev; remove the ifdefs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 135 ++++++++++++++++++++++++-------------------
 1 file changed, 77 insertions(+), 58 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 362d315ce8..07fa043965 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8043,6 +8043,12 @@ IMPL(fcntl)
 }
 #endif
 
+IMPL(flock)
+{
+    /* The flock constant seems to be the same for every Linux platform. */
+    return get_errno(safe_flock(arg1, arg2));
+}
+
 #ifdef TARGET_NR_fork
 IMPL(fork)
 {
@@ -9221,6 +9227,24 @@ IMPL(ppoll)
     return ret;
 }
 
+IMPL(preadv)
+{
+    struct iovec *vec;
+    abi_long ret;
+
+    vec = lock_iovec(VERIFY_WRITE, arg2, arg3, 0);
+    if (vec != NULL) {
+        unsigned long low, high;
+
+        target_to_host_low_high(arg4, arg5, &low, &high);
+        ret = get_errno(safe_preadv(arg1, vec, arg3, low, high));
+        unlock_iovec(vec, arg2, arg3, 1);
+    } else {
+        ret = -host_to_target_errno(errno);
+    }
+    return ret;
+}
+
 IMPL(pselect6)
 {
     abi_long rfd_addr, wfd_addr, efd_addr, n, ts_addr;
@@ -9322,6 +9346,24 @@ IMPL(pselect6)
     return ret;
 }
 
+IMPL(pwritev)
+{
+    struct iovec *vec;
+    abi_long ret;
+
+    vec = lock_iovec(VERIFY_READ, arg2, arg3, 1);
+    if (vec != NULL) {
+        unsigned long low, high;
+
+        target_to_host_low_high(arg4, arg5, &low, &high);
+        ret = get_errno(safe_pwritev(arg1, vec, arg3, low, high));
+        unlock_iovec(vec, arg2, arg3, 0);
+    } else {
+        ret = -host_to_target_errno(errno);
+    }
+    return ret;
+}
+
 IMPL(read)
 {
     abi_long ret;
@@ -9381,6 +9423,21 @@ IMPL(readlinkat)
     return do_readlinkat(arg1, arg2, arg3, arg4);
 }
 
+IMPL(readv)
+{
+    struct iovec *vec;
+    abi_long ret;
+
+    vec = lock_iovec(VERIFY_WRITE, arg2, arg3, 0);
+    if (vec != NULL) {
+        ret = get_errno(safe_readv(arg1, vec, arg3));
+        unlock_iovec(vec, arg2, arg3, 1);
+    } else {
+        ret = -host_to_target_errno(errno);
+    }
+    return ret;
+}
+
 IMPL(reboot)
 {
     abi_long ret;
@@ -10753,6 +10810,21 @@ IMPL(write)
     return ret;
 }
 
+IMPL(writev)
+{
+    struct iovec *vec;
+    abi_long ret;
+
+    vec = lock_iovec(VERIFY_READ, arg2, arg3, 1);
+    if (vec != NULL) {
+        ret = get_errno(safe_writev(arg1, vec, arg3));
+        unlock_iovec(vec, arg2, arg3, 0);
+    } else {
+        ret = -host_to_target_errno(errno);
+    }
+    return ret;
+}
+
 /* This is an internal helper for do_syscall so that it is easier
  * to have a single return point, so that actions, such as logging
  * of syscall results, can be performed.
@@ -10769,64 +10841,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_flock:
-        /* NOTE: the flock constant seems to be the same for every
-           Linux platform */
-        return get_errno(safe_flock(arg1, arg2));
-    case TARGET_NR_readv:
-        {
-            struct iovec *vec = lock_iovec(VERIFY_WRITE, arg2, arg3, 0);
-            if (vec != NULL) {
-                ret = get_errno(safe_readv(arg1, vec, arg3));
-                unlock_iovec(vec, arg2, arg3, 1);
-            } else {
-                ret = -host_to_target_errno(errno);
-            }
-        }
-        return ret;
-    case TARGET_NR_writev:
-        {
-            struct iovec *vec = lock_iovec(VERIFY_READ, arg2, arg3, 1);
-            if (vec != NULL) {
-                ret = get_errno(safe_writev(arg1, vec, arg3));
-                unlock_iovec(vec, arg2, arg3, 0);
-            } else {
-                ret = -host_to_target_errno(errno);
-            }
-        }
-        return ret;
-#if defined(TARGET_NR_preadv)
-    case TARGET_NR_preadv:
-        {
-            struct iovec *vec = lock_iovec(VERIFY_WRITE, arg2, arg3, 0);
-            if (vec != NULL) {
-                unsigned long low, high;
-
-                target_to_host_low_high(arg4, arg5, &low, &high);
-                ret = get_errno(safe_preadv(arg1, vec, arg3, low, high));
-                unlock_iovec(vec, arg2, arg3, 1);
-            } else {
-                ret = -host_to_target_errno(errno);
-           }
-        }
-        return ret;
-#endif
-#if defined(TARGET_NR_pwritev)
-    case TARGET_NR_pwritev:
-        {
-            struct iovec *vec = lock_iovec(VERIFY_READ, arg2, arg3, 1);
-            if (vec != NULL) {
-                unsigned long low, high;
-
-                target_to_host_low_high(arg4, arg5, &low, &high);
-                ret = get_errno(safe_pwritev(arg1, vec, arg3, low, high));
-                unlock_iovec(vec, arg2, arg3, 0);
-            } else {
-                ret = -host_to_target_errno(errno);
-           }
-        }
-        return ret;
-#endif
     case TARGET_NR_getsid:
         return get_errno(getsid(arg1));
 #if defined(TARGET_NR_fdatasync) /* Not on alpha (osf_datasync ?) */
@@ -12944,6 +12958,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_fcntl
         SYSCALL(fcntl);
 #endif
+        SYSCALL(flock);
 #ifdef TARGET_NR_fork
         SYSCALL(fork);
 #endif
@@ -13076,12 +13091,15 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(poll);
 #endif
         SYSCALL(ppoll);
+        SYSCALL(preadv);
         SYSCALL(pselect6);
+        SYSCALL(pwritev);
         SYSCALL(read);
 #ifdef TARGET_NR_readlink
         SYSCALL(readlink);
 #endif
         SYSCALL(readlinkat);
+        SYSCALL(readv);
         SYSCALL(reboot);
 #ifdef TARGET_NR_recv
         SYSCALL(recv);
@@ -13250,6 +13268,7 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(waitpid);
 #endif
         SYSCALL(write);
+        SYSCALL(writev);
     }
 
 #undef SYSCALL
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 063/108] linux-user: Split out fdatasync, getsid, _sysctl
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (61 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 062/108] linux-user: Split out flock, preadv, pwritev, readv, writev Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 064/108] linux-user: Split out sched syscalls Richard Henderson
                   ` (48 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define fdatasync; remove the ifdef.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 35 +++++++++++++++++++++++------------
 1 file changed, 23 insertions(+), 12 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 07fa043965..1907b32499 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8043,6 +8043,11 @@ IMPL(fcntl)
 }
 #endif
 
+IMPL(fdatasync)
+{
+    return get_errno(fdatasync(arg1));
+}
+
 IMPL(flock)
 {
     /* The flock constant seems to be the same for every Linux platform. */
@@ -8403,6 +8408,11 @@ IMPL(getrusage)
     return ret;
 }
 
+IMPL(getsid)
+{
+    return get_errno(getsid(arg1));
+}
+
 #ifdef TARGET_NR_getsockname
 IMPL(getsockname)
 {
@@ -10465,6 +10475,14 @@ IMPL(syncfs)
 }
 #endif
 
+#ifdef TARGET_NR__sysctl
+IMPL(_sysctl)
+{
+    /* We don't implement this, but ENOTDIR is always a safe return value. */
+    return -TARGET_ENOTDIR;
+}
+#endif
+
 IMPL(sysinfo)
 {
     struct sysinfo value;
@@ -10841,18 +10859,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_getsid:
-        return get_errno(getsid(arg1));
-#if defined(TARGET_NR_fdatasync) /* Not on alpha (osf_datasync ?) */
-    case TARGET_NR_fdatasync:
-        return get_errno(fdatasync(arg1));
-#endif
-#ifdef TARGET_NR__sysctl
-    case TARGET_NR__sysctl:
-        /* We don't implement this, but ENOTDIR is always a safe
-           return value. */
-        return -TARGET_ENOTDIR;
-#endif
     case TARGET_NR_sched_getaffinity:
         {
             unsigned int mask_size;
@@ -12958,6 +12964,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_fcntl
         SYSCALL(fcntl);
 #endif
+        SYSCALL(fdatasync);
         SYSCALL(flock);
 #ifdef TARGET_NR_fork
         SYSCALL(fork);
@@ -12996,6 +13003,7 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(getrandom);
         SYSCALL(getrlimit);
         SYSCALL(getrusage);
+        SYSCALL(getsid);
 #ifdef TARGET_NR_getsockname
         SYSCALL(getsockname);
 #endif
@@ -13234,6 +13242,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(sync);
 #ifdef CONFIG_SYNCFS
         SYSCALL(syncfs);
+#endif
+#ifdef TARGET_NR__sysctl
+        SYSCALL(_sysctl);
 #endif
         SYSCALL(sysinfo);
         SYSCALL(syslog);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 064/108] linux-user: Split out sched syscalls
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (62 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 063/108] linux-user: Split out fdatasync, getsid, _sysctl Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 065/108] linux-user: Split out getcpu, nanosleep, prctl Richard Henderson
                   ` (47 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

This includes sched_getaffinity, sched_getparam, sched_get_priority_max,
sched_get_priority_min, sched_getscheduler, sched_rr_get_interval,
sched_setaffinity, sched_setparam, sched_setscheduler, sched_yield.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 281 ++++++++++++++++++++++++-------------------
 1 file changed, 158 insertions(+), 123 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1907b32499..84f21634c8 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9795,6 +9795,154 @@ IMPL(rt_tgsigqueueinfo)
     return get_errno(sys_rt_tgsigqueueinfo(arg1, arg2, arg3, &uinfo));
 }
 
+IMPL(sched_getaffinity)
+{
+    unsigned int mask_size;
+    unsigned long *mask;
+    abi_long ret;
+
+    /*
+     * sched_getaffinity needs multiples of ulong, so need to take
+     * care of mismatches between target ulong and host ulong sizes.
+     */
+    if (arg2 & (sizeof(abi_ulong) - 1)) {
+        return -TARGET_EINVAL;
+    }
+    mask_size = QEMU_ALIGN_UP(arg2, sizeof(unsigned long));
+    mask = alloca(mask_size);
+    memset(mask, 0, mask_size);
+
+    ret = get_errno(sys_sched_getaffinity(arg1, mask_size, mask));
+    if (!is_error(ret)) {
+        if (ret > arg2) {
+            /* More data returned than the caller's buffer will fit.
+             * This only happens if sizeof(abi_long) < sizeof(long)
+             * and the caller passed us a buffer holding an odd number
+             * of abi_longs. If the host kernel is actually using the
+             * extra 4 bytes then fail EINVAL; otherwise we can just
+             * ignore them and only copy the interesting part.
+             */
+            int numcpus = sysconf(_SC_NPROCESSORS_CONF);
+            if (numcpus > arg2 * 8) {
+                return -TARGET_EINVAL;
+            }
+            ret = arg2;
+        }
+        if (host_to_target_cpu_mask(mask, mask_size, arg3, ret)) {
+            return -TARGET_EFAULT;
+        }
+    }
+    return ret;
+}
+
+IMPL(sched_getparam)
+{
+    struct sched_param *target_schp;
+    struct sched_param schp;
+    abi_long ret;
+
+    if (arg2 == 0) {
+        return -TARGET_EINVAL;
+    }
+    ret = get_errno(sched_getparam(arg1, &schp));
+    if (!is_error(ret)) {
+        if (!lock_user_struct(VERIFY_WRITE, target_schp, arg2, 0)) {
+            return -TARGET_EFAULT;
+        }
+        target_schp->sched_priority = tswap32(schp.sched_priority);
+        unlock_user_struct(target_schp, arg2, 1);
+    }
+    return ret;
+}
+
+IMPL(sched_get_priority_max)
+{
+    return get_errno(sched_get_priority_max(arg1));
+}
+
+IMPL(sched_get_priority_min)
+{
+    return get_errno(sched_get_priority_min(arg1));
+}
+
+IMPL(sched_getscheduler)
+{
+    return get_errno(sched_getscheduler(arg1));
+}
+
+IMPL(sched_rr_get_interval)
+{
+    struct timespec ts;
+    abi_long ret;
+
+    ret = get_errno(sched_rr_get_interval(arg1, &ts));
+    if (!is_error(ret)) {
+        ret = host_to_target_timespec(arg2, &ts);
+    }
+    return ret;
+}
+
+IMPL(sched_setaffinity)
+{
+    unsigned int mask_size;
+    unsigned long *mask;
+    abi_long ret;
+
+    /*
+     * sched_setaffinity needs multiples of ulong, so need to take
+     * care of mismatches between target ulong and host ulong sizes.
+     */
+    if (arg2 & (sizeof(abi_ulong) - 1)) {
+        return -TARGET_EINVAL;
+    }
+    mask_size = QEMU_ALIGN_UP(arg2, sizeof(unsigned long));
+    mask = alloca(mask_size);
+
+    ret = target_to_host_cpu_mask(mask, mask_size, arg3, arg2);
+    if (ret) {
+        return ret;
+    }
+
+    return get_errno(sys_sched_setaffinity(arg1, mask_size, mask));
+}
+
+IMPL(sched_setparam)
+{
+    struct sched_param *target_schp;
+    struct sched_param schp;
+
+    if (arg2 == 0) {
+        return -TARGET_EINVAL;
+    }
+    if (!lock_user_struct(VERIFY_READ, target_schp, arg2, 1)) {
+        return -TARGET_EFAULT;
+    }
+    schp.sched_priority = tswap32(target_schp->sched_priority);
+    unlock_user_struct(target_schp, arg2, 0);
+    return get_errno(sched_setparam(arg1, &schp));
+}
+
+IMPL(sched_setscheduler)
+{
+    struct sched_param *target_schp;
+    struct sched_param schp;
+
+    if (arg3 == 0) {
+        return -TARGET_EINVAL;
+    }
+    if (!lock_user_struct(VERIFY_READ, target_schp, arg3, 1)) {
+        return -TARGET_EFAULT;
+    }
+    schp.sched_priority = tswap32(target_schp->sched_priority);
+    unlock_user_struct(target_schp, arg3, 0);
+    return get_errno(sched_setscheduler(arg1, arg2, &schp));
+}
+
+IMPL(sched_yield)
+{
+    return get_errno(sched_yield());
+}
+
 #ifdef TARGET_NR_sgetmask
 IMPL(sgetmask)
 {
@@ -10859,68 +11007,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_sched_getaffinity:
-        {
-            unsigned int mask_size;
-            unsigned long *mask;
-
-            /*
-             * sched_getaffinity needs multiples of ulong, so need to take
-             * care of mismatches between target ulong and host ulong sizes.
-             */
-            if (arg2 & (sizeof(abi_ulong) - 1)) {
-                return -TARGET_EINVAL;
-            }
-            mask_size = (arg2 + (sizeof(*mask) - 1)) & ~(sizeof(*mask) - 1);
-
-            mask = alloca(mask_size);
-            memset(mask, 0, mask_size);
-            ret = get_errno(sys_sched_getaffinity(arg1, mask_size, mask));
-
-            if (!is_error(ret)) {
-                if (ret > arg2) {
-                    /* More data returned than the caller's buffer will fit.
-                     * This only happens if sizeof(abi_long) < sizeof(long)
-                     * and the caller passed us a buffer holding an odd number
-                     * of abi_longs. If the host kernel is actually using the
-                     * extra 4 bytes then fail EINVAL; otherwise we can just
-                     * ignore them and only copy the interesting part.
-                     */
-                    int numcpus = sysconf(_SC_NPROCESSORS_CONF);
-                    if (numcpus > arg2 * 8) {
-                        return -TARGET_EINVAL;
-                    }
-                    ret = arg2;
-                }
-
-                if (host_to_target_cpu_mask(mask, mask_size, arg3, ret)) {
-                    return -TARGET_EFAULT;
-                }
-            }
-        }
-        return ret;
-    case TARGET_NR_sched_setaffinity:
-        {
-            unsigned int mask_size;
-            unsigned long *mask;
-
-            /*
-             * sched_setaffinity needs multiples of ulong, so need to take
-             * care of mismatches between target ulong and host ulong sizes.
-             */
-            if (arg2 & (sizeof(abi_ulong) - 1)) {
-                return -TARGET_EINVAL;
-            }
-            mask_size = (arg2 + (sizeof(*mask) - 1)) & ~(sizeof(*mask) - 1);
-            mask = alloca(mask_size);
-
-            ret = target_to_host_cpu_mask(mask, mask_size, arg3, arg2);
-            if (ret) {
-                return ret;
-            }
-
-            return get_errno(sys_sched_setaffinity(arg1, mask_size, mask));
-        }
     case TARGET_NR_getcpu:
         {
             unsigned cpu, node;
@@ -10938,67 +11024,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
             }
         }
         return ret;
-    case TARGET_NR_sched_setparam:
-        {
-            struct sched_param *target_schp;
-            struct sched_param schp;
-
-            if (arg2 == 0) {
-                return -TARGET_EINVAL;
-            }
-            if (!lock_user_struct(VERIFY_READ, target_schp, arg2, 1))
-                return -TARGET_EFAULT;
-            schp.sched_priority = tswap32(target_schp->sched_priority);
-            unlock_user_struct(target_schp, arg2, 0);
-            return get_errno(sched_setparam(arg1, &schp));
-        }
-    case TARGET_NR_sched_getparam:
-        {
-            struct sched_param *target_schp;
-            struct sched_param schp;
-
-            if (arg2 == 0) {
-                return -TARGET_EINVAL;
-            }
-            ret = get_errno(sched_getparam(arg1, &schp));
-            if (!is_error(ret)) {
-                if (!lock_user_struct(VERIFY_WRITE, target_schp, arg2, 0))
-                    return -TARGET_EFAULT;
-                target_schp->sched_priority = tswap32(schp.sched_priority);
-                unlock_user_struct(target_schp, arg2, 1);
-            }
-        }
-        return ret;
-    case TARGET_NR_sched_setscheduler:
-        {
-            struct sched_param *target_schp;
-            struct sched_param schp;
-            if (arg3 == 0) {
-                return -TARGET_EINVAL;
-            }
-            if (!lock_user_struct(VERIFY_READ, target_schp, arg3, 1))
-                return -TARGET_EFAULT;
-            schp.sched_priority = tswap32(target_schp->sched_priority);
-            unlock_user_struct(target_schp, arg3, 0);
-            return get_errno(sched_setscheduler(arg1, arg2, &schp));
-        }
-    case TARGET_NR_sched_getscheduler:
-        return get_errno(sched_getscheduler(arg1));
-    case TARGET_NR_sched_yield:
-        return get_errno(sched_yield());
-    case TARGET_NR_sched_get_priority_max:
-        return get_errno(sched_get_priority_max(arg1));
-    case TARGET_NR_sched_get_priority_min:
-        return get_errno(sched_get_priority_min(arg1));
-    case TARGET_NR_sched_rr_get_interval:
-        {
-            struct timespec ts;
-            ret = get_errno(sched_rr_get_interval(arg1, &ts));
-            if (!is_error(ret)) {
-                ret = host_to_target_timespec(arg2, &ts);
-            }
-        }
-        return ret;
     case TARGET_NR_nanosleep:
         {
             struct timespec req, rem;
@@ -13139,6 +13164,16 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(rt_sigsuspend);
         SYSCALL(rt_sigtimedwait);
         SYSCALL(rt_tgsigqueueinfo);
+        SYSCALL(sched_getaffinity);
+        SYSCALL(sched_getparam);
+        SYSCALL(sched_get_priority_max);
+        SYSCALL(sched_get_priority_min);
+        SYSCALL(sched_getscheduler);
+        SYSCALL(sched_rr_get_interval);
+        SYSCALL(sched_setaffinity);
+        SYSCALL(sched_setparam);
+        SYSCALL(sched_setscheduler);
+        SYSCALL(sched_yield);
 #ifdef TARGET_NR_sgetmask
         SYSCALL(sgetmask);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 065/108] linux-user: Split out getcpu, nanosleep, prctl
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (63 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 064/108] linux-user: Split out sched syscalls Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 066/108] linux-user: Split out arch_prctl Richard Henderson
                   ` (46 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 214 +++++++++++++++++++++++--------------------
 1 file changed, 114 insertions(+), 100 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 84f21634c8..ee3a31f06d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8132,6 +8132,24 @@ IMPL(futimesat)
 }
 #endif
 
+IMPL(getcpu)
+{
+    unsigned cpu, node;
+    abi_long ret;
+
+    ret = get_errno(sys_getcpu(arg1 ? &cpu : NULL, arg2 ? &node : NULL, NULL));
+    if (is_error(ret)) {
+        return ret;
+    }
+    if (arg1 && put_user_u32(cpu, arg1)) {
+        return -TARGET_EFAULT;
+    }
+    if (arg2 && put_user_u32(node, arg2)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+
 #ifdef TARGET_NR_getdents
 IMPL(getdents)
 {
@@ -9004,6 +9022,25 @@ IMPL(name_to_handle_at)
 }
 #endif
 
+IMPL(nanosleep)
+{
+    struct timespec req, rem;
+    abi_long ret;
+
+    ret = target_to_host_timespec(&req, arg1);
+    if (ret < 0) {
+        return ret;
+    }
+    ret = safe_nanosleep(&req, &rem);
+    if (ret < 0) {
+        return -host_to_target_errno(errno);
+    }
+    if (arg2) {
+        return host_to_target_timespec(arg2, &rem);
+    }
+    return 0;
+}
+
 #ifdef TARGET_NR__newselect
 IMPL(_newselect)
 {
@@ -9237,6 +9274,80 @@ IMPL(ppoll)
     return ret;
 }
 
+IMPL(prctl)
+{
+    int deathsig;
+    void *name;
+    abi_long ret;
+
+    switch (arg1) {
+    case PR_GET_PDEATHSIG:
+        ret = get_errno(prctl(arg1, &deathsig, arg3, arg4, arg5));
+        if (!is_error(ret) && arg2 && put_user_ual(deathsig, arg2)) {
+            return -TARGET_EFAULT;
+        }
+        return ret;
+
+#ifdef PR_GET_NAME
+    case PR_GET_NAME:
+        name = lock_user(VERIFY_WRITE, arg2, 16, 1);
+        if (!name) {
+            return -TARGET_EFAULT;
+        }
+        ret = get_errno(prctl(arg1, (uintptr_t)name, arg3, arg4, arg5));
+        unlock_user(name, arg2, 16);
+        return ret;
+#endif
+#ifdef PR_SET_NAME
+    case PR_SET_NAME:
+        name = lock_user(VERIFY_READ, arg2, 16, 1);
+        if (!name) {
+            return -TARGET_EFAULT;
+        }
+        ret = get_errno(prctl(arg1, (uintptr_t)name, arg3, arg4, arg5));
+        unlock_user(name, arg2, 0);
+        return ret;
+#endif
+#ifdef TARGET_AARCH64
+    case TARGET_PR_SVE_SET_VL:
+        /* We cannot support either PR_SVE_SET_VL_ONEXEC
+           or PR_SVE_VL_INHERIT.  Therefore, anything above
+           ARM_MAX_VQ results in EINVAL.  */
+        ret = -TARGET_EINVAL;
+        if (arm_feature(cpu_env, ARM_FEATURE_SVE)
+            && arg2 >= 0 && arg2 <= ARM_MAX_VQ * 16 && !(arg2 & 15)) {
+            CPUARMState *env = cpu_env;
+            int old_vq = (env->vfp.zcr_el[1] & 0xf) + 1;
+            int vq = MAX(arg2 / 16, 1);
+
+            if (vq < old_vq) {
+                aarch64_sve_narrow_vq(env, vq);
+            }
+            env->vfp.zcr_el[1] = vq - 1;
+            ret = vq * 16;
+        }
+        return ret;
+
+    case TARGET_PR_SVE_GET_VL:
+        ret = -TARGET_EINVAL;
+        if (arm_feature(cpu_env, ARM_FEATURE_SVE)) {
+            CPUARMState *env = cpu_env;
+            ret = ((env->vfp.zcr_el[1] & 0xf) + 1) * 16;
+        }
+        return ret;
+#endif /* AARCH64 */
+
+    case PR_GET_SECCOMP:
+    case PR_SET_SECCOMP:
+        /* Disable seccomp to prevent the target disabling syscalls we need. */
+        return -TARGET_EINVAL;
+
+    default:
+        /* Most prctl options have no pointer arguments */
+        return get_errno(prctl(arg1, arg2, arg3, arg4, arg5));
+    }
+}
+
 IMPL(preadv)
 {
     struct iovec *vec;
@@ -11007,106 +11118,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_getcpu:
-        {
-            unsigned cpu, node;
-            ret = get_errno(sys_getcpu(arg1 ? &cpu : NULL,
-                                       arg2 ? &node : NULL,
-                                       NULL));
-            if (is_error(ret)) {
-                return ret;
-            }
-            if (arg1 && put_user_u32(cpu, arg1)) {
-                return -TARGET_EFAULT;
-            }
-            if (arg2 && put_user_u32(node, arg2)) {
-                return -TARGET_EFAULT;
-            }
-        }
-        return ret;
-    case TARGET_NR_nanosleep:
-        {
-            struct timespec req, rem;
-            target_to_host_timespec(&req, arg1);
-            ret = get_errno(safe_nanosleep(&req, &rem));
-            if (is_error(ret) && arg2) {
-                host_to_target_timespec(arg2, &rem);
-            }
-        }
-        return ret;
-    case TARGET_NR_prctl:
-        switch (arg1) {
-        case PR_GET_PDEATHSIG:
-        {
-            int deathsig;
-            ret = get_errno(prctl(arg1, &deathsig, arg3, arg4, arg5));
-            if (!is_error(ret) && arg2
-                && put_user_ual(deathsig, arg2)) {
-                return -TARGET_EFAULT;
-            }
-            return ret;
-        }
-#ifdef PR_GET_NAME
-        case PR_GET_NAME:
-        {
-            void *name = lock_user(VERIFY_WRITE, arg2, 16, 1);
-            if (!name) {
-                return -TARGET_EFAULT;
-            }
-            ret = get_errno(prctl(arg1, (unsigned long)name,
-                                  arg3, arg4, arg5));
-            unlock_user(name, arg2, 16);
-            return ret;
-        }
-        case PR_SET_NAME:
-        {
-            void *name = lock_user(VERIFY_READ, arg2, 16, 1);
-            if (!name) {
-                return -TARGET_EFAULT;
-            }
-            ret = get_errno(prctl(arg1, (unsigned long)name,
-                                  arg3, arg4, arg5));
-            unlock_user(name, arg2, 0);
-            return ret;
-        }
-#endif
-#ifdef TARGET_AARCH64
-        case TARGET_PR_SVE_SET_VL:
-            /* We cannot support either PR_SVE_SET_VL_ONEXEC
-               or PR_SVE_VL_INHERIT.  Therefore, anything above
-               ARM_MAX_VQ results in EINVAL.  */
-            ret = -TARGET_EINVAL;
-            if (arm_feature(cpu_env, ARM_FEATURE_SVE)
-                && arg2 >= 0 && arg2 <= ARM_MAX_VQ * 16 && !(arg2 & 15)) {
-                CPUARMState *env = cpu_env;
-                int old_vq = (env->vfp.zcr_el[1] & 0xf) + 1;
-                int vq = MAX(arg2 / 16, 1);
-
-                if (vq < old_vq) {
-                    aarch64_sve_narrow_vq(env, vq);
-                }
-                env->vfp.zcr_el[1] = vq - 1;
-                ret = vq * 16;
-            }
-            return ret;
-        case TARGET_PR_SVE_GET_VL:
-            ret = -TARGET_EINVAL;
-            if (arm_feature(cpu_env, ARM_FEATURE_SVE)) {
-                CPUARMState *env = cpu_env;
-                ret = ((env->vfp.zcr_el[1] & 0xf) + 1) * 16;
-            }
-            return ret;
-#endif /* AARCH64 */
-        case PR_GET_SECCOMP:
-        case PR_SET_SECCOMP:
-            /* Disable seccomp to prevent the target disabling syscalls we
-             * need. */
-            return -TARGET_EINVAL;
-        default:
-            /* Most prctl options have no pointer arguments */
-            return get_errno(prctl(arg1, arg2, arg3, arg4, arg5));
-        }
-        break;
 #ifdef TARGET_NR_arch_prctl
     case TARGET_NR_arch_prctl:
 #if defined(TARGET_I386) && !defined(TARGET_ABI32)
@@ -13004,6 +13015,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_futimesat
         SYSCALL(futimesat);
 #endif
+        SYSCALL(getcpu);
 #ifdef TARGET_NR_getdents
         SYSCALL(getdents);
 #endif
@@ -13099,6 +13111,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef CONFIG_OPEN_BY_HANDLE
         SYSCALL(name_to_handle_at);
 #endif
+        SYSCALL(nanosleep);
 #ifdef TARGET_NR__newselect
         SYSCALL(_newselect);
 #endif
@@ -13124,6 +13137,7 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(poll);
 #endif
         SYSCALL(ppoll);
+        SYSCALL(prctl);
         SYSCALL(preadv);
         SYSCALL(pselect6);
         SYSCALL(pwritev);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 066/108] linux-user: Split out arch_prctl
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (64 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 065/108] linux-user: Split out getcpu, nanosleep, prctl Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 067/108] linux-user: Split out getcwd, pread64, pwrite64, sigaltstack Richard Henderson
                   ` (45 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index ee3a31f06d..e3765069ab 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7680,6 +7680,17 @@ IMPL(alarm)
 }
 #endif
 
+#ifdef TARGET_NR_arch_prctl
+IMPL(arch_prctl)
+{
+# if defined(TARGET_I386) && !defined(TARGET_ABI32)
+    return do_arch_prctl(cpu_env, arg1, arg2);
+# else
+#  error unreachable
+# endif
+}
+#endif
+
 #ifdef TARGET_NR_bind
 IMPL(bind)
 {
@@ -11118,14 +11129,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_arch_prctl
-    case TARGET_NR_arch_prctl:
-#if defined(TARGET_I386) && !defined(TARGET_ABI32)
-        return do_arch_prctl(cpu_env, arg1, arg2);
-#else
-#error unreachable
-#endif
-#endif
 #ifdef TARGET_NR_pread64
     case TARGET_NR_pread64:
         if (regpairs_aligned(cpu_env, num)) {
@@ -12961,6 +12964,9 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_alarm
         SYSCALL(alarm);
 #endif
+#ifdef TARGET_NR_arch_prctl
+        SYSCALL(arch_prctl);
+#endif
 #ifdef TARGET_NR_bind
         SYSCALL(bind);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 067/108] linux-user: Split out getcwd, pread64, pwrite64, sigaltstack
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (65 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 066/108] linux-user: Split out arch_prctl Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 068/108] linux-user: Split out capget, capset Richard Henderson
                   ` (44 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define pread64 and pwrite64; remove the ifdefs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 88 ++++++++++++++++++++++++++++----------------
 1 file changed, 56 insertions(+), 32 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e3765069ab..1e1ac8defd 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8161,6 +8161,19 @@ IMPL(getcpu)
     return ret;
 }
 
+IMPL(getcwd)
+{
+    char *p = lock_user(VERIFY_WRITE, arg1, arg2, 0);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(sys_getcwd1(p, arg2));
+    unlock_user(p, arg1, ret);
+    return ret;
+}
+
 #ifdef TARGET_NR_getdents
 IMPL(getdents)
 {
@@ -9359,6 +9372,23 @@ IMPL(prctl)
     }
 }
 
+IMPL(pread64)
+{
+    void *p = lock_user(VERIFY_WRITE, arg2, arg3, 0);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    if (regpairs_aligned(cpu_env, TARGET_NR_pread64)) {
+        arg4 = arg5;
+        arg5 = arg6;
+    }
+    ret = get_errno(pread64(arg1, p, arg3, target_offset64(arg4, arg5)));
+    unlock_user(p, arg2, ret);
+    return ret;
+}
+
 IMPL(preadv)
 {
     struct iovec *vec;
@@ -9478,6 +9508,23 @@ IMPL(pselect6)
     return ret;
 }
 
+IMPL(pwrite64)
+{
+    void *p = lock_user(VERIFY_READ, arg2, arg3, 1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    if (regpairs_aligned(cpu_env, TARGET_NR_pwrite64)) {
+        arg4 = arg5;
+        arg5 = arg6;
+    }
+    ret = get_errno(pwrite64(arg1, p, arg3, target_offset64(arg4, arg5)));
+    unlock_user(p, arg2, 0);
+    return ret;
+}
+
 IMPL(pwritev)
 {
     struct iovec *vec;
@@ -10359,6 +10406,11 @@ IMPL(sigaction)
 }
 #endif
 
+IMPL(sigaltstack)
+{
+    return do_sigaltstack(arg1, arg2, get_sp_from_cpustate(cpu_env));
+}
+
 #ifdef TARGET_NR_sigpending
 IMPL(sigpending)
 {
@@ -11129,34 +11181,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_pread64
-    case TARGET_NR_pread64:
-        if (regpairs_aligned(cpu_env, num)) {
-            arg4 = arg5;
-            arg5 = arg6;
-        }
-        if (!(p = lock_user(VERIFY_WRITE, arg2, arg3, 0)))
-            return -TARGET_EFAULT;
-        ret = get_errno(pread64(arg1, p, arg3, target_offset64(arg4, arg5)));
-        unlock_user(p, arg2, ret);
-        return ret;
-    case TARGET_NR_pwrite64:
-        if (regpairs_aligned(cpu_env, num)) {
-            arg4 = arg5;
-            arg5 = arg6;
-        }
-        if (!(p = lock_user(VERIFY_READ, arg2, arg3, 1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(pwrite64(arg1, p, arg3, target_offset64(arg4, arg5)));
-        unlock_user(p, arg2, 0);
-        return ret;
-#endif
-    case TARGET_NR_getcwd:
-        if (!(p = lock_user(VERIFY_WRITE, arg1, arg2, 0)))
-            return -TARGET_EFAULT;
-        ret = get_errno(sys_getcwd1(p, arg2));
-        unlock_user(p, arg1, ret);
-        return ret;
     case TARGET_NR_capget:
     case TARGET_NR_capset:
     {
@@ -11227,10 +11251,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
         }
         return ret;
     }
-    case TARGET_NR_sigaltstack:
-        return do_sigaltstack(arg1, arg2,
-                              get_sp_from_cpustate((CPUArchState *)cpu_env));
-
 #ifdef CONFIG_SENDFILE
     case TARGET_NR_sendfile:
     {
@@ -13022,6 +13042,7 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(futimesat);
 #endif
         SYSCALL(getcpu);
+        SYSCALL(getcwd);
 #ifdef TARGET_NR_getdents
         SYSCALL(getdents);
 #endif
@@ -13144,8 +13165,10 @@ static impl_fn *syscall_table(unsigned num)
 #endif
         SYSCALL(ppoll);
         SYSCALL(prctl);
+        SYSCALL(pread64);
         SYSCALL(preadv);
         SYSCALL(pselect6);
+        SYSCALL(pwrite64);
         SYSCALL(pwritev);
         SYSCALL(read);
 #ifdef TARGET_NR_readlink
@@ -13254,6 +13277,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_sigaction
         SYSCALL(sigaction);
 #endif
+        SYSCALL(sigaltstack);
 #ifdef TARGET_NR_sigpending
         SYSCALL(sigpending);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 068/108] linux-user: Split out capget, capset
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (66 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 067/108] linux-user: Split out getcwd, pread64, pwrite64, sigaltstack Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 069/108] linux-user: Split out sendfile, sendfile64 Richard Henderson
                   ` (43 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 156 ++++++++++++++++++++++++-------------------
 1 file changed, 86 insertions(+), 70 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1e1ac8defd..c906719152 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7703,6 +7703,90 @@ IMPL(brk)
     return do_brk(arg1);
 }
 
+IMPL(capget)
+{
+    struct target_user_cap_header *target_header;
+    struct __user_cap_header_struct header;
+    struct __user_cap_data_struct data[2];
+    int data_items;
+    abi_long ret;
+
+    if (!lock_user_struct(VERIFY_WRITE, target_header, arg1, 1)) {
+        return -TARGET_EFAULT;
+    }
+    header.version = tswap32(target_header->version);
+    header.pid = tswap32(target_header->pid);
+
+    /* Version 2 and up takes pointer to two user_data structs */
+    data_items = (header.version == _LINUX_CAPABILITY_VERSION ? 1 : 2);
+
+    ret = get_errno(capget(&header, arg2 ? data : NULL));
+
+    /* The kernel always updates version for both capget and capset */
+    target_header->version = tswap32(header.version);
+    unlock_user_struct(target_header, arg1, 1);
+
+    if (arg2) {
+        struct target_user_cap_data *target_data;
+        int target_datalen = sizeof(*target_data) * data_items;
+        int i;
+
+        target_data = lock_user(VERIFY_WRITE, arg2, target_datalen, 0);
+        if (!target_data) {
+            return -TARGET_EFAULT;
+        }
+        for (i = 0; i < data_items; i++) {
+            target_data[i].effective = tswap32(data[i].effective);
+            target_data[i].permitted = tswap32(data[i].permitted);
+            target_data[i].inheritable = tswap32(data[i].inheritable);
+        }
+        unlock_user(target_data, arg2, target_datalen);
+    }
+    return ret;
+}
+
+IMPL(capset)
+{
+    struct target_user_cap_header *target_header;
+    struct __user_cap_header_struct header;
+    struct __user_cap_data_struct data[2];
+    abi_long ret;
+
+    if (!lock_user_struct(VERIFY_WRITE, target_header, arg1, 1)) {
+        return -TARGET_EFAULT;
+    }
+    header.version = tswap32(target_header->version);
+    header.pid = tswap32(target_header->pid);
+
+    if (arg2) {
+        /* Version 2 and up takes pointer to two user_data structs */
+        int data_items = (header.version == _LINUX_CAPABILITY_VERSION ? 1 : 2);
+        struct target_user_cap_data *target_data;
+        int target_datalen = sizeof(*target_data) * data_items;
+        int i;
+
+        target_data = lock_user(VERIFY_READ, arg2, target_datalen, 1);
+        if (!target_data) {
+            unlock_user_struct(target_header, arg1, 0);
+            return -TARGET_EFAULT;
+        }
+
+        for (i = 0; i < data_items; i++) {
+            data[i].effective = tswap32(target_data[i].effective);
+            data[i].permitted = tswap32(target_data[i].permitted);
+            data[i].inheritable = tswap32(target_data[i].inheritable);
+        }
+        unlock_user(target_data, arg2, 0);
+    }
+
+    ret = get_errno(capset(&header, arg2 ? data : NULL));
+
+    /* The kernel always updates version for both capget and capset */
+    target_header->version = tswap32(header.version);
+    unlock_user_struct(target_header, arg1, 1);
+    return ret;
+}
+
 IMPL(chdir)
 {
     char *p = lock_user_string(arg1);
@@ -11181,76 +11265,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_capget:
-    case TARGET_NR_capset:
-    {
-        struct target_user_cap_header *target_header;
-        struct target_user_cap_data *target_data = NULL;
-        struct __user_cap_header_struct header;
-        struct __user_cap_data_struct data[2];
-        struct __user_cap_data_struct *dataptr = NULL;
-        int i, target_datalen;
-        int data_items = 1;
-
-        if (!lock_user_struct(VERIFY_WRITE, target_header, arg1, 1)) {
-            return -TARGET_EFAULT;
-        }
-        header.version = tswap32(target_header->version);
-        header.pid = tswap32(target_header->pid);
-
-        if (header.version != _LINUX_CAPABILITY_VERSION) {
-            /* Version 2 and up takes pointer to two user_data structs */
-            data_items = 2;
-        }
-
-        target_datalen = sizeof(*target_data) * data_items;
-
-        if (arg2) {
-            if (num == TARGET_NR_capget) {
-                target_data = lock_user(VERIFY_WRITE, arg2, target_datalen, 0);
-            } else {
-                target_data = lock_user(VERIFY_READ, arg2, target_datalen, 1);
-            }
-            if (!target_data) {
-                unlock_user_struct(target_header, arg1, 0);
-                return -TARGET_EFAULT;
-            }
-
-            if (num == TARGET_NR_capset) {
-                for (i = 0; i < data_items; i++) {
-                    data[i].effective = tswap32(target_data[i].effective);
-                    data[i].permitted = tswap32(target_data[i].permitted);
-                    data[i].inheritable = tswap32(target_data[i].inheritable);
-                }
-            }
-
-            dataptr = data;
-        }
-
-        if (num == TARGET_NR_capget) {
-            ret = get_errno(capget(&header, dataptr));
-        } else {
-            ret = get_errno(capset(&header, dataptr));
-        }
-
-        /* The kernel always updates version for both capget and capset */
-        target_header->version = tswap32(header.version);
-        unlock_user_struct(target_header, arg1, 1);
-
-        if (arg2) {
-            if (num == TARGET_NR_capget) {
-                for (i = 0; i < data_items; i++) {
-                    target_data[i].effective = tswap32(data[i].effective);
-                    target_data[i].permitted = tswap32(data[i].permitted);
-                    target_data[i].inheritable = tswap32(data[i].inheritable);
-                }
-                unlock_user(target_data, arg2, target_datalen);
-            } else {
-                unlock_user(target_data, arg2, 0);
-            }
-        }
-        return ret;
-    }
 #ifdef CONFIG_SENDFILE
     case TARGET_NR_sendfile:
     {
@@ -12991,6 +13005,8 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(bind);
 #endif
         SYSCALL(brk);
+        SYSCALL(capget);
+        SYSCALL(capset);
 #ifdef CONFIG_CLOCK_ADJTIME
         SYSCALL(clock_adjtime);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 069/108] linux-user: Split out sendfile, sendfile64
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (67 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 068/108] linux-user: Split out capget, capset Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 070/108] linux-user: Split out ftruncate64, truncate64, ugetrlimit, vfork Richard Henderson
                   ` (42 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 92 +++++++++++++++++++++++---------------------
 1 file changed, 48 insertions(+), 44 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index c906719152..39e416db0b 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -10284,6 +10284,48 @@ IMPL(send)
 }
 #endif
 
+#ifdef CONFIG_SENDFILE
+IMPL(sendfile)
+{
+    abi_long ret;
+    off_t off;
+
+    if (!arg3) {
+        return get_errno(sendfile(arg1, arg2, NULL, arg4));
+    }
+
+    if (get_user_sal(off, arg3)) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(sendfile(arg1, arg2, &off, arg4));
+    if (!is_error(ret) && arg3 && put_user_sal(off, arg3)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+
+# ifdef TARGET_NR_sendfile64
+IMPL(sendfile64)
+{
+    abi_long ret;
+    off_t off;
+
+    if (!arg3) {
+        return get_errno(sendfile(arg1, arg2, NULL, arg4));
+    }
+
+    if (get_user_s64(off, arg3)) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(sendfile(arg1, arg2, &off, arg4));
+    if (!is_error(ret) && arg3 && put_user_s64(off, arg3)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+# endif
+#endif /* CONFIG_SENDFILE */
+
 #ifdef TARGET_NR_sendmsg
 IMPL(sendmsg)
 {
@@ -11265,50 +11307,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef CONFIG_SENDFILE
-    case TARGET_NR_sendfile:
-    {
-        off_t *offp = NULL;
-        off_t off;
-        if (arg3) {
-            ret = get_user_sal(off, arg3);
-            if (is_error(ret)) {
-                return ret;
-            }
-            offp = &off;
-        }
-        ret = get_errno(sendfile(arg1, arg2, offp, arg4));
-        if (!is_error(ret) && arg3) {
-            abi_long ret2 = put_user_sal(off, arg3);
-            if (is_error(ret2)) {
-                ret = ret2;
-            }
-        }
-        return ret;
-    }
-#ifdef TARGET_NR_sendfile64
-    case TARGET_NR_sendfile64:
-    {
-        off_t *offp = NULL;
-        off_t off;
-        if (arg3) {
-            ret = get_user_s64(off, arg3);
-            if (is_error(ret)) {
-                return ret;
-            }
-            offp = &off;
-        }
-        ret = get_errno(sendfile(arg1, arg2, offp, arg4));
-        if (!is_error(ret) && arg3) {
-            abi_long ret2 = put_user_s64(off, arg3);
-            if (is_error(ret2)) {
-                ret = ret2;
-            }
-        }
-        return ret;
-    }
-#endif
-#endif
 #ifdef TARGET_NR_vfork
     case TARGET_NR_vfork:
         return get_errno(do_fork(cpu_env,
@@ -13270,6 +13268,12 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_send
         SYSCALL(send);
 #endif
+#ifdef CONFIG_SENDFILE
+        SYSCALL(sendfile);
+# ifdef TARGET_NR_sendfile64
+        SYSCALL(sendfile64);
+# endif
+#endif
 #ifdef TARGET_NR_sendmmsg
         SYSCALL(sendmmsg);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 070/108] linux-user: Split out ftruncate64, truncate64, ugetrlimit, vfork
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (68 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 069/108] linux-user: Split out sendfile, sendfile64 Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 071/108] linux-user: Split out fstat64, fstatat64, newfstatat, lstat64, stat64 Richard Henderson
                   ` (41 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 133 +++++++++++++++++++++++--------------------
 1 file changed, 70 insertions(+), 63 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 39e416db0b..c2dc7131bb 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6718,34 +6718,6 @@ static inline uint64_t target_offset64(uint64_t word0, uint64_t word1)
 }
 #endif /* TARGET_ABI_BITS != 32 */
 
-#ifdef TARGET_NR_truncate64
-static inline abi_long target_truncate64(void *cpu_env, const char *arg1,
-                                         abi_long arg2,
-                                         abi_long arg3,
-                                         abi_long arg4)
-{
-    if (regpairs_aligned(cpu_env, TARGET_NR_truncate64)) {
-        arg2 = arg3;
-        arg3 = arg4;
-    }
-    return get_errno(truncate64(arg1, target_offset64(arg2, arg3)));
-}
-#endif
-
-#ifdef TARGET_NR_ftruncate64
-static inline abi_long target_ftruncate64(void *cpu_env, abi_long arg1,
-                                          abi_long arg2,
-                                          abi_long arg3,
-                                          abi_long arg4)
-{
-    if (regpairs_aligned(cpu_env, TARGET_NR_ftruncate64)) {
-        arg2 = arg3;
-        arg3 = arg4;
-    }
-    return get_errno(ftruncate64(arg1, target_offset64(arg2, arg3)));
-}
-#endif
-
 static inline abi_long target_to_host_timespec(struct timespec *host_ts,
                                                abi_ulong target_addr)
 {
@@ -8204,6 +8176,17 @@ IMPL(ftruncate)
     return get_errno(ftruncate(arg1, arg2));
 }
 
+#ifdef TARGET_NR_ftruncate64
+IMPL(ftruncate64)
+{
+    if (regpairs_aligned(cpu_env, TARGET_NR_ftruncate64)) {
+        arg2 = arg3;
+        arg3 = arg4;
+    }
+    return get_errno(ftruncate64(arg1, target_offset64(arg2, arg3)));
+}
+#endif
+
 #ifdef TARGET_NR_futimesat
 IMPL(futimesat)
 {
@@ -11048,6 +11031,45 @@ IMPL(truncate)
     return ret;
 }
 
+#ifdef TARGET_NR_truncate64
+IMPL(truncate64)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    if (regpairs_aligned(cpu_env, TARGET_NR_truncate64)) {
+        arg2 = arg3;
+        arg3 = arg4;
+    }
+    ret = get_errno(truncate64(p, target_offset64(arg2, arg3)));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+#endif
+
+#ifdef TARGET_NR_ugetrlimit
+IMPL(ugetrlimit)
+{
+    struct rlimit rlim;
+    int resource = target_to_host_resource(arg1);
+    abi_long ret = get_errno(getrlimit(resource, &rlim));
+
+    if (!is_error(ret)) {
+        struct target_rlimit *target_rlim;
+        if (!lock_user_struct(VERIFY_WRITE, target_rlim, arg2, 0)) {
+            return -TARGET_EFAULT;
+        }
+        target_rlim->rlim_cur = host_to_target_rlim(rlim.rlim_cur);
+        target_rlim->rlim_max = host_to_target_rlim(rlim.rlim_max);
+        unlock_user_struct(target_rlim, arg2, 1);
+    }
+    return ret;
+}
+#endif
+
 IMPL(umask)
 {
     return get_errno(umask(arg1));
@@ -11183,6 +11205,14 @@ IMPL(utimes)
 }
 #endif
 
+#ifdef TARGET_NR_vfork
+IMPL(vfork)
+{
+    return get_errno(do_fork(cpu_env, CLONE_VFORK | CLONE_VM | TARGET_SIGCHLD,
+                             0, 0, 0, 0));
+}
+#endif
+
 IMPL(vhangup)
 {
     return get_errno(vhangup());
@@ -11307,41 +11337,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_vfork
-    case TARGET_NR_vfork:
-        return get_errno(do_fork(cpu_env,
-                         CLONE_VFORK | CLONE_VM | TARGET_SIGCHLD,
-                         0, 0, 0, 0));
-#endif
-#ifdef TARGET_NR_ugetrlimit
-    case TARGET_NR_ugetrlimit:
-    {
-	struct rlimit rlim;
-	int resource = target_to_host_resource(arg1);
-	ret = get_errno(getrlimit(resource, &rlim));
-	if (!is_error(ret)) {
-	    struct target_rlimit *target_rlim;
-            if (!lock_user_struct(VERIFY_WRITE, target_rlim, arg2, 0))
-                return -TARGET_EFAULT;
-	    target_rlim->rlim_cur = host_to_target_rlim(rlim.rlim_cur);
-	    target_rlim->rlim_max = host_to_target_rlim(rlim.rlim_max);
-            unlock_user_struct(target_rlim, arg2, 1);
-	}
-        return ret;
-    }
-#endif
-#ifdef TARGET_NR_truncate64
-    case TARGET_NR_truncate64:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-	ret = target_truncate64(cpu_env, p, arg2, arg3, arg4);
-        unlock_user(p, arg1, 0);
-        return ret;
-#endif
-#ifdef TARGET_NR_ftruncate64
-    case TARGET_NR_ftruncate64:
-        return target_ftruncate64(cpu_env, arg1, arg2, arg3, arg4);
-#endif
 #ifdef TARGET_NR_stat64
     case TARGET_NR_stat64:
         if (!(p = lock_user_string(arg1))) {
@@ -13052,6 +13047,9 @@ static impl_fn *syscall_table(unsigned num)
 #endif
         SYSCALL(fsync);
         SYSCALL(ftruncate);
+#ifdef TARGET_NR_ftruncate64
+        SYSCALL(ftruncate64);
+#endif
 #ifdef TARGET_NR_futimesat
         SYSCALL(futimesat);
 #endif
@@ -13352,6 +13350,12 @@ static impl_fn *syscall_table(unsigned num)
 #endif
         SYSCALL(times);
         SYSCALL(truncate);
+#ifdef TARGET_NR_truncate64
+        SYSCALL(truncate64);
+#endif
+#ifdef TARGET_NR_ugetrlimit
+        SYSCALL(ugetrlimit);
+#endif
         SYSCALL(umask);
 #ifdef TARGET_NR_umount
         SYSCALL(umount);
@@ -13367,6 +13371,9 @@ static impl_fn *syscall_table(unsigned num)
 #endif
 #ifdef TARGET_NR_utimes
         SYSCALL(utimes);
+#endif
+#ifdef TARGET_NR_vfork
+        SYSCALL(vfork);
 #endif
         SYSCALL(vhangup);
 #if defined(TARGET_I386) && !defined(TARGET_X86_64)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 071/108] linux-user: Split out fstat64, fstatat64, newfstatat, lstat64, stat64
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (69 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 070/108] linux-user: Split out ftruncate64, truncate64, ugetrlimit, vfork Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 072/108] linux-user: Split out getegid, geteuid, getgid, getuid, lchown Richard Henderson
                   ` (40 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Comment on the odd overlap of fstatat64 and newfstatat,
especially with respect to nios2.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 135 ++++++++++++++++++++++++++++---------------
 1 file changed, 89 insertions(+), 46 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index c2dc7131bb..8d6b949b8a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8140,6 +8140,42 @@ IMPL(fstat)
     return ret;
 }
 
+#ifdef TARGET_NR_fstat64
+IMPL(fstat64)
+{
+    struct stat st;
+    abi_long ret;
+
+    ret = get_errno(fstat(arg1, &st));
+    if (!is_error(ret) && host_to_target_stat64(cpu_env, arg2, &st)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+#endif
+
+/* Some targets name this syscall newfstatat, with the same arguments.  */
+/* ??? Our nios2/syscall_nr.h defines both names; the kernel does not.
+ * Preserve previous behavior and map both syscalls to this function.
+ */
+IMPL(fstatat64)
+{
+    char *p;
+    abi_long ret;
+    struct stat st;
+
+    p = lock_user_string(arg2);
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(fstatat(arg1, path(p), &st, arg4));
+    unlock_user(p, arg2, 0);
+    if (!is_error(ret) && host_to_target_stat64(cpu_env, arg3, &st)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+
 IMPL(fstatfs)
 {
     struct statfs stfs;
@@ -8815,6 +8851,25 @@ IMPL(lstat)
 }
 #endif
 
+#ifdef TARGET_NR_lstat64
+IMPL(lstat64)
+{
+    char *p = lock_user_string(arg1);
+    struct stat st;
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(lstat(path(p), &st));
+    unlock_user(p, arg1, 0);
+    if (!is_error(ret) && host_to_target_stat64(cpu_env, arg2, &st)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_mkdir
 IMPL(mkdir)
 {
@@ -10790,6 +10845,25 @@ IMPL(stat)
 }
 #endif
 
+#ifdef TARGET_NR_stat64
+IMPL(stat64)
+{
+    char *p = lock_user_string(arg1);
+    struct stat st;
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(stat(path(p), &st));
+    unlock_user(p, arg1, 0);
+    if (!is_error(ret) && host_to_target_stat64(cpu_env, arg2, &st)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+#endif
+
 IMPL(statfs)
 {
     char *p = lock_user_string(arg1);
@@ -11333,55 +11407,9 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
 {
     CPUState *cpu __attribute__((unused)) = ENV_GET_CPU(cpu_env);
     abi_long ret;
-    struct stat st;
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_stat64
-    case TARGET_NR_stat64:
-        if (!(p = lock_user_string(arg1))) {
-            return -TARGET_EFAULT;
-        }
-        ret = get_errno(stat(path(p), &st));
-        unlock_user(p, arg1, 0);
-        if (!is_error(ret))
-            ret = host_to_target_stat64(cpu_env, arg2, &st);
-        return ret;
-#endif
-#ifdef TARGET_NR_lstat64
-    case TARGET_NR_lstat64:
-        if (!(p = lock_user_string(arg1))) {
-            return -TARGET_EFAULT;
-        }
-        ret = get_errno(lstat(path(p), &st));
-        unlock_user(p, arg1, 0);
-        if (!is_error(ret))
-            ret = host_to_target_stat64(cpu_env, arg2, &st);
-        return ret;
-#endif
-#ifdef TARGET_NR_fstat64
-    case TARGET_NR_fstat64:
-        ret = get_errno(fstat(arg1, &st));
-        if (!is_error(ret))
-            ret = host_to_target_stat64(cpu_env, arg2, &st);
-        return ret;
-#endif
-#if (defined(TARGET_NR_fstatat64) || defined(TARGET_NR_newfstatat))
-#ifdef TARGET_NR_fstatat64
-    case TARGET_NR_fstatat64:
-#endif
-#ifdef TARGET_NR_newfstatat
-    case TARGET_NR_newfstatat:
-#endif
-        if (!(p = lock_user_string(arg2))) {
-            return -TARGET_EFAULT;
-        }
-        ret = get_errno(fstatat(arg1, path(p), &st, arg4));
-        unlock_user(p, arg2, 0);
-        if (!is_error(ret))
-            ret = host_to_target_stat64(cpu_env, arg3, &st);
-        return ret;
-#endif
 #ifdef TARGET_NR_lchown
     case TARGET_NR_lchown:
         if (!(p = lock_user_string(arg1)))
@@ -13041,6 +13069,12 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(fork);
 #endif
         SYSCALL(fstat);
+#ifdef TARGET_NR_fstat64
+        SYSCALL(fstat64);
+#endif
+#ifdef TARGET_NR_fstatat64
+        SYSCALL(fstatat64);
+#endif
         SYSCALL(fstatfs);
 #ifdef TARGET_NR_fstatfs64
         SYSCALL(fstatfs64);
@@ -13109,6 +13143,9 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_lstat
         SYSCALL(lstat);
 #endif
+#ifdef TARGET_NR_lstat64
+        SYSCALL(lstat64);
+#endif
 #ifdef TARGET_NR_mkdir
         SYSCALL(mkdir);
 #endif
@@ -13151,6 +13188,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(name_to_handle_at);
 #endif
         SYSCALL(nanosleep);
+#ifdef TARGET_NR_newfstatat
+        SYSCALL_WITH(newfstatat, fstatat64);
+#endif
 #ifdef TARGET_NR__newselect
         SYSCALL(_newselect);
 #endif
@@ -13322,6 +13362,9 @@ static impl_fn *syscall_table(unsigned num)
 #endif
 #ifdef TARGET_NR_stat
         SYSCALL(stat);
+#endif
+#ifdef TARGET_NR_stat64
+        SYSCALL(stat64);
 #endif
         SYSCALL(statfs);
 #ifdef TARGET_NR_statfs64
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 072/108] linux-user: Split out getegid, geteuid, getgid, getuid, lchown
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (70 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 071/108] linux-user: Split out fstat64, fstatat64, newfstatat, lstat64, stat64 Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 073/108] linux-user: Split out getgroups, setgroups, setregid, setreuid Richard Henderson
                   ` (39 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 82 +++++++++++++++++++++++++++++++-------------
 1 file changed, 58 insertions(+), 24 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8d6b949b8a..f8e34d28b1 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8441,6 +8441,27 @@ IMPL(getdents64)
 }
 #endif /* TARGET_NR_getdents64 */
 
+#ifdef TARGET_NR_getegid
+IMPL(getegid)
+{
+    return get_errno(high2lowgid(getegid()));
+}
+#endif
+
+#ifdef TARGET_NR_geteuid
+IMPL(geteuid)
+{
+    return get_errno(high2lowuid(geteuid()));
+}
+#endif
+
+#ifdef TARGET_NR_getgid
+IMPL(getgid)
+{
+    return get_errno(high2lowgid(getgid()));
+}
+#endif
+
 IMPL(getitimer)
 {
     struct itimerval value;
@@ -8584,6 +8605,13 @@ IMPL(gettimeofday)
     return ret;
 }
 
+#ifdef TARGET_NR_getuid
+IMPL(getuid)
+{
+    return get_errno(high2lowuid(getuid()));
+}
+#endif
+
 #if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
 IMPL(getxpid)
 {
@@ -8769,6 +8797,21 @@ IMPL(kill)
     return get_errno(safe_kill(arg1, target_to_host_signal(arg2)));
 }
 
+#ifdef TARGET_NR_lchown
+IMPL(lchown)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(lchown(p, low2highuid(arg2), low2highgid(arg3)));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_link
 IMPL(link)
 {
@@ -11410,30 +11453,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_lchown
-    case TARGET_NR_lchown:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(lchown(p, low2highuid(arg2), low2highgid(arg3)));
-        unlock_user(p, arg1, 0);
-        return ret;
-#endif
-#ifdef TARGET_NR_getuid
-    case TARGET_NR_getuid:
-        return get_errno(high2lowuid(getuid()));
-#endif
-#ifdef TARGET_NR_getgid
-    case TARGET_NR_getgid:
-        return get_errno(high2lowgid(getgid()));
-#endif
-#ifdef TARGET_NR_geteuid
-    case TARGET_NR_geteuid:
-        return get_errno(high2lowuid(geteuid()));
-#endif
-#ifdef TARGET_NR_getegid
-    case TARGET_NR_getegid:
-        return get_errno(high2lowgid(getegid()));
-#endif
     case TARGET_NR_setreuid:
         return get_errno(setreuid(low2highuid(arg1), low2highuid(arg2)));
     case TARGET_NR_setregid:
@@ -13094,6 +13113,15 @@ static impl_fn *syscall_table(unsigned num)
 #endif
 #if defined(TARGET_NR_getdents64) && defined(__NR_getdents64)
         SYSCALL(getdents64);
+#endif
+#ifdef TARGET_NR_getegid
+        SYSCALL(getegid);
+#endif
+#ifdef TARGET_NR_geteuid
+        SYSCALL(geteuid);
+#endif
+#ifdef TARGET_NR_getgid
+        SYSCALL(getgid);
 #endif
         SYSCALL(getitimer);
 #ifdef TARGET_NR_getpeername
@@ -13121,6 +13149,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(getsockopt);
 #endif
         SYSCALL(gettimeofday);
+#ifdef TARGET_NR_getuid
+        SYSCALL(getuid);
+#endif
 #if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
         SYSCALL(getxpid);
 #endif
@@ -13129,6 +13160,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(ipc);
 #endif
         SYSCALL(kill);
+#ifdef TARGET_NR_lchown
+        SYSCALL(lchown);
+#endif
 #ifdef TARGET_NR_link
         SYSCALL(link);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 073/108] linux-user: Split out getgroups, setgroups, setregid, setreuid
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (71 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 072/108] linux-user: Split out getegid, geteuid, getgid, getuid, lchown Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 074/108] linux-user: Split out fchown, fchownat, setresgid, setresuid Richard Henderson
                   ` (38 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 107 +++++++++++++++++++++++++------------------
 1 file changed, 63 insertions(+), 44 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index f8e34d28b1..915e1f1a91 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8462,6 +8462,32 @@ IMPL(getgid)
 }
 #endif
 
+IMPL(getgroups)
+{
+    int gidsetsize = arg1;
+    gid_t *grouplist;
+    abi_long ret;
+
+    grouplist = alloca(gidsetsize * sizeof(gid_t));
+    ret = get_errno(getgroups(gidsetsize, grouplist));
+
+    if (!is_error(ret) && gidsetsize != 0) {
+        target_id *target_gl;
+        int i;
+
+        target_gl = lock_user(VERIFY_WRITE, arg2,
+                              gidsetsize * sizeof(target_id), 0);
+        if (!target_gl) {
+            return -TARGET_EFAULT;
+        }
+        for (i = 0; i < ret; i++) {
+            target_gl[i] = tswapid(high2lowgid(grouplist[i]));
+        }
+        unlock_user(target_gl, arg2, gidsetsize * sizeof(target_id));
+    }
+    return ret;
+}
+
 IMPL(getitimer)
 {
     struct itimerval value;
@@ -10441,6 +10467,29 @@ IMPL(setdomainname)
     return ret;
 }
 
+IMPL(setgroups)
+{
+    int gidsetsize = arg1;
+    gid_t *grouplist = NULL;
+
+    if (gidsetsize) {
+        target_id *target_gl;
+        int i;
+
+        grouplist = alloca(gidsetsize * sizeof(gid_t));
+        target_gl = lock_user(VERIFY_READ, arg2,
+                              gidsetsize * sizeof(target_id), 1);
+        if (!target_gl) {
+            return -TARGET_EFAULT;
+        }
+        for (i = 0; i < gidsetsize; i++) {
+            grouplist[i] = low2highgid(tswapid(target_gl[i]));
+        }
+        unlock_user(target_gl, arg2, 0);
+    }
+    return get_errno(setgroups(gidsetsize, grouplist));
+}
+
 IMPL(sethostname)
 {
     char *p = lock_user_string(arg1);
@@ -10486,6 +10535,16 @@ IMPL(setpriority)
     return get_errno(setpriority(arg1, arg2, arg3));
 }
 
+IMPL(setregid)
+{
+    return get_errno(setregid(low2highgid(arg1), low2highgid(arg2)));
+}
+
+IMPL(setreuid)
+{
+    return get_errno(setreuid(low2highuid(arg1), low2highuid(arg2)));
+}
+
 IMPL(setrlimit)
 {
     int resource = target_to_host_resource(arg1);
@@ -11453,50 +11512,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_setreuid:
-        return get_errno(setreuid(low2highuid(arg1), low2highuid(arg2)));
-    case TARGET_NR_setregid:
-        return get_errno(setregid(low2highgid(arg1), low2highgid(arg2)));
-    case TARGET_NR_getgroups:
-        {
-            int gidsetsize = arg1;
-            target_id *target_grouplist;
-            gid_t *grouplist;
-            int i;
-
-            grouplist = alloca(gidsetsize * sizeof(gid_t));
-            ret = get_errno(getgroups(gidsetsize, grouplist));
-            if (gidsetsize == 0)
-                return ret;
-            if (!is_error(ret)) {
-                target_grouplist = lock_user(VERIFY_WRITE, arg2, gidsetsize * sizeof(target_id), 0);
-                if (!target_grouplist)
-                    return -TARGET_EFAULT;
-                for(i = 0;i < ret; i++)
-                    target_grouplist[i] = tswapid(high2lowgid(grouplist[i]));
-                unlock_user(target_grouplist, arg2, gidsetsize * sizeof(target_id));
-            }
-        }
-        return ret;
-    case TARGET_NR_setgroups:
-        {
-            int gidsetsize = arg1;
-            target_id *target_grouplist;
-            gid_t *grouplist = NULL;
-            int i;
-            if (gidsetsize) {
-                grouplist = alloca(gidsetsize * sizeof(gid_t));
-                target_grouplist = lock_user(VERIFY_READ, arg2, gidsetsize * sizeof(target_id), 1);
-                if (!target_grouplist) {
-                    return -TARGET_EFAULT;
-                }
-                for (i = 0; i < gidsetsize; i++) {
-                    grouplist[i] = low2highgid(tswapid(target_grouplist[i]));
-                }
-                unlock_user(target_grouplist, arg2, 0);
-            }
-            return get_errno(setgroups(gidsetsize, grouplist));
-        }
     case TARGET_NR_fchown:
         return get_errno(fchown(arg1, low2highuid(arg2), low2highgid(arg3)));
 #if defined(TARGET_NR_fchownat)
@@ -13123,6 +13138,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_getgid
         SYSCALL(getgid);
 #endif
+        SYSCALL(getgroups);
         SYSCALL(getitimer);
 #ifdef TARGET_NR_getpeername
         SYSCALL(getpeername);
@@ -13356,10 +13372,13 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(sendto);
 #endif
         SYSCALL(setdomainname);
+        SYSCALL(setgroups);
         SYSCALL(sethostname);
         SYSCALL(setitimer);
         SYSCALL(setpgid);
         SYSCALL(setpriority);
+        SYSCALL(setregid);
+        SYSCALL(setreuid);
         SYSCALL(setrlimit);
 #ifdef TARGET_NR_setsockopt
         SYSCALL(setsockopt);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 074/108] linux-user: Split out fchown, fchownat, setresgid, setresuid
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (72 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 073/108] linux-user: Split out getgroups, setgroups, setregid, setreuid Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 075/108] linux-user: Split out chown, getresgid, getresuid Richard Henderson
                   ` (37 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define fchownat; remove the ifdef.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 66 +++++++++++++++++++++++++++++---------------
 1 file changed, 43 insertions(+), 23 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 915e1f1a91..75b869fb33 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8103,6 +8103,25 @@ IMPL(fchmodat)
     return ret;
 }
 
+IMPL(fchown)
+{
+    return get_errno(fchown(arg1, low2highuid(arg2), low2highgid(arg3)));
+}
+
+IMPL(fchownat)
+{
+    char *p = lock_user_string(arg2);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(fchownat(arg1, p, low2highuid(arg3),
+                             low2highgid(arg4), arg5));
+    unlock_user(p, arg2, 0);
+    return ret;
+}
+
 #ifdef TARGET_NR_fcntl
 IMPL(fcntl)
 {
@@ -10540,6 +10559,22 @@ IMPL(setregid)
     return get_errno(setregid(low2highgid(arg1), low2highgid(arg2)));
 }
 
+#ifdef TARGET_NR_setresgid
+IMPL(setresgid)
+{
+    return get_errno(sys_setresgid(low2highgid(arg1), low2highgid(arg2),
+                                   low2highgid(arg3)));
+}
+#endif
+
+#ifdef TARGET_NR_setresuid
+IMPL(setresuid)
+{
+    return get_errno(sys_setresuid(low2highuid(arg1), low2highuid(arg2),
+                                   low2highuid(arg3)));
+}
+#endif
+
 IMPL(setreuid)
 {
     return get_errno(setreuid(low2highuid(arg1), low2highuid(arg2)));
@@ -11512,23 +11547,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_fchown:
-        return get_errno(fchown(arg1, low2highuid(arg2), low2highgid(arg3)));
-#if defined(TARGET_NR_fchownat)
-    case TARGET_NR_fchownat:
-        if (!(p = lock_user_string(arg2))) 
-            return -TARGET_EFAULT;
-        ret = get_errno(fchownat(arg1, p, low2highuid(arg3),
-                                 low2highgid(arg4), arg5));
-        unlock_user(p, arg2, 0);
-        return ret;
-#endif
-#ifdef TARGET_NR_setresuid
-    case TARGET_NR_setresuid:
-        return get_errno(sys_setresuid(low2highuid(arg1),
-                                       low2highuid(arg2),
-                                       low2highuid(arg3)));
-#endif
 #ifdef TARGET_NR_getresuid
     case TARGET_NR_getresuid:
         {
@@ -11543,12 +11561,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
         }
         return ret;
 #endif
-#ifdef TARGET_NR_getresgid
-    case TARGET_NR_setresgid:
-        return get_errno(sys_setresgid(low2highgid(arg1),
-                                       low2highgid(arg2),
-                                       low2highgid(arg3)));
-#endif
 #ifdef TARGET_NR_getresgid
     case TARGET_NR_getresgid:
         {
@@ -13094,6 +13106,8 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(fchdir);
         SYSCALL(fchmod);
         SYSCALL(fchmodat);
+        SYSCALL(fchown);
+        SYSCALL(fchownat);
 #ifdef TARGET_NR_fcntl
         SYSCALL(fcntl);
 #endif
@@ -13378,6 +13392,12 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(setpgid);
         SYSCALL(setpriority);
         SYSCALL(setregid);
+#ifdef TARGET_NR_setresgid
+        SYSCALL(setresgid);
+#endif
+#ifdef TARGET_NR_setresuid
+        SYSCALL(setresuid);
+#endif
         SYSCALL(setreuid);
         SYSCALL(setrlimit);
 #ifdef TARGET_NR_setsockopt
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 075/108] linux-user: Split out chown, getresgid, getresuid
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (73 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 074/108] linux-user: Split out fchown, fchownat, setresgid, setresuid Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 076/108] linux-user: Split out setfsgid, setfsuid, setgid, setuid Richard Henderson
                   ` (36 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 94 +++++++++++++++++++++++++++-----------------
 1 file changed, 57 insertions(+), 37 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 75b869fb33..c55c414239 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7787,6 +7787,21 @@ IMPL(chmod)
 }
 #endif
 
+#ifdef TARGET_NR_chown
+IMPL(chown)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(chown(p, low2highuid(arg2), low2highgid(arg3)));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+#endif
+
 IMPL(chroot)
 {
     char *p = lock_user_string(arg1);
@@ -8588,6 +8603,38 @@ IMPL(getrandom)
     return ret;
 }
 
+#ifdef TARGET_NR_getresgid
+IMPL(getresgid)
+{
+    gid_t rgid, egid, sgid;
+    abi_long ret = get_errno(getresgid(&rgid, &egid, &sgid));
+
+    if (!is_error(ret) &&
+        (put_user_id(high2lowgid(rgid), arg1) ||
+         put_user_id(high2lowgid(egid), arg2) ||
+         put_user_id(high2lowgid(sgid), arg3))) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+#endif
+
+#ifdef TARGET_NR_getresuid
+IMPL(getresuid)
+{
+    uid_t ruid, euid, suid;
+    abi_long ret = get_errno(getresuid(&ruid, &euid, &suid));
+
+    if (!is_error(ret) &&
+        (put_user_id(high2lowuid(ruid), arg1) ||
+         put_user_id(high2lowuid(euid), arg2) ||
+         put_user_id(high2lowuid(suid), arg3))) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+#endif
+
 IMPL(getrlimit)
 {
     int resource = target_to_host_resource(arg1);
@@ -11547,42 +11594,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_getresuid
-    case TARGET_NR_getresuid:
-        {
-            uid_t ruid, euid, suid;
-            ret = get_errno(getresuid(&ruid, &euid, &suid));
-            if (!is_error(ret)) {
-                if (put_user_id(high2lowuid(ruid), arg1)
-                    || put_user_id(high2lowuid(euid), arg2)
-                    || put_user_id(high2lowuid(suid), arg3))
-                    return -TARGET_EFAULT;
-            }
-        }
-        return ret;
-#endif
-#ifdef TARGET_NR_getresgid
-    case TARGET_NR_getresgid:
-        {
-            gid_t rgid, egid, sgid;
-            ret = get_errno(getresgid(&rgid, &egid, &sgid));
-            if (!is_error(ret)) {
-                if (put_user_id(high2lowgid(rgid), arg1)
-                    || put_user_id(high2lowgid(egid), arg2)
-                    || put_user_id(high2lowgid(sgid), arg3))
-                    return -TARGET_EFAULT;
-            }
-        }
-        return ret;
-#endif
-#ifdef TARGET_NR_chown
-    case TARGET_NR_chown:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(chown(p, low2highuid(arg2), low2highgid(arg3)));
-        unlock_user(p, arg1, 0);
-        return ret;
-#endif
     case TARGET_NR_setuid:
         return get_errno(sys_setuid(low2highuid(arg1)));
     case TARGET_NR_setgid:
@@ -13080,10 +13091,13 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(clone);
         SYSCALL(close);
         SYSCALL(chdir);
-        SYSCALL(chroot);
 #ifdef TARGET_NR_chmod
         SYSCALL(chmod);
 #endif
+#ifdef TARGET_NR_chown
+        SYSCALL(chown);
+#endif
+        SYSCALL(chroot);
 #ifdef TARGET_NR_connect
         SYSCALL(connect);
 #endif
@@ -13169,6 +13183,12 @@ static impl_fn *syscall_table(unsigned num)
 #endif
         SYSCALL(getpriority);
         SYSCALL(getrandom);
+#ifdef TARGET_NR_getresgid
+        SYSCALL(getresgid);
+#endif
+#ifdef TARGET_NR_getresuid
+        SYSCALL(getresuid);
+#endif
         SYSCALL(getrlimit);
         SYSCALL(getrusage);
         SYSCALL(getsid);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 076/108] linux-user: Split out setfsgid, setfsuid, setgid, setuid
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (74 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 075/108] linux-user: Split out chown, getresgid, getresuid Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 077/108] linux-user: Split out getuid32, getxgid, getxuid, lchown32 Richard Henderson
                   ` (35 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 33 ++++++++++++++++++++++++---------
 1 file changed, 24 insertions(+), 9 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index c55c414239..76a66b56fe 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -10533,6 +10533,21 @@ IMPL(setdomainname)
     return ret;
 }
 
+IMPL(setfsgid)
+{
+    return get_errno(setfsgid(arg1));
+}
+
+IMPL(setfsuid)
+{
+    return get_errno(setfsuid(arg1));
+}
+
+IMPL(setgid)
+{
+    return get_errno(sys_setgid(low2highgid(arg1)));
+}
+
 IMPL(setgroups)
 {
     int gidsetsize = arg1;
@@ -10668,6 +10683,11 @@ IMPL(setsid)
     return get_errno(setsid());
 }
 
+IMPL(setuid)
+{
+    return get_errno(sys_setuid(low2highuid(arg1)));
+}
+
 #ifdef TARGET_NR_sigaction
 IMPL(sigaction)
 {
@@ -11594,15 +11614,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_setuid:
-        return get_errno(sys_setuid(low2highuid(arg1)));
-    case TARGET_NR_setgid:
-        return get_errno(sys_setgid(low2highgid(arg1)));
-    case TARGET_NR_setfsuid:
-        return get_errno(setfsuid(arg1));
-    case TARGET_NR_setfsgid:
-        return get_errno(setfsgid(arg1));
-
 #ifdef TARGET_NR_lchown32
     case TARGET_NR_lchown32:
         if (!(p = lock_user_string(arg1)))
@@ -13406,6 +13417,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(sendto);
 #endif
         SYSCALL(setdomainname);
+        SYSCALL(setfsgid);
+        SYSCALL(setfsuid);
+        SYSCALL(setgid);
         SYSCALL(setgroups);
         SYSCALL(sethostname);
         SYSCALL(setitimer);
@@ -13425,6 +13439,7 @@ static impl_fn *syscall_table(unsigned num)
 #endif
         SYSCALL(settimeofday);
         SYSCALL(setsid);
+        SYSCALL(setuid);
 #ifdef TARGET_NR_sigaction
         SYSCALL(sigaction);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 077/108] linux-user: Split out getuid32, getxgid, getxuid, lchown32
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (75 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 076/108] linux-user: Split out setfsgid, setfsuid, setgid, setuid Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 078/108] linux-user: Split out osf_getsysinfo, osf_setsysinfo, osf_sigprocmask Richard Henderson
                   ` (34 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 83 ++++++++++++++++++++++++++------------------
 1 file changed, 50 insertions(+), 33 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 76a66b56fe..17560ebd41 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8704,6 +8704,21 @@ IMPL(getuid)
 }
 #endif
 
+#ifdef TARGET_NR_getuid32
+IMPL(getuid32)
+{
+    return get_errno(getuid());
+}
+#endif
+
+#if defined(TARGET_NR_getxgid) && defined(TARGET_ALPHA)
+IMPL(getxgid)
+{
+    ((CPUAlphaState *)cpu_env)->ir[IR_A4] = getegid();
+    return get_errno(getgid());
+}
+#endif
+
 #if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
 IMPL(getxpid)
 {
@@ -8712,6 +8727,14 @@ IMPL(getxpid)
 }
 #endif
 
+#if defined(TARGET_NR_getxuid) && defined(TARGET_ALPHA)
+IMPL(getxuid)
+{
+    ((CPUAlphaState *)cpu_env)->ir[IR_A4] = geteuid();
+    return get_errno(getuid());
+}
+#endif
+
 /* ??? Implement proper locking for ioctls.  */
 IMPL(ioctl)
 {
@@ -8904,6 +8927,21 @@ IMPL(lchown)
 }
 #endif
 
+#ifdef TARGET_NR_lchown32
+IMPL(lchown32)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(lchown(p, arg2, arg3));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_link
 IMPL(link)
 {
@@ -11614,39 +11652,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_lchown32
-    case TARGET_NR_lchown32:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(lchown(p, arg2, arg3));
-        unlock_user(p, arg1, 0);
-        return ret;
-#endif
-#ifdef TARGET_NR_getuid32
-    case TARGET_NR_getuid32:
-        return get_errno(getuid());
-#endif
-
-#if defined(TARGET_NR_getxuid) && defined(TARGET_ALPHA)
-   /* Alpha specific */
-    case TARGET_NR_getxuid:
-         {
-            uid_t euid;
-            euid=geteuid();
-            ((CPUAlphaState *)cpu_env)->ir[IR_A4]=euid;
-         }
-        return get_errno(getuid());
-#endif
-#if defined(TARGET_NR_getxgid) && defined(TARGET_ALPHA)
-   /* Alpha specific */
-    case TARGET_NR_getxgid:
-         {
-            uid_t egid;
-            egid=getegid();
-            ((CPUAlphaState *)cpu_env)->ir[IR_A4]=egid;
-         }
-        return get_errno(getgid());
-#endif
 #if defined(TARGET_NR_osf_getsysinfo) && defined(TARGET_ALPHA)
     /* Alpha specific */
     case TARGET_NR_osf_getsysinfo:
@@ -13213,8 +13218,17 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_getuid
         SYSCALL(getuid);
 #endif
+#ifdef TARGET_NR_getuid32
+        SYSCALL(getuid32);
+#endif
+#if defined(TARGET_NR_getxgid) && defined(TARGET_ALPHA)
+        SYSCALL(getxgid);
+#endif
 #if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
         SYSCALL(getxpid);
+#endif
+#if defined(TARGET_NR_getxuid) && defined(TARGET_ALPHA)
+        SYSCALL(getxuid);
 #endif
         SYSCALL(ioctl);
 #ifdef TARGET_NR_ipc
@@ -13224,6 +13238,9 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_lchown
         SYSCALL(lchown);
 #endif
+#ifdef TARGET_NR_lchown32
+        SYSCALL(lchown32);
+#endif
 #ifdef TARGET_NR_link
         SYSCALL(link);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 078/108] linux-user: Split out osf_getsysinfo, osf_setsysinfo, osf_sigprocmask
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (76 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 077/108] linux-user: Split out getuid32, getxgid, getxuid, lchown32 Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 079/108] linux-user: Split out getegid32, geteuid32, getgid32, setregid32, setreuid32 Richard Henderson
                   ` (33 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 323 ++++++++++++++++++++++---------------------
 1 file changed, 162 insertions(+), 161 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 17560ebd41..ae591a6523 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9444,6 +9444,159 @@ IMPL(open_by_handle_at)
 }
 #endif
 
+#if defined(TARGET_NR_osf_getsysinfo) && defined(TARGET_ALPHA)
+IMPL(osf_getsysinfo)
+{
+    uint64_t swcr, fpcr;
+
+    switch (arg1) {
+    case TARGET_GSI_IEEE_FP_CONTROL:
+        fpcr = cpu_alpha_load_fpcr(cpu_env);
+
+        /* Copied from linux ieee_fpcr_to_swcr.  */
+        swcr = (fpcr >> 35) & SWCR_STATUS_MASK;
+        swcr |= (fpcr >> 36) & SWCR_MAP_DMZ;
+        swcr |= (~fpcr >> 48) & (SWCR_TRAP_ENABLE_INV
+                                | SWCR_TRAP_ENABLE_DZE
+                                | SWCR_TRAP_ENABLE_OVF);
+        swcr |= (~fpcr >> 57) & (SWCR_TRAP_ENABLE_UNF
+                                | SWCR_TRAP_ENABLE_INE);
+        swcr |= (fpcr >> 47) & SWCR_MAP_UMZ;
+        swcr |= (~fpcr >> 41) & SWCR_TRAP_ENABLE_DNO;
+
+        if (put_user_u64(swcr, arg2)) {
+            return -TARGET_EFAULT;
+        }
+        return 0;
+
+    default:
+        /* case GSI_IEEE_STATE_AT_SIGNAL:
+         * -- Not implemented in linux kernel.
+         * case GSI_UACPROC:
+         * -- Retrieves current unaligned access state; not much used.
+         * case GSI_PROC_TYPE:
+         * -- Retrieves implver information; surely not used.
+         * case GSI_GET_HWRPB:
+         * -- Grabs a copy of the HWRPB; surely not used.
+         */
+        return -TARGET_EOPNOTSUPP;
+    }
+}
+#endif
+
+#if defined(TARGET_NR_osf_setsysinfo) && defined(TARGET_ALPHA)
+IMPL(osf_setsysinfo)
+{
+    uint64_t swcr, fpcr, exc, orig_fpcr;
+    int si_code;
+
+    switch (arg1) {
+    case TARGET_SSI_IEEE_FP_CONTROL:
+        if (get_user_u64(swcr, arg2)) {
+            return -TARGET_EFAULT;
+        }
+        orig_fpcr = cpu_alpha_load_fpcr(cpu_env);
+        fpcr = orig_fpcr & FPCR_DYN_MASK;
+
+        /* Copied from linux ieee_swcr_to_fpcr.  */
+        fpcr |= (swcr & SWCR_STATUS_MASK) << 35;
+        fpcr |= (swcr & SWCR_MAP_DMZ) << 36;
+        fpcr |= (~swcr & (SWCR_TRAP_ENABLE_INV
+                          | SWCR_TRAP_ENABLE_DZE
+                          | SWCR_TRAP_ENABLE_OVF)) << 48;
+        fpcr |= (~swcr & (SWCR_TRAP_ENABLE_UNF
+                          | SWCR_TRAP_ENABLE_INE)) << 57;
+        fpcr |= (swcr & SWCR_MAP_UMZ ? FPCR_UNDZ | FPCR_UNFD : 0);
+        fpcr |= (~swcr & SWCR_TRAP_ENABLE_DNO) << 41;
+
+        cpu_alpha_store_fpcr(cpu_env, fpcr);
+        return 0;
+
+    case TARGET_SSI_IEEE_RAISE_EXCEPTION:
+        if (get_user_u64(exc, arg2)) {
+            return -TARGET_EFAULT;
+        }
+        orig_fpcr = cpu_alpha_load_fpcr(cpu_env);
+
+        /* We only add to the exception status here.  */
+        fpcr = orig_fpcr | ((exc & SWCR_STATUS_MASK) << 35);
+        cpu_alpha_store_fpcr(cpu_env, fpcr);
+
+        /* Old exceptions are not signaled.  */
+        fpcr &= ~(orig_fpcr & FPCR_STATUS_MASK);
+
+        /* If any exceptions set by this call,
+           and are unmasked, send a signal.  */
+        si_code = 0;
+        if ((fpcr & (FPCR_INE | FPCR_INED)) == FPCR_INE) {
+            si_code = TARGET_FPE_FLTRES;
+        }
+        if ((fpcr & (FPCR_UNF | FPCR_UNFD)) == FPCR_UNF) {
+            si_code = TARGET_FPE_FLTUND;
+        }
+        if ((fpcr & (FPCR_OVF | FPCR_OVFD)) == FPCR_OVF) {
+            si_code = TARGET_FPE_FLTOVF;
+        }
+        if ((fpcr & (FPCR_DZE | FPCR_DZED)) == FPCR_DZE) {
+            si_code = TARGET_FPE_FLTDIV;
+        }
+        if ((fpcr & (FPCR_INV | FPCR_INVD)) == FPCR_INV) {
+            si_code = TARGET_FPE_FLTINV;
+        }
+        if (si_code != 0) {
+            CPUAlphaState *env = cpu_env;
+            target_siginfo_t info;
+
+            info.si_signo = SIGFPE;
+            info.si_errno = 0;
+            info.si_code = si_code;
+            info._sifields._sigfault._addr = env->pc;
+            queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
+        }
+        return 0;
+
+    default:
+        /* case SSI_NVPAIRS:
+         * -- Used with SSIN_UACPROC to enable unaligned accesses.
+         * case SSI_IEEE_STATE_AT_SIGNAL:
+         * case SSI_IEEE_IGNORE_STATE_AT_SIGNAL:
+         * -- Not implemented in linux kernel
+         */
+        return -TARGET_EOPNOTSUPP;
+    }
+}
+#endif
+
+#if defined(TARGET_NR_osf_sigprocmask) && defined(TARGET_ALPHA)
+IMPL(osf_sigprocmask)
+{
+    abi_ulong mask = arg2;
+    int how;
+    sigset_t set, oldset;
+
+    switch (arg1) {
+    case TARGET_SIG_BLOCK:
+        how = SIG_BLOCK;
+        break;
+    case TARGET_SIG_UNBLOCK:
+        how = SIG_UNBLOCK;
+        break;
+    case TARGET_SIG_SETMASK:
+        how = SIG_SETMASK;
+        break;
+    default:
+        return -TARGET_EINVAL;
+    }
+    target_to_host_old_sigset(&set, &mask);
+    ret = do_sigprocmask(how, &set, &oldset);
+    if (!ret) {
+        host_to_target_old_sigset(&mask, &oldset);
+        ret = mask;
+    }
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_pause
 IMPL(pause)
 {
@@ -11652,167 +11805,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#if defined(TARGET_NR_osf_getsysinfo) && defined(TARGET_ALPHA)
-    /* Alpha specific */
-    case TARGET_NR_osf_getsysinfo:
-        ret = -TARGET_EOPNOTSUPP;
-        switch (arg1) {
-          case TARGET_GSI_IEEE_FP_CONTROL:
-            {
-                uint64_t swcr, fpcr = cpu_alpha_load_fpcr (cpu_env);
-
-                /* Copied from linux ieee_fpcr_to_swcr.  */
-                swcr = (fpcr >> 35) & SWCR_STATUS_MASK;
-                swcr |= (fpcr >> 36) & SWCR_MAP_DMZ;
-                swcr |= (~fpcr >> 48) & (SWCR_TRAP_ENABLE_INV
-                                        | SWCR_TRAP_ENABLE_DZE
-                                        | SWCR_TRAP_ENABLE_OVF);
-                swcr |= (~fpcr >> 57) & (SWCR_TRAP_ENABLE_UNF
-                                        | SWCR_TRAP_ENABLE_INE);
-                swcr |= (fpcr >> 47) & SWCR_MAP_UMZ;
-                swcr |= (~fpcr >> 41) & SWCR_TRAP_ENABLE_DNO;
-
-                if (put_user_u64 (swcr, arg2))
-                        return -TARGET_EFAULT;
-                ret = 0;
-            }
-            break;
-
-          /* case GSI_IEEE_STATE_AT_SIGNAL:
-             -- Not implemented in linux kernel.
-             case GSI_UACPROC:
-             -- Retrieves current unaligned access state; not much used.
-             case GSI_PROC_TYPE:
-             -- Retrieves implver information; surely not used.
-             case GSI_GET_HWRPB:
-             -- Grabs a copy of the HWRPB; surely not used.
-          */
-        }
-        return ret;
-#endif
-#if defined(TARGET_NR_osf_setsysinfo) && defined(TARGET_ALPHA)
-    /* Alpha specific */
-    case TARGET_NR_osf_setsysinfo:
-        ret = -TARGET_EOPNOTSUPP;
-        switch (arg1) {
-          case TARGET_SSI_IEEE_FP_CONTROL:
-            {
-                uint64_t swcr, fpcr, orig_fpcr;
-
-                if (get_user_u64 (swcr, arg2)) {
-                    return -TARGET_EFAULT;
-                }
-                orig_fpcr = cpu_alpha_load_fpcr(cpu_env);
-                fpcr = orig_fpcr & FPCR_DYN_MASK;
-
-                /* Copied from linux ieee_swcr_to_fpcr.  */
-                fpcr |= (swcr & SWCR_STATUS_MASK) << 35;
-                fpcr |= (swcr & SWCR_MAP_DMZ) << 36;
-                fpcr |= (~swcr & (SWCR_TRAP_ENABLE_INV
-                                  | SWCR_TRAP_ENABLE_DZE
-                                  | SWCR_TRAP_ENABLE_OVF)) << 48;
-                fpcr |= (~swcr & (SWCR_TRAP_ENABLE_UNF
-                                  | SWCR_TRAP_ENABLE_INE)) << 57;
-                fpcr |= (swcr & SWCR_MAP_UMZ ? FPCR_UNDZ | FPCR_UNFD : 0);
-                fpcr |= (~swcr & SWCR_TRAP_ENABLE_DNO) << 41;
-
-                cpu_alpha_store_fpcr(cpu_env, fpcr);
-                ret = 0;
-            }
-            break;
-
-          case TARGET_SSI_IEEE_RAISE_EXCEPTION:
-            {
-                uint64_t exc, fpcr, orig_fpcr;
-                int si_code;
-
-                if (get_user_u64(exc, arg2)) {
-                    return -TARGET_EFAULT;
-                }
-
-                orig_fpcr = cpu_alpha_load_fpcr(cpu_env);
-
-                /* We only add to the exception status here.  */
-                fpcr = orig_fpcr | ((exc & SWCR_STATUS_MASK) << 35);
-
-                cpu_alpha_store_fpcr(cpu_env, fpcr);
-                ret = 0;
-
-                /* Old exceptions are not signaled.  */
-                fpcr &= ~(orig_fpcr & FPCR_STATUS_MASK);
-
-                /* If any exceptions set by this call,
-                   and are unmasked, send a signal.  */
-                si_code = 0;
-                if ((fpcr & (FPCR_INE | FPCR_INED)) == FPCR_INE) {
-                    si_code = TARGET_FPE_FLTRES;
-                }
-                if ((fpcr & (FPCR_UNF | FPCR_UNFD)) == FPCR_UNF) {
-                    si_code = TARGET_FPE_FLTUND;
-                }
-                if ((fpcr & (FPCR_OVF | FPCR_OVFD)) == FPCR_OVF) {
-                    si_code = TARGET_FPE_FLTOVF;
-                }
-                if ((fpcr & (FPCR_DZE | FPCR_DZED)) == FPCR_DZE) {
-                    si_code = TARGET_FPE_FLTDIV;
-                }
-                if ((fpcr & (FPCR_INV | FPCR_INVD)) == FPCR_INV) {
-                    si_code = TARGET_FPE_FLTINV;
-                }
-                if (si_code != 0) {
-                    target_siginfo_t info;
-                    info.si_signo = SIGFPE;
-                    info.si_errno = 0;
-                    info.si_code = si_code;
-                    info._sifields._sigfault._addr
-                        = ((CPUArchState *)cpu_env)->pc;
-                    queue_signal((CPUArchState *)cpu_env, info.si_signo,
-                                 QEMU_SI_FAULT, &info);
-                }
-            }
-            break;
-
-          /* case SSI_NVPAIRS:
-             -- Used with SSIN_UACPROC to enable unaligned accesses.
-             case SSI_IEEE_STATE_AT_SIGNAL:
-             case SSI_IEEE_IGNORE_STATE_AT_SIGNAL:
-             -- Not implemented in linux kernel
-          */
-        }
-        return ret;
-#endif
-#ifdef TARGET_NR_osf_sigprocmask
-    /* Alpha specific.  */
-    case TARGET_NR_osf_sigprocmask:
-        {
-            abi_ulong mask;
-            int how;
-            sigset_t set, oldset;
-
-            switch(arg1) {
-            case TARGET_SIG_BLOCK:
-                how = SIG_BLOCK;
-                break;
-            case TARGET_SIG_UNBLOCK:
-                how = SIG_UNBLOCK;
-                break;
-            case TARGET_SIG_SETMASK:
-                how = SIG_SETMASK;
-                break;
-            default:
-                return -TARGET_EINVAL;
-            }
-            mask = arg2;
-            target_to_host_old_sigset(&set, &mask);
-            ret = do_sigprocmask(how, &set, &oldset);
-            if (!ret) {
-                host_to_target_old_sigset(&mask, &oldset);
-                ret = mask;
-            }
-        }
-        return ret;
-#endif
-
 #ifdef TARGET_NR_getgid32
     case TARGET_NR_getgid32:
         return get_errno(getgid());
@@ -13316,6 +13308,15 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef CONFIG_OPEN_BY_HANDLE
         SYSCALL(open_by_handle_at);
 #endif
+#if defined(TARGET_NR_osf_getsysinfo) && defined(TARGET_ALPHA)
+        SYSCALL(osf_getsysinfo);
+#endif
+#if defined(TARGET_NR_osf_setsysinfo) && defined(TARGET_ALPHA)
+        SYSCALL(osf_setsysinfo);
+#endif
+#if defined(TARGET_NR_osf_sigprocmask) && defined(TARGET_ALPHA)
+        SYSCALL(osf_sigprocmask);
+#endif
 #ifdef TARGET_NR_pause
         SYSCALL(pause);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 079/108] linux-user: Split out getegid32, geteuid32, getgid32, setregid32, setreuid32
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (77 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 078/108] linux-user: Split out osf_getsysinfo, osf_setsysinfo, osf_sigprocmask Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 080/108] linux-user: Split out fchown32, getgroups32, setgroups32 Richard Henderson
                   ` (32 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 70 +++++++++++++++++++++++++++++++-------------
 1 file changed, 50 insertions(+), 20 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index ae591a6523..c8bd13092e 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8482,6 +8482,13 @@ IMPL(getegid)
 }
 #endif
 
+#ifdef TARGET_NR_getegid32
+IMPL(getegid32)
+{
+    return get_errno(getegid());
+}
+#endif
+
 #ifdef TARGET_NR_geteuid
 IMPL(geteuid)
 {
@@ -8489,6 +8496,13 @@ IMPL(geteuid)
 }
 #endif
 
+#ifdef TARGET_NR_geteuid32
+IMPL(geteuid32)
+{
+    return get_errno(geteuid());
+}
+#endif
+
 #ifdef TARGET_NR_getgid
 IMPL(getgid)
 {
@@ -8496,6 +8510,13 @@ IMPL(getgid)
 }
 #endif
 
+#ifdef TARGET_NR_getgid32
+IMPL(getgid32)
+{
+    return get_errno(getgid());
+}
+#endif
+
 IMPL(getgroups)
 {
     int gidsetsize = arg1;
@@ -10812,6 +10833,13 @@ IMPL(setregid)
     return get_errno(setregid(low2highgid(arg1), low2highgid(arg2)));
 }
 
+#ifdef TARGET_NR_setregid32
+IMPL(setregid32)
+{
+    return get_errno(setregid(arg1, arg2));
+}
+#endif
+
 #ifdef TARGET_NR_setresgid
 IMPL(setresgid)
 {
@@ -10833,6 +10861,13 @@ IMPL(setreuid)
     return get_errno(setreuid(low2highuid(arg1), low2highuid(arg2)));
 }
 
+#ifdef TARGET_NR_setreuid32
+IMPL(setreuid32)
+{
+    return get_errno(setreuid(arg1, arg2));
+}
+#endif
+
 IMPL(setrlimit)
 {
     int resource = target_to_host_resource(arg1);
@@ -11805,26 +11840,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_getgid32
-    case TARGET_NR_getgid32:
-        return get_errno(getgid());
-#endif
-#ifdef TARGET_NR_geteuid32
-    case TARGET_NR_geteuid32:
-        return get_errno(geteuid());
-#endif
-#ifdef TARGET_NR_getegid32
-    case TARGET_NR_getegid32:
-        return get_errno(getegid());
-#endif
-#ifdef TARGET_NR_setreuid32
-    case TARGET_NR_setreuid32:
-        return get_errno(setreuid(arg1, arg2));
-#endif
-#ifdef TARGET_NR_setregid32
-    case TARGET_NR_setregid32:
-        return get_errno(setregid(arg1, arg2));
-#endif
 #ifdef TARGET_NR_getgroups32
     case TARGET_NR_getgroups32:
         {
@@ -13168,11 +13183,20 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_getegid
         SYSCALL(getegid);
 #endif
+#ifdef TARGET_NR_getegid32
+        SYSCALL(getegid32);
+#endif
 #ifdef TARGET_NR_geteuid
         SYSCALL(geteuid);
 #endif
+#ifdef TARGET_NR_geteuid32
+        SYSCALL(geteuid32);
+#endif
 #ifdef TARGET_NR_getgid
         SYSCALL(getgid);
+#endif
+#ifdef TARGET_NR_getgid32
+        SYSCALL(getgid32);
 #endif
         SYSCALL(getgroups);
         SYSCALL(getitimer);
@@ -13447,10 +13471,16 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_setresgid
         SYSCALL(setresgid);
 #endif
+#ifdef TARGET_NR_setregid32
+        SYSCALL(setregid32);
+#endif
 #ifdef TARGET_NR_setresuid
         SYSCALL(setresuid);
 #endif
         SYSCALL(setreuid);
+#ifdef TARGET_NR_setreuid32
+        SYSCALL(setreuid32);
+#endif
         SYSCALL(setrlimit);
 #ifdef TARGET_NR_setsockopt
         SYSCALL(setsockopt);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 080/108] linux-user: Split out fchown32, getgroups32, setgroups32
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (78 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 079/108] linux-user: Split out getegid32, geteuid32, getgid32, setregid32, setreuid32 Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 081/108] linux-user: Split out getresgid32, getresuid32, setresgid32, setresuid32 Richard Henderson
                   ` (31 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 114 +++++++++++++++++++++++++------------------
 1 file changed, 67 insertions(+), 47 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index c8bd13092e..031033c0ea 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8123,6 +8123,13 @@ IMPL(fchown)
     return get_errno(fchown(arg1, low2highuid(arg2), low2highgid(arg3)));
 }
 
+#ifdef TARGET_NR_fchown32
+IMPL(fchown32)
+{
+    return get_errno(fchown(arg1, arg2, arg3));
+}
+#endif
+
 IMPL(fchownat)
 {
     char *p = lock_user_string(arg2);
@@ -8543,6 +8550,33 @@ IMPL(getgroups)
     return ret;
 }
 
+#ifdef TARGET_NR_getgroups32
+IMPL(getgroups32)
+{
+    int gidsetsize = arg1;
+    gid_t *grouplist;
+    abi_long ret;
+
+    grouplist = alloca(gidsetsize * sizeof(gid_t));
+    ret = get_errno(getgroups(gidsetsize, grouplist));
+
+    if (!is_error(ret) && gidsetsize != 0) {
+        uint32_t *target_gl;
+        int i;
+
+        target_gl = lock_user(VERIFY_WRITE, arg2, gidsetsize * 4, 0);
+        if (!target_gl) {
+            return -TARGET_EFAULT;
+        }
+        for (i = 0; i < ret; i++) {
+            target_gl[i] = tswap32(grouplist[i]);
+        }
+        unlock_user(target_gl, arg2, gidsetsize * 4);
+    }
+    return ret;
+}
+#endif
+
 IMPL(getitimer)
 {
     struct itimerval value;
@@ -10783,6 +10817,30 @@ IMPL(setgroups)
     return get_errno(setgroups(gidsetsize, grouplist));
 }
 
+#ifdef TARGET_NR_setgroups32
+IMPL(setgroups32)
+{
+    int gidsetsize = arg1;
+    gid_t *grouplist = NULL;
+
+    if (gidsetsize) {
+        uint32_t *target_gl;
+        int i;
+
+        grouplist = alloca(gidsetsize * sizeof(gid_t));
+        target_gl = lock_user(VERIFY_READ, arg2, gidsetsize * 4, 1);
+        if (!target_gl) {
+            return -TARGET_EFAULT;
+        }
+        for (i = 0; i < gidsetsize; i++) {
+            grouplist[i] = tswap32(target_gl[i]);
+        }
+        unlock_user(target_gl, arg2, 0);
+    }
+    return get_errno(setgroups(gidsetsize, grouplist));
+}
+#endif
+
 IMPL(sethostname)
 {
     char *p = lock_user_string(arg1);
@@ -11840,53 +11898,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_getgroups32
-    case TARGET_NR_getgroups32:
-        {
-            int gidsetsize = arg1;
-            uint32_t *target_grouplist;
-            gid_t *grouplist;
-            int i;
-
-            grouplist = alloca(gidsetsize * sizeof(gid_t));
-            ret = get_errno(getgroups(gidsetsize, grouplist));
-            if (gidsetsize == 0)
-                return ret;
-            if (!is_error(ret)) {
-                target_grouplist = lock_user(VERIFY_WRITE, arg2, gidsetsize * 4, 0);
-                if (!target_grouplist) {
-                    return -TARGET_EFAULT;
-                }
-                for(i = 0;i < ret; i++)
-                    target_grouplist[i] = tswap32(grouplist[i]);
-                unlock_user(target_grouplist, arg2, gidsetsize * 4);
-            }
-        }
-        return ret;
-#endif
-#ifdef TARGET_NR_setgroups32
-    case TARGET_NR_setgroups32:
-        {
-            int gidsetsize = arg1;
-            uint32_t *target_grouplist;
-            gid_t *grouplist;
-            int i;
-
-            grouplist = alloca(gidsetsize * sizeof(gid_t));
-            target_grouplist = lock_user(VERIFY_READ, arg2, gidsetsize * 4, 1);
-            if (!target_grouplist) {
-                return -TARGET_EFAULT;
-            }
-            for(i = 0;i < gidsetsize; i++)
-                grouplist[i] = tswap32(target_grouplist[i]);
-            unlock_user(target_grouplist, arg2, 0);
-            return get_errno(setgroups(gidsetsize, grouplist));
-        }
-#endif
-#ifdef TARGET_NR_fchown32
-    case TARGET_NR_fchown32:
-        return get_errno(fchown(arg1, arg2, arg3));
-#endif
 #ifdef TARGET_NR_setresuid32
     case TARGET_NR_setresuid32:
         return get_errno(sys_setresuid(arg1, arg2, arg3));
@@ -13144,6 +13155,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(fchmod);
         SYSCALL(fchmodat);
         SYSCALL(fchown);
+#ifdef TARGET_NR_fchown32
+        SYSCALL(fchown32);
+#endif
         SYSCALL(fchownat);
 #ifdef TARGET_NR_fcntl
         SYSCALL(fcntl);
@@ -13199,6 +13213,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(getgid32);
 #endif
         SYSCALL(getgroups);
+#ifdef TARGET_NR_getgroups32
+        SYSCALL(getgroups32);
+#endif
         SYSCALL(getitimer);
 #ifdef TARGET_NR_getpeername
         SYSCALL(getpeername);
@@ -13463,6 +13480,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(setfsuid);
         SYSCALL(setgid);
         SYSCALL(setgroups);
+#ifdef TARGET_NR_setgroups32
+        SYSCALL(setgroups32);
+#endif
         SYSCALL(sethostname);
         SYSCALL(setitimer);
         SYSCALL(setpgid);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 081/108] linux-user: Split out getresgid32, getresuid32, setresgid32, setresuid32
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (79 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 080/108] linux-user: Split out fchown32, getgroups32, setgroups32 Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 082/108] linux-user: Split out chown32, setfsgid32, setfsuid32, setgid32, setuid32 Richard Henderson
                   ` (30 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 93 +++++++++++++++++++++++++++-----------------
 1 file changed, 57 insertions(+), 36 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 031033c0ea..af96cc95d3 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8674,6 +8674,22 @@ IMPL(getresgid)
 }
 #endif
 
+#ifdef TARGET_NR_getresgid32
+IMPL(getresgid32)
+{
+    gid_t rgid, egid, sgid;
+    abi_long ret = get_errno(getresgid(&rgid, &egid, &sgid));
+
+    if (!is_error(ret) &&
+        (put_user_u32(rgid, arg1) ||
+         put_user_u32(egid, arg2) ||
+         put_user_u32(sgid, arg3))) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_getresuid
 IMPL(getresuid)
 {
@@ -8690,6 +8706,21 @@ IMPL(getresuid)
 }
 #endif
 
+#ifdef TARGET_NR_getresuid32
+IMPL(getresuid32)
+{
+    uid_t ruid, euid, suid;
+    abi_long ret = get_errno(getresuid(&ruid, &euid, &suid));
+
+    if (!is_error(ret) &&
+        (put_user_u32(ruid, arg1) ||
+         put_user_u32(euid, arg2) ||
+         put_user_u32(suid, arg3))) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+#endif
 IMPL(getrlimit)
 {
     int resource = target_to_host_resource(arg1);
@@ -10906,6 +10937,13 @@ IMPL(setresgid)
 }
 #endif
 
+#ifdef TARGET_NR_setresgid32
+IMPL(setresgid32)
+{
+    return get_errno(sys_setresgid(arg1, arg2, arg3));
+}
+#endif
+
 #ifdef TARGET_NR_setresuid
 IMPL(setresuid)
 {
@@ -10914,6 +10952,13 @@ IMPL(setresuid)
 }
 #endif
 
+#ifdef TARGET_NR_setresuid32
+IMPL(setresuid32)
+{
+    return get_errno(sys_setresuid(arg1, arg2, arg3));
+}
+#endif
+
 IMPL(setreuid)
 {
     return get_errno(setreuid(low2highuid(arg1), low2highuid(arg2)));
@@ -11898,42 +11943,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_setresuid32
-    case TARGET_NR_setresuid32:
-        return get_errno(sys_setresuid(arg1, arg2, arg3));
-#endif
-#ifdef TARGET_NR_getresuid32
-    case TARGET_NR_getresuid32:
-        {
-            uid_t ruid, euid, suid;
-            ret = get_errno(getresuid(&ruid, &euid, &suid));
-            if (!is_error(ret)) {
-                if (put_user_u32(ruid, arg1)
-                    || put_user_u32(euid, arg2)
-                    || put_user_u32(suid, arg3))
-                    return -TARGET_EFAULT;
-            }
-        }
-        return ret;
-#endif
-#ifdef TARGET_NR_setresgid32
-    case TARGET_NR_setresgid32:
-        return get_errno(sys_setresgid(arg1, arg2, arg3));
-#endif
-#ifdef TARGET_NR_getresgid32
-    case TARGET_NR_getresgid32:
-        {
-            gid_t rgid, egid, sgid;
-            ret = get_errno(getresgid(&rgid, &egid, &sgid));
-            if (!is_error(ret)) {
-                if (put_user_u32(rgid, arg1)
-                    || put_user_u32(egid, arg2)
-                    || put_user_u32(sgid, arg3))
-                    return -TARGET_EFAULT;
-            }
-        }
-        return ret;
-#endif
 #ifdef TARGET_NR_chown32
     case TARGET_NR_chown32:
         if (!(p = lock_user_string(arg1)))
@@ -13235,8 +13244,14 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_getresgid
         SYSCALL(getresgid);
 #endif
+#ifdef TARGET_NR_getresgid32
+        SYSCALL(getresgid32);
+#endif
 #ifdef TARGET_NR_getresuid
         SYSCALL(getresuid);
+#endif
+#ifdef TARGET_NR_getresuid32
+        SYSCALL(getresuid32);
 #endif
         SYSCALL(getrlimit);
         SYSCALL(getrusage);
@@ -13491,11 +13506,17 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_setresgid
         SYSCALL(setresgid);
 #endif
+#ifdef TARGET_NR_setresgid32
+        SYSCALL(setresgid32);
+#endif
 #ifdef TARGET_NR_setregid32
         SYSCALL(setregid32);
 #endif
 #ifdef TARGET_NR_setresuid
         SYSCALL(setresuid);
+#endif
+#ifdef TARGET_NR_setresuid32
+        SYSCALL(setresuid32);
 #endif
         SYSCALL(setreuid);
 #ifdef TARGET_NR_setreuid32
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 082/108] linux-user: Split out chown32, setfsgid32, setfsuid32, setgid32, setuid32
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (80 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 081/108] linux-user: Split out getresgid32, getresuid32, setresgid32, setresuid32 Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 083/108] linux-user: Split out mincore Richard Henderson
                   ` (29 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 82 +++++++++++++++++++++++++++++++-------------
 1 file changed, 58 insertions(+), 24 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index af96cc95d3..fc7f301519 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7802,6 +7802,21 @@ IMPL(chown)
 }
 #endif
 
+#ifdef TARGET_NR_chown32
+IMPL(chown32)
+{
+    char *p = lock_user_string(arg1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(chown(p, arg2, arg3));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+#endif
+
 IMPL(chroot)
 {
     char *p = lock_user_string(arg1);
@@ -10815,16 +10830,37 @@ IMPL(setfsgid)
     return get_errno(setfsgid(arg1));
 }
 
+#ifdef TARGET_NR_setfsgid32
+IMPL(setfsgid32)
+{
+    return get_errno(setfsgid(arg1));
+}
+#endif
+
 IMPL(setfsuid)
 {
     return get_errno(setfsuid(arg1));
 }
 
+#ifdef TARGET_NR_setfsuid32
+IMPL(setfsuid32)
+{
+    return get_errno(setfsuid(arg1));
+}
+#endif
+
 IMPL(setgid)
 {
     return get_errno(sys_setgid(low2highgid(arg1)));
 }
 
+#ifdef TARGET_NR_setgid32
+IMPL(setgid32)
+{
+    return get_errno(sys_setgid(arg1));
+}
+#endif
+
 IMPL(setgroups)
 {
     int gidsetsize = arg1;
@@ -11017,6 +11053,13 @@ IMPL(setuid)
     return get_errno(sys_setuid(low2highuid(arg1)));
 }
 
+#ifdef TARGET_NR_setuid32
+IMPL(setuid32)
+{
+    return get_errno(sys_setuid(arg1));
+}
+#endif
+
 #ifdef TARGET_NR_sigaction
 IMPL(sigaction)
 {
@@ -11943,30 +11986,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_chown32
-    case TARGET_NR_chown32:
-        if (!(p = lock_user_string(arg1)))
-            return -TARGET_EFAULT;
-        ret = get_errno(chown(p, arg2, arg3));
-        unlock_user(p, arg1, 0);
-        return ret;
-#endif
-#ifdef TARGET_NR_setuid32
-    case TARGET_NR_setuid32:
-        return get_errno(sys_setuid(arg1));
-#endif
-#ifdef TARGET_NR_setgid32
-    case TARGET_NR_setgid32:
-        return get_errno(sys_setgid(arg1));
-#endif
-#ifdef TARGET_NR_setfsuid32
-    case TARGET_NR_setfsuid32:
-        return get_errno(setfsuid(arg1));
-#endif
-#ifdef TARGET_NR_setfsgid32
-    case TARGET_NR_setfsgid32:
-        return get_errno(setfsgid(arg1));
-#endif
 #ifdef TARGET_NR_mincore
     case TARGET_NR_mincore:
         {
@@ -13139,6 +13158,9 @@ static impl_fn *syscall_table(unsigned num)
 #endif
 #ifdef TARGET_NR_chown
         SYSCALL(chown);
+#endif
+#ifdef TARGET_NR_chown32
+        SYSCALL(chown32);
 #endif
         SYSCALL(chroot);
 #ifdef TARGET_NR_connect
@@ -13492,8 +13514,17 @@ static impl_fn *syscall_table(unsigned num)
 #endif
         SYSCALL(setdomainname);
         SYSCALL(setfsgid);
+#ifdef TARGET_NR_setfsgid32
+        SYSCALL(setfsgid32);
+#endif
         SYSCALL(setfsuid);
+#ifdef TARGET_NR_setfsuid32
+        SYSCALL(setfsuid32);
+#endif
         SYSCALL(setgid);
+#ifdef TARGET_NR_setgid32
+        SYSCALL(setgid32);
+#endif
         SYSCALL(setgroups);
 #ifdef TARGET_NR_setgroups32
         SYSCALL(setgroups32);
@@ -13529,6 +13560,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(settimeofday);
         SYSCALL(setsid);
         SYSCALL(setuid);
+#ifdef TARGET_NR_setuid32
+        SYSCALL(setuid32);
+#endif
 #ifdef TARGET_NR_sigaction
         SYSCALL(sigaction);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 083/108] linux-user: Split out mincore
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (81 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 082/108] linux-user: Split out chown32, setfsgid32, setfsuid32, setgid32, setuid32 Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 084/108] linux-user: Split out fadvise64, fadvise64_64 Richard Henderson
                   ` (28 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define mincore; remove the ifdef.

At the same time, fix two bugs in the implementation:
(1) The pages to check need not be readable, only valid.
(2) The third argument is an output vector, which
(2a) needs to be writable, and
(2b) sized properly.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 44 ++++++++++++++++++++++++++------------------
 1 file changed, 26 insertions(+), 18 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index fc7f301519..afe6df5efa 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9144,6 +9144,31 @@ IMPL(lstat64)
 }
 #endif
 
+IMPL(mincore)
+{
+    void *a, *p;
+    size_t veclen;
+    abi_long ret;
+
+    /* Note that this is not the same as VERIFY_WRITE or VERIFY_READ.
+     * Moreover, we want to test the exact pages of guest memory.
+     */
+    if (page_check_range(arg1, arg2, PAGE_VALID)) {
+        return -TARGET_ENOMEM;
+    }
+    a = g2h(arg1);
+
+    veclen = DIV_ROUND_UP(arg2, TARGET_PAGE_SIZE);
+    p = lock_user(VERIFY_WRITE, arg3, veclen, 0);
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+
+    ret = get_errno(mincore(a, arg2, p));
+    unlock_user(p, arg3, veclen);
+    return ret;
+}
+
 #ifdef TARGET_NR_mkdir
 IMPL(mkdir)
 {
@@ -11986,24 +12011,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_mincore
-    case TARGET_NR_mincore:
-        {
-            void *a = lock_user(VERIFY_READ, arg1, arg2, 0);
-            if (!a) {
-                return -TARGET_ENOMEM;
-            }
-            p = lock_user_string(arg3);
-            if (!p) {
-                ret = -TARGET_EFAULT;
-            } else {
-                ret = get_errno(mincore(a, arg2, p));
-                unlock_user(p, arg3, ret);
-            }
-            unlock_user(a, arg1, 0);
-        }
-        return ret;
-#endif
 #ifdef TARGET_NR_arm_fadvise64_64
     case TARGET_NR_arm_fadvise64_64:
         /* arm_fadvise64_64 looks like fadvise64_64 but
@@ -13328,6 +13335,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_lstat64
         SYSCALL(lstat64);
 #endif
+        SYSCALL(mincore);
 #ifdef TARGET_NR_mkdir
         SYSCALL(mkdir);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 084/108] linux-user: Split out fadvise64, fadvise64_64
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (82 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 083/108] linux-user: Split out mincore Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 085/108] linux-user: Split out cacheflush, fcntl64, getpagesize, madvise Richard Henderson
                   ` (27 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Generalize the s390x guest advice frobbing to support s390x as a host.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 189 ++++++++++++++++++++++++++-----------------
 1 file changed, 113 insertions(+), 76 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index afe6df5efa..5f056cf660 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8110,6 +8110,109 @@ IMPL(faccessat)
     return ret;
 }
 
+/* The advise values for DONTNEED and NOREUSE differ for s390x.
+ * Which means that we need to translate for the host as well.
+ */
+static int target_to_host_fadvise64_advice(int advice)
+{
+    switch (advice) {
+    case 0 ... 3:
+        return advice;
+#ifdef TARGET_S390X
+    case 6:
+        return POSIX_FADV_DONTNEED;
+    case 7:
+        return POSIX_FADV_NOREUSE;
+#else
+    case 4:
+        return POSIX_FADV_DONTNEED;
+    case 5:
+        return POSIX_FADV_NOREUSE;
+#endif
+    default:
+        return -TARGET_EINVAL;
+    }
+}
+
+#if TARGET_ABI_BITS == 32
+# ifdef TARGET_NR_fadvise64
+IMPL(fadvise64)
+{
+    abi_long ret;
+    off_t off, len;
+    int advice;
+
+    /* 5 args: fd, offset (high, low), len, advice */
+    if (regpairs_aligned(cpu_env, num)) {
+        /* offset is in (3,4), len in 5 and advice in 6 */
+        off = target_offset64(arg3, arg4);
+        len = arg5;
+        advice = arg6;
+    } else {
+        off = target_offset64(arg2, arg3);
+        len = arg4;
+        advice = arg5;
+    }
+    advice = target_to_host_fadvise64_advice(advice);
+    if (advice < 0) {
+        return advice;
+    }
+    ret = posix_fadvise(arg1, off, len, advice);
+    return -host_to_target_errno(ret);
+}
+# endif
+/* ??? TARGET_NR_arm_fadvise64_64 should be TARGET_NR_fadvise64_64.
+ * The argument ordering is the same as ppc32 and xtensa anyway.
+ */
+# ifdef TARGET_NR_arm_fadvise64_64
+#  define TARGET_NR_fadvise64_64  TARGET_NR_arm_fadvise64_64
+# endif
+# ifdef TARGET_NR_fadvise64_64
+IMPL(fadvise64_64)
+{
+    abi_long ret;
+    off_t off, len;
+    int advice;
+
+#  if defined(TARGET_ARM) || defined(TARGET_PPC) || defined(TARGET_XTENSA)
+    /* 6 args: fd, advice, offset (high, low), len (high, low) */
+    advice = arg2;
+    off = target_offset64(arg3, arg4);
+    len = target_offset64(arg5, arg6);
+#  else
+    /* 6 args: fd, offset (high, low), len (high, low), advice */
+    if (regpairs_aligned(cpu_env, num)) {
+        /* offset is in (3,4), len in (5,6) and advice in 7 */
+        off = target_offset64(arg3, arg4);
+        len = target_offset64(arg5, arg6);
+        advice = arg7;
+    } else {
+        off = target_offset64(arg2, arg3);
+        len = target_offset64(arg4, arg5);
+        advice = arg6;
+    }
+#  endif
+    advice = target_to_host_fadvise64_advice(advice);
+    if (advice < 0) {
+        return advice;
+    }
+    ret = posix_fadvise(arg1, off, len, advice);
+    return -host_to_target_errno(ret);
+}
+# endif
+#else /* TARGET_ABI_BITS == 64 */
+# if defined(TARGET_NR_fadvise64_64) || defined(TARGET_NR_fadvise64)
+IMPL(fadvise64)
+{
+    int advice = target_to_host_fadvise64_advice(arg4);
+    if (advice < 0) {
+        return advice;
+    }
+    return -host_to_target_errno(posix_fadvise(arg1, arg2, arg3, advice));
+}
+# endif
+#endif /* end fadvise64 handling */
+
 IMPL(fchdir)
 {
     return get_errno(fchdir(arg1));
@@ -12011,82 +12114,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_arm_fadvise64_64
-    case TARGET_NR_arm_fadvise64_64:
-        /* arm_fadvise64_64 looks like fadvise64_64 but
-         * with different argument order: fd, advice, offset, len
-         * rather than the usual fd, offset, len, advice.
-         * Note that offset and len are both 64-bit so appear as
-         * pairs of 32-bit registers.
-         */
-        ret = posix_fadvise(arg1, target_offset64(arg3, arg4),
-                            target_offset64(arg5, arg6), arg2);
-        return -host_to_target_errno(ret);
-#endif
-
-#if TARGET_ABI_BITS == 32
-
-#ifdef TARGET_NR_fadvise64_64
-    case TARGET_NR_fadvise64_64:
-#if defined(TARGET_PPC) || defined(TARGET_XTENSA)
-        /* 6 args: fd, advice, offset (high, low), len (high, low) */
-        ret = arg2;
-        arg2 = arg3;
-        arg3 = arg4;
-        arg4 = arg5;
-        arg5 = arg6;
-        arg6 = ret;
-#else
-        /* 6 args: fd, offset (high, low), len (high, low), advice */
-        if (regpairs_aligned(cpu_env, num)) {
-            /* offset is in (3,4), len in (5,6) and advice in 7 */
-            arg2 = arg3;
-            arg3 = arg4;
-            arg4 = arg5;
-            arg5 = arg6;
-            arg6 = arg7;
-        }
-#endif
-        ret = posix_fadvise(arg1, target_offset64(arg2, arg3),
-                            target_offset64(arg4, arg5), arg6);
-        return -host_to_target_errno(ret);
-#endif
-
-#ifdef TARGET_NR_fadvise64
-    case TARGET_NR_fadvise64:
-        /* 5 args: fd, offset (high, low), len, advice */
-        if (regpairs_aligned(cpu_env, num)) {
-            /* offset is in (3,4), len in 5 and advice in 6 */
-            arg2 = arg3;
-            arg3 = arg4;
-            arg4 = arg5;
-            arg5 = arg6;
-        }
-        ret = posix_fadvise(arg1, target_offset64(arg2, arg3), arg4, arg5);
-        return -host_to_target_errno(ret);
-#endif
-
-#else /* not a 32-bit ABI */
-#if defined(TARGET_NR_fadvise64_64) || defined(TARGET_NR_fadvise64)
-#ifdef TARGET_NR_fadvise64_64
-    case TARGET_NR_fadvise64_64:
-#endif
-#ifdef TARGET_NR_fadvise64
-    case TARGET_NR_fadvise64:
-#endif
-#ifdef TARGET_S390X
-        switch (arg4) {
-        case 4: arg4 = POSIX_FADV_NOREUSE + 1; break; /* make sure it's an invalid value */
-        case 5: arg4 = POSIX_FADV_NOREUSE + 2; break; /* ditto */
-        case 6: arg4 = POSIX_FADV_DONTNEED; break;
-        case 7: arg4 = POSIX_FADV_NOREUSE; break;
-        default: break;
-        }
-#endif
-        return -host_to_target_errno(posix_fadvise(arg1, arg2, arg3, arg4));
-#endif
-#endif /* end of 64-bit ABI fadvise handling */
-
 #ifdef TARGET_NR_madvise
     case TARGET_NR_madvise:
         /* A straight passthrough may not be safe because qemu sometimes
@@ -13189,6 +13216,16 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL_WITH(exit_group, enosys);
 #endif
         SYSCALL(faccessat);
+#ifdef TARGET_NR_fadvise64
+        SYSCALL(fadvise64);
+#endif
+#ifdef TARGET_NR_fadvise64_64
+# if TARGET_ABI_BITS == 32
+        SYSCALL(fadvise64_64);
+# else
+        SYSCALL_WITH(fadvise64_64, fadvise64);
+# endif
+#endif
         SYSCALL(fchdir);
         SYSCALL(fchmod);
         SYSCALL(fchmodat);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 085/108] linux-user: Split out cacheflush, fcntl64, getpagesize, madvise
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (83 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 084/108] linux-user: Split out fadvise64, fadvise64_64 Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 086/108] linux-user: Split out gettid, readahead Richard Henderson
                   ` (26 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define madvise; remove the ifdef.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 144 ++++++++++++++++++++++++-------------------
 1 file changed, 80 insertions(+), 64 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5f056cf660..bcddb28947 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7675,6 +7675,14 @@ IMPL(brk)
     return do_brk(arg1);
 }
 
+#ifdef TARGET_NR_cacheflush
+IMPL(cacheflush)
+{
+    /* Self-modifying code is handled automatically, so nothing needed.  */
+    return 0;
+}
+#endif
+
 IMPL(capget)
 {
     struct target_user_cap_header *target_header;
@@ -8269,6 +8277,52 @@ IMPL(fcntl)
 }
 #endif
 
+#if TARGET_ABI_BITS == 32
+IMPL(fcntl64)
+{
+    int cmd;
+    struct flock64 fl;
+    from_flock64_fn *copyfrom = copy_from_user_flock64;
+    to_flock64_fn *copyto = copy_to_user_flock64;
+    abi_long ret;
+
+#ifdef TARGET_ARM
+    if (!((CPUARMState *)cpu_env)->eabi) {
+        copyfrom = copy_from_user_oabi_flock64;
+        copyto = copy_to_user_oabi_flock64;
+    }
+#endif
+    cmd = target_to_host_fcntl_cmd(arg2);
+    if (cmd == -TARGET_EINVAL) {
+        return -TARGET_EINVAL;
+    }
+
+    switch (arg2) {
+    case TARGET_F_GETLK64:
+        ret = copyfrom(&fl, arg3);
+        if (ret) {
+            return ret;
+        }
+        ret = get_errno(fcntl(arg1, cmd, &fl));
+        if (ret == 0) {
+            ret = copyto(arg3, &fl);
+        }
+        return ret;
+
+    case TARGET_F_SETLK64:
+    case TARGET_F_SETLKW64:
+        ret = copyfrom(&fl, arg3);
+        if (ret) {
+            return ret;
+        }
+        return get_errno(safe_fcntl(arg1, cmd, &fl));
+
+    default:
+        return do_fcntl(arg1, arg2, arg3);
+    }
+}
+#endif
+
 IMPL(fdatasync)
 {
     return get_errno(fdatasync(arg1));
@@ -8709,6 +8763,13 @@ IMPL(getitimer)
     return ret;
 }
 
+#ifdef TARGET_NR_getpagesize
+IMPL(getpagesize)
+{
+    return TARGET_PAGE_SIZE;
+}
+#endif
+
 #ifdef TARGET_NR_getpeername
 IMPL(getpeername)
 {
@@ -9247,6 +9308,15 @@ IMPL(lstat64)
 }
 #endif
 
+IMPL(madvise)
+{
+    /* A straight passthrough may not be safe because qemu sometimes
+       turns private file-backed mappings into anonymous mappings.
+       This will break MADV_DONTNEED.
+       This is a hint, so ignoring and returning success is ok.  */
+    return 0;
+}
+
 IMPL(mincore)
 {
     void *a, *p;
@@ -12114,70 +12184,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_madvise
-    case TARGET_NR_madvise:
-        /* A straight passthrough may not be safe because qemu sometimes
-           turns private file-backed mappings into anonymous mappings.
-           This will break MADV_DONTNEED.
-           This is a hint, so ignoring and returning success is ok.  */
-        return 0;
-#endif
-#if TARGET_ABI_BITS == 32
-    case TARGET_NR_fcntl64:
-    {
-	int cmd;
-	struct flock64 fl;
-        from_flock64_fn *copyfrom = copy_from_user_flock64;
-        to_flock64_fn *copyto = copy_to_user_flock64;
-
-#ifdef TARGET_ARM
-        if (!((CPUARMState *)cpu_env)->eabi) {
-            copyfrom = copy_from_user_oabi_flock64;
-            copyto = copy_to_user_oabi_flock64;
-        }
-#endif
-
-	cmd = target_to_host_fcntl_cmd(arg2);
-        if (cmd == -TARGET_EINVAL) {
-            return cmd;
-        }
-
-        switch(arg2) {
-        case TARGET_F_GETLK64:
-            ret = copyfrom(&fl, arg3);
-            if (ret) {
-                break;
-            }
-            ret = get_errno(fcntl(arg1, cmd, &fl));
-            if (ret == 0) {
-                ret = copyto(arg3, &fl);
-            }
-	    break;
-
-        case TARGET_F_SETLK64:
-        case TARGET_F_SETLKW64:
-            ret = copyfrom(&fl, arg3);
-            if (ret) {
-                break;
-            }
-            ret = get_errno(safe_fcntl(arg1, cmd, &fl));
-	    break;
-        default:
-            ret = do_fcntl(arg1, arg2, arg3);
-            break;
-        }
-        return ret;
-    }
-#endif
-#ifdef TARGET_NR_cacheflush
-    case TARGET_NR_cacheflush:
-        /* self-modifying code is handled automatically, so nothing needed */
-        return 0;
-#endif
-#ifdef TARGET_NR_getpagesize
-    case TARGET_NR_getpagesize:
-        return TARGET_PAGE_SIZE;
-#endif
     case TARGET_NR_gettid:
         return get_errno(gettid());
 #ifdef TARGET_NR_readahead
@@ -13179,6 +13185,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(bind);
 #endif
         SYSCALL(brk);
+#ifdef TARGET_NR_cacheflush
+        SYSCALL(cacheflush);
+#endif
         SYSCALL(capget);
         SYSCALL(capset);
 #ifdef CONFIG_CLOCK_ADJTIME
@@ -13236,6 +13245,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(fchownat);
 #ifdef TARGET_NR_fcntl
         SYSCALL(fcntl);
+#endif
+#if TARGET_ABI_BITS == 32
+        SYSCALL(fcntl64);
 #endif
         SYSCALL(fdatasync);
         SYSCALL(flock);
@@ -13292,6 +13304,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(getgroups32);
 #endif
         SYSCALL(getitimer);
+#ifdef TARGET_NR_getpagesize
+        SYSCALL(getpagesize);
+#endif
 #ifdef TARGET_NR_getpeername
         SYSCALL(getpeername);
 #endif
@@ -13372,6 +13387,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_lstat64
         SYSCALL(lstat64);
 #endif
+        SYSCALL(madvise);
         SYSCALL(mincore);
 #ifdef TARGET_NR_mkdir
         SYSCALL(mkdir);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 086/108] linux-user: Split out gettid, readahead
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (84 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 085/108] linux-user: Split out cacheflush, fcntl64, getpagesize, madvise Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 087/108] linux-user: Split out xattr syscalls Richard Henderson
                   ` (25 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define readahead; remove the ifdef.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 37 +++++++++++++++++++++----------------
 1 file changed, 21 insertions(+), 16 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index bcddb28947..0897449273 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8950,6 +8950,11 @@ IMPL(getsockopt)
 }
 #endif
 
+IMPL(gettid)
+{
+    return get_errno(gettid());
+}
+
 IMPL(gettimeofday)
 {
     struct timeval tv;
@@ -10337,6 +10342,20 @@ static abi_long do_readlinkat(abi_long dirfd, abi_long target_path,
     return ret;
 }
 
+IMPL(readahead)
+{
+#if TARGET_ABI_BITS == 32
+    if (regpairs_aligned(cpu_env, num)) {
+        arg2 = arg3;
+        arg3 = arg4;
+        arg4 = arg5;
+    }
+    return get_errno(readahead(arg1, target_offset64(arg2, arg3) , arg4));
+#else
+    return get_errno(readahead(arg1, arg2, arg3));
+#endif
+}
+
 #ifdef TARGET_NR_readlink
 IMPL(readlink)
 {
@@ -12184,22 +12203,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-    case TARGET_NR_gettid:
-        return get_errno(gettid());
-#ifdef TARGET_NR_readahead
-    case TARGET_NR_readahead:
-#if TARGET_ABI_BITS == 32
-        if (regpairs_aligned(cpu_env, num)) {
-            arg2 = arg3;
-            arg3 = arg4;
-            arg4 = arg5;
-        }
-        ret = get_errno(readahead(arg1, target_offset64(arg2, arg3) , arg4));
-#else
-        ret = get_errno(readahead(arg1, arg2, arg3));
-#endif
-        return ret;
-#endif
 #ifdef CONFIG_ATTR
 #ifdef TARGET_NR_setxattr
     case TARGET_NR_listxattr:
@@ -13343,6 +13346,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_getsockopt
         SYSCALL(getsockopt);
 #endif
+        SYSCALL(gettid);
         SYSCALL(gettimeofday);
 #ifdef TARGET_NR_getuid
         SYSCALL(getuid);
@@ -13475,6 +13479,7 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(pwrite64);
         SYSCALL(pwritev);
         SYSCALL(read);
+        SYSCALL(readahead);
 #ifdef TARGET_NR_readlink
         SYSCALL(readlink);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 087/108] linux-user: Split out xattr syscalls
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (85 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 086/108] linux-user: Split out gettid, readahead Richard Henderson
@ 2018-06-10  3:01 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 088/108] linux-user: Split out getdomainname, get_thread_area, set_thread_area Richard Henderson
                   ` (24 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

This includes fgetxattr, flistxattr, fremovexattr, fsetxattr,
getxattr, lgetxattr, listxattr, llistxattr, lremovexattr,
lsetxattr, removexattr, setxattr.

All targets define all of these; simplify the ifdefs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 453 +++++++++++++++++++++++++++----------------
 1 file changed, 291 insertions(+), 162 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 0897449273..c37af32bb6 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8328,6 +8328,46 @@ IMPL(fdatasync)
     return get_errno(fdatasync(arg1));
 }
 
+#ifdef CONFIG_ATTR
+IMPL(fgetxattr)
+{
+    void *n, *v = 0;
+    abi_long ret;
+
+    if (arg3) {
+        v = lock_user(VERIFY_WRITE, arg3, arg4, 0);
+        if (!v) {
+            return -TARGET_EFAULT;
+        }
+    }
+    n = lock_user_string(arg2);
+    if (n) {
+        ret = get_errno(fgetxattr(arg1, n, v, arg4));
+    } else {
+        ret = -TARGET_EFAULT;
+    }
+    unlock_user(n, arg2, 0);
+    unlock_user(v, arg3, arg4);
+    return ret;
+}
+
+IMPL(flistxattr)
+{
+    void *b = 0;
+    abi_long ret;
+
+    if (arg2) {
+        b = lock_user(VERIFY_WRITE, arg2, arg3, 0);
+        if (!b) {
+            return -TARGET_EFAULT;
+        }
+    }
+    ret = get_errno(flistxattr(arg1, b, arg3));
+    unlock_user(b, arg2, arg3);
+    return ret;
+}
+#endif
+
 IMPL(flock)
 {
     /* The flock constant seems to be the same for every Linux platform. */
@@ -8341,6 +8381,45 @@ IMPL(fork)
 }
 #endif
 
+#ifdef CONFIG_ATTR
+IMPL(fremovexattr)
+{
+    void *n;
+    abi_long ret;
+
+    n = lock_user_string(arg2);
+    if (n) {
+        ret = get_errno(fremovexattr(arg1, n));
+    } else {
+        ret = -TARGET_EFAULT;
+    }
+    unlock_user(n, arg2, 0);
+    return ret;
+}
+
+IMPL(fsetxattr)
+{
+    void *n, *v = 0;
+    abi_long ret;
+
+    if (arg3) {
+        v = lock_user(VERIFY_READ, arg3, arg4, 1);
+        if (!v) {
+            return -TARGET_EFAULT;
+        }
+    }
+    n = lock_user_string(arg2);
+    if (n) {
+        ret = get_errno(fsetxattr(arg1, n, v, arg4, arg5));
+    } else {
+        ret = -TARGET_EFAULT;
+    }
+    unlock_user(n, arg2, 0);
+    unlock_user(v, arg3, 0);
+    return ret;
+}
+#endif
+
 IMPL(fstat)
 {
     struct stat st;
@@ -8981,6 +9060,32 @@ IMPL(getuid32)
 }
 #endif
 
+#ifdef CONFIG_ATTR
+IMPL(getxattr)
+{
+    void *p, *n, *v = 0;
+    abi_long ret;
+
+    if (arg3) {
+        v = lock_user(VERIFY_WRITE, arg3, arg4, 0);
+        if (!v) {
+            return -TARGET_EFAULT;
+        }
+    }
+    p = lock_user_string(arg1);
+    n = lock_user_string(arg2);
+    if (p && n) {
+        ret = get_errno(getxattr(p, n, v, arg4));
+    } else {
+        ret = -TARGET_EFAULT;
+    }
+    unlock_user(p, arg1, 0);
+    unlock_user(n, arg2, 0);
+    unlock_user(v, arg3, arg4);
+    return ret;
+}
+#endif
+
 #if defined(TARGET_NR_getxgid) && defined(TARGET_ALPHA)
 IMPL(getxgid)
 {
@@ -9212,6 +9317,32 @@ IMPL(lchown32)
 }
 #endif
 
+#ifdef CONFIG_ATTR
+IMPL(lgetxattr)
+{
+    void *p, *n, *v = 0;
+    abi_long ret;
+
+    if (arg3) {
+        v = lock_user(VERIFY_WRITE, arg3, arg4, 0);
+        if (!v) {
+            return -TARGET_EFAULT;
+        }
+    }
+    p = lock_user_string(arg1);
+    n = lock_user_string(arg2);
+    if (p && n) {
+        ret = get_errno(lgetxattr(p, n, v, arg4));
+    } else {
+        ret = -TARGET_EFAULT;
+    }
+    unlock_user(p, arg1, 0);
+    unlock_user(n, arg2, 0);
+    unlock_user(v, arg3, arg4);
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_link
 IMPL(link)
 {
@@ -9249,6 +9380,50 @@ IMPL(listen)
 }
 #endif
 
+#ifdef CONFIG_ATTR
+IMPL(listxattr)
+{
+    void *p = lock_user_string(arg1);
+    void *b = 0;
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    if (arg2) {
+        b = lock_user(VERIFY_WRITE, arg2, arg3, 0);
+        if (!b) {
+            return -TARGET_EFAULT;
+        }
+    }
+    ret = get_errno(listxattr(p, b, arg3));
+    unlock_user(p, arg1, 0);
+    unlock_user(b, arg2, arg3);
+    return ret;
+}
+
+IMPL(llistxattr)
+{
+    void *p = lock_user_string(arg1);
+    void *b = 0;
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    if (arg2) {
+        b = lock_user(VERIFY_WRITE, arg2, arg3, 0);
+        if (!b) {
+            return -TARGET_EFAULT;
+        }
+    }
+    ret = get_errno(llistxattr(p, b, arg3));
+    unlock_user(p, arg1, 0);
+    unlock_user(b, arg2, arg3);
+    return ret;
+}
+#endif
+
 /* Older kernel ports have _llseek() instead of llseek() */
 #if defined(TARGET_NR__llseek) && !defined(TARGET_NR_llseek)
 #define TARGET_NR_llseek TARGET_NR__llseek
@@ -9270,11 +9445,54 @@ IMPL(llseek)
 }
 #endif
 
+#ifdef CONFIG_ATTR
+IMPL(lremovexattr)
+{
+    char *p = lock_user_string(arg1);
+    char *n = lock_user_string(arg2);
+    abi_long ret = -TARGET_EFAULT;
+
+    if (p && n) {
+        ret = get_errno(lremovexattr(p, n));
+    }
+    unlock_user(p, arg1, 0);
+    unlock_user(n, arg2, 0);
+    return ret;
+}
+#endif
+
 IMPL(lseek)
 {
     return get_errno(lseek(arg1, arg2, arg3));
 }
 
+#ifdef CONFIG_ATTR
+IMPL(lsetxattr)
+{
+    char *p, *n;
+    void *v = 0;
+    abi_long ret;
+
+    if (arg3) {
+        v = lock_user(VERIFY_READ, arg3, arg4, 1);
+        if (!v) {
+            return -TARGET_EFAULT;
+        }
+    }
+    p = lock_user_string(arg1);
+    n = lock_user_string(arg2);
+    if (p && n) {
+        ret = get_errno(lsetxattr(p, n, v, arg4, arg5));
+    } else {
+        ret = -TARGET_EFAULT;
+    }
+    unlock_user(p, arg1, 0);
+    unlock_user(n, arg2, 0);
+    unlock_user(v, arg3, 0);
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_lstat
 IMPL(lstat)
 {
@@ -10428,6 +10646,22 @@ IMPL(recvmsg)
 }
 #endif
 
+#ifdef CONFIG_ATTR
+IMPL(removexattr)
+{
+    char *p = lock_user_string(arg1);
+    char *n = lock_user_string(arg2);
+    abi_long ret = -TARGET_EFAULT;
+
+    if (p && n) {
+        ret = get_errno(removexattr(p, n));
+    }
+    unlock_user(p, arg1, 0);
+    unlock_user(n, arg2, 0);
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_rename
 IMPL(rename)
 {
@@ -11277,6 +11511,33 @@ IMPL(setuid32)
 }
 #endif
 
+#ifdef CONFIG_ATTR
+IMPL(setxattr)
+{
+    char *p, *n;
+    void *v = 0;
+    abi_long ret;
+
+    if (arg3) {
+        v = lock_user(VERIFY_READ, arg3, arg4, 1);
+        if (!v) {
+            return -TARGET_EFAULT;
+        }
+    }
+    p = lock_user_string(arg1);
+    n = lock_user_string(arg2);
+    if (p && n) {
+        ret = get_errno(setxattr(p, n, v, arg4, arg5));
+    } else {
+        ret = -TARGET_EFAULT;
+    }
+    unlock_user(p, arg1, 0);
+    unlock_user(n, arg2, 0);
+    unlock_user(v, arg3, 0);
+    return ret;
+}
+#endif
+
 #ifdef TARGET_NR_sigaction
 IMPL(sigaction)
 {
@@ -12203,168 +12464,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef CONFIG_ATTR
-#ifdef TARGET_NR_setxattr
-    case TARGET_NR_listxattr:
-    case TARGET_NR_llistxattr:
-    {
-        void *p, *b = 0;
-        if (arg2) {
-            b = lock_user(VERIFY_WRITE, arg2, arg3, 0);
-            if (!b) {
-                return -TARGET_EFAULT;
-            }
-        }
-        p = lock_user_string(arg1);
-        if (p) {
-            if (num == TARGET_NR_listxattr) {
-                ret = get_errno(listxattr(p, b, arg3));
-            } else {
-                ret = get_errno(llistxattr(p, b, arg3));
-            }
-        } else {
-            ret = -TARGET_EFAULT;
-        }
-        unlock_user(p, arg1, 0);
-        unlock_user(b, arg2, arg3);
-        return ret;
-    }
-    case TARGET_NR_flistxattr:
-    {
-        void *b = 0;
-        if (arg2) {
-            b = lock_user(VERIFY_WRITE, arg2, arg3, 0);
-            if (!b) {
-                return -TARGET_EFAULT;
-            }
-        }
-        ret = get_errno(flistxattr(arg1, b, arg3));
-        unlock_user(b, arg2, arg3);
-        return ret;
-    }
-    case TARGET_NR_setxattr:
-    case TARGET_NR_lsetxattr:
-        {
-            void *p, *n, *v = 0;
-            if (arg3) {
-                v = lock_user(VERIFY_READ, arg3, arg4, 1);
-                if (!v) {
-                    return -TARGET_EFAULT;
-                }
-            }
-            p = lock_user_string(arg1);
-            n = lock_user_string(arg2);
-            if (p && n) {
-                if (num == TARGET_NR_setxattr) {
-                    ret = get_errno(setxattr(p, n, v, arg4, arg5));
-                } else {
-                    ret = get_errno(lsetxattr(p, n, v, arg4, arg5));
-                }
-            } else {
-                ret = -TARGET_EFAULT;
-            }
-            unlock_user(p, arg1, 0);
-            unlock_user(n, arg2, 0);
-            unlock_user(v, arg3, 0);
-        }
-        return ret;
-    case TARGET_NR_fsetxattr:
-        {
-            void *n, *v = 0;
-            if (arg3) {
-                v = lock_user(VERIFY_READ, arg3, arg4, 1);
-                if (!v) {
-                    return -TARGET_EFAULT;
-                }
-            }
-            n = lock_user_string(arg2);
-            if (n) {
-                ret = get_errno(fsetxattr(arg1, n, v, arg4, arg5));
-            } else {
-                ret = -TARGET_EFAULT;
-            }
-            unlock_user(n, arg2, 0);
-            unlock_user(v, arg3, 0);
-        }
-        return ret;
-    case TARGET_NR_getxattr:
-    case TARGET_NR_lgetxattr:
-        {
-            void *p, *n, *v = 0;
-            if (arg3) {
-                v = lock_user(VERIFY_WRITE, arg3, arg4, 0);
-                if (!v) {
-                    return -TARGET_EFAULT;
-                }
-            }
-            p = lock_user_string(arg1);
-            n = lock_user_string(arg2);
-            if (p && n) {
-                if (num == TARGET_NR_getxattr) {
-                    ret = get_errno(getxattr(p, n, v, arg4));
-                } else {
-                    ret = get_errno(lgetxattr(p, n, v, arg4));
-                }
-            } else {
-                ret = -TARGET_EFAULT;
-            }
-            unlock_user(p, arg1, 0);
-            unlock_user(n, arg2, 0);
-            unlock_user(v, arg3, arg4);
-        }
-        return ret;
-    case TARGET_NR_fgetxattr:
-        {
-            void *n, *v = 0;
-            if (arg3) {
-                v = lock_user(VERIFY_WRITE, arg3, arg4, 0);
-                if (!v) {
-                    return -TARGET_EFAULT;
-                }
-            }
-            n = lock_user_string(arg2);
-            if (n) {
-                ret = get_errno(fgetxattr(arg1, n, v, arg4));
-            } else {
-                ret = -TARGET_EFAULT;
-            }
-            unlock_user(n, arg2, 0);
-            unlock_user(v, arg3, arg4);
-        }
-        return ret;
-    case TARGET_NR_removexattr:
-    case TARGET_NR_lremovexattr:
-        {
-            void *p, *n;
-            p = lock_user_string(arg1);
-            n = lock_user_string(arg2);
-            if (p && n) {
-                if (num == TARGET_NR_removexattr) {
-                    ret = get_errno(removexattr(p, n));
-                } else {
-                    ret = get_errno(lremovexattr(p, n));
-                }
-            } else {
-                ret = -TARGET_EFAULT;
-            }
-            unlock_user(p, arg1, 0);
-            unlock_user(n, arg2, 0);
-        }
-        return ret;
-    case TARGET_NR_fremovexattr:
-        {
-            void *n;
-            n = lock_user_string(arg2);
-            if (n) {
-                ret = get_errno(fremovexattr(arg1, n));
-            } else {
-                ret = -TARGET_EFAULT;
-            }
-            unlock_user(n, arg2, 0);
-        }
-        return ret;
-#endif
-#endif /* CONFIG_ATTR */
 #ifdef TARGET_NR_set_thread_area
     case TARGET_NR_set_thread_area:
 #if defined(TARGET_MIPS)
@@ -13253,9 +13352,17 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(fcntl64);
 #endif
         SYSCALL(fdatasync);
+#ifdef CONFIG_ATTR
+        SYSCALL(fgetxattr);
+        SYSCALL(flistxattr);
+#endif
         SYSCALL(flock);
 #ifdef TARGET_NR_fork
         SYSCALL(fork);
+#endif
+#ifdef CONFIG_ATTR
+        SYSCALL(fremovexattr);
+        SYSCALL(fsetxattr);
 #endif
         SYSCALL(fstat);
 #ifdef TARGET_NR_fstat64
@@ -13354,6 +13461,9 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_getuid32
         SYSCALL(getuid32);
 #endif
+#ifdef CONFIG_ATTR
+        SYSCALL(getxattr);
+#endif
 #if defined(TARGET_NR_getxgid) && defined(TARGET_ALPHA)
         SYSCALL(getxgid);
 #endif
@@ -13374,17 +13484,30 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_lchown32
         SYSCALL(lchown32);
 #endif
+#ifdef CONFIG_ATTR
+        SYSCALL(lgetxattr);
+#endif
 #ifdef TARGET_NR_link
         SYSCALL(link);
 #endif
         SYSCALL(linkat);
+#ifdef CONFIG_ATTR
+        SYSCALL(listxattr);
+        SYSCALL(llistxattr);
+#endif
 #ifdef TARGET_NR_listen
         SYSCALL(listen);
 #endif
 #ifdef TARGET_NR_llseek
         SYSCALL(llseek);
+#endif
+#ifdef CONFIG_ATTR
+        SYSCALL(lremovexattr);
 #endif
         SYSCALL(lseek);
+#ifdef CONFIG_ATTR
+        SYSCALL(lsetxattr);
+#endif
 #ifdef TARGET_NR_lstat
         SYSCALL(lstat);
 #endif
@@ -13498,6 +13621,9 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_recvmsg
         SYSCALL(recvmsg);
 #endif
+#ifdef CONFIG_ATTR
+        SYSCALL(removexattr);
+#endif
 #ifdef TARGET_NR_rename
         SYSCALL(rename);
 #endif
@@ -13629,6 +13755,9 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_setuid32
         SYSCALL(setuid32);
 #endif
+#ifdef CONFIG_ATTR
+        SYSCALL(setxattr);
+#endif
 #ifdef TARGET_NR_sigaction
         SYSCALL(sigaction);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 088/108] linux-user: Split out getdomainname, get_thread_area, set_thread_area
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (86 preceding siblings ...)
  2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 087/108] linux-user: Split out xattr syscalls Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 089/108] linux-user: Split out clock syscalls Richard Henderson
                   ` (23 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 92 +++++++++++++++++++++++---------------------
 1 file changed, 49 insertions(+), 43 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index c37af32bb6..285612dfe5 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9029,6 +9029,21 @@ IMPL(getsockopt)
 }
 #endif
 
+#ifdef TARGET_NR_get_thread_area
+IMPL(get_thread_area)
+{
+# if defined(TARGET_I386) && defined(TARGET_ABI32)
+    return do_get_thread_area(cpu_env, arg1);
+# elif defined(TARGET_M68K)
+    CPUState *cpu = ENV_GET_CPU(cpu_env);
+    TaskState *ts = cpu->opaque;
+    return ts->tp_value;
+# else
+    return -TARGET_ENOSYS;
+# endif
+}
+#endif
+
 IMPL(gettid)
 {
     return get_errno(gettid());
@@ -11480,6 +11495,31 @@ IMPL(setsockopt)
 }
 #endif
 
+#ifdef TARGET_NR_set_thread_area
+IMPL(set_thread_area)
+{
+# if defined(TARGET_MIPS)
+    ((CPUMIPSState *) cpu_env)->active_tc.CP0_UserLocal = arg1;
+    return 0;
+# elif defined(TARGET_CRIS)
+    if (arg1 & 0xff) {
+        return -TARGET_EINVAL;
+    }
+    ((CPUCRISState *) cpu_env)->pregs[PR_PID] = arg1;
+    return 0;
+# elif defined(TARGET_I386) && defined(TARGET_ABI32)
+    return do_set_thread_area(cpu_env, arg1);
+# elif defined(TARGET_M68K)
+    CPUState *cpu = ENV_GET_CPU(cpu_env);
+    TaskState *ts = cpu->opaque;
+    ts->tp_value = arg1;
+    return 0;
+# else
+    return -TARGET_ENOSYS;
+# endif
+}
+#endif
+
 IMPL(settimeofday)
 {
     struct timeval tv;
@@ -12464,49 +12504,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_set_thread_area
-    case TARGET_NR_set_thread_area:
-#if defined(TARGET_MIPS)
-      ((CPUMIPSState *) cpu_env)->active_tc.CP0_UserLocal = arg1;
-      return 0;
-#elif defined(TARGET_CRIS)
-      if (arg1 & 0xff)
-          ret = -TARGET_EINVAL;
-      else {
-          ((CPUCRISState *) cpu_env)->pregs[PR_PID] = arg1;
-          ret = 0;
-      }
-      return ret;
-#elif defined(TARGET_I386) && defined(TARGET_ABI32)
-      return do_set_thread_area(cpu_env, arg1);
-#elif defined(TARGET_M68K)
-      {
-          TaskState *ts = cpu->opaque;
-          ts->tp_value = arg1;
-          return 0;
-      }
-#else
-      return -TARGET_ENOSYS;
-#endif
-#endif
-#ifdef TARGET_NR_get_thread_area
-    case TARGET_NR_get_thread_area:
-#if defined(TARGET_I386) && defined(TARGET_ABI32)
-        return do_get_thread_area(cpu_env, arg1);
-#elif defined(TARGET_M68K)
-        {
-            TaskState *ts = cpu->opaque;
-            return ts->tp_value;
-        }
-#else
-        return -TARGET_ENOSYS;
-#endif
-#endif
-#ifdef TARGET_NR_getdomainname
-    case TARGET_NR_getdomainname:
-        return -TARGET_ENOSYS;
-#endif
-
 #ifdef TARGET_NR_clock_settime
     case TARGET_NR_clock_settime:
     {
@@ -13391,6 +13388,9 @@ static impl_fn *syscall_table(unsigned num)
 #if defined(TARGET_NR_getdents64) && defined(__NR_getdents64)
         SYSCALL(getdents64);
 #endif
+#ifdef TARGET_NR_getdomainname
+        SYSCALL_WITH(getdomainname, enosys);
+#endif
 #ifdef TARGET_NR_getegid
         SYSCALL(getegid);
 #endif
@@ -13452,6 +13452,9 @@ static impl_fn *syscall_table(unsigned num)
 #endif
 #ifdef TARGET_NR_getsockopt
         SYSCALL(getsockopt);
+#endif
+#ifdef TARGET_NR_get_thread_area
+        SYSCALL(get_thread_area);
 #endif
         SYSCALL(gettid);
         SYSCALL(gettimeofday);
@@ -13748,6 +13751,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(setrlimit);
 #ifdef TARGET_NR_setsockopt
         SYSCALL(setsockopt);
+#endif
+#ifdef TARGET_NR_set_thread_area
+        SYSCALL(set_thread_area);
 #endif
         SYSCALL(settimeofday);
         SYSCALL(setsid);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 089/108] linux-user: Split out clock syscalls
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (87 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 088/108] linux-user: Split out getdomainname, get_thread_area, set_thread_area Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 090/108] linux-user: Fix clock_nanosleep Richard Henderson
                   ` (22 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

This includes clock_getres, clock_gettime, clock_nanosleep, clock_settime.
All targets define all of these; remove the ifdefs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 115 ++++++++++++++++++++++---------------------
 1 file changed, 60 insertions(+), 55 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 285612dfe5..6f19f75c67 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7855,6 +7855,62 @@ IMPL(clock_adjtime)
 }
 #endif
 
+IMPL(clock_getres)
+{
+    struct timespec ts;
+    abi_long ret;
+
+    ret = get_errno(clock_getres(arg1, &ts));
+    if (!is_error(ret)) {
+        ret = host_to_target_timespec(arg2, &ts);
+    }
+    return ret;
+}
+
+IMPL(clock_gettime)
+{
+    struct timespec ts;
+    abi_long ret;
+
+    ret = get_errno(clock_gettime(arg1, &ts));
+    if (!is_error(ret)) {
+        ret = host_to_target_timespec(arg2, &ts);
+    }
+    return ret;
+}
+
+IMPL(clock_nanosleep)
+{
+    struct timespec ts;
+    abi_long ret;
+
+    target_to_host_timespec(&ts, arg3);
+    ret = get_errno(safe_clock_nanosleep(arg1, arg2, &ts, arg4 ? &ts : NULL));
+    if (arg4) {
+        host_to_target_timespec(arg4, &ts);
+    }
+#if defined(TARGET_PPC)
+    /* clock_nanosleep is odd in that it returns positive errno values.
+     * On PPC, CR0 bit 3 should be set in such a situation. */
+    if (ret && ret != -TARGET_ERESTARTSYS) {
+        ((CPUPPCState *)cpu_env)->crf[0] |= 1;
+    }
+#endif
+    return ret;
+}
+
+IMPL(clock_settime)
+{
+    struct timespec ts;
+    abi_long ret;
+
+    ret = target_to_host_timespec(&ts, arg2);
+    if (!is_error(ret)) {
+        ret = get_errno(clock_settime(arg1, &ts));
+    }
+    return ret;
+}
+
 IMPL(clone)
 {
     /* Linux manages to have three different orderings for its
@@ -12504,61 +12560,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_clock_settime
-    case TARGET_NR_clock_settime:
-    {
-        struct timespec ts;
-
-        ret = target_to_host_timespec(&ts, arg2);
-        if (!is_error(ret)) {
-            ret = get_errno(clock_settime(arg1, &ts));
-        }
-        return ret;
-    }
-#endif
-#ifdef TARGET_NR_clock_gettime
-    case TARGET_NR_clock_gettime:
-    {
-        struct timespec ts;
-        ret = get_errno(clock_gettime(arg1, &ts));
-        if (!is_error(ret)) {
-            ret = host_to_target_timespec(arg2, &ts);
-        }
-        return ret;
-    }
-#endif
-#ifdef TARGET_NR_clock_getres
-    case TARGET_NR_clock_getres:
-    {
-        struct timespec ts;
-        ret = get_errno(clock_getres(arg1, &ts));
-        if (!is_error(ret)) {
-            host_to_target_timespec(arg2, &ts);
-        }
-        return ret;
-    }
-#endif
-#ifdef TARGET_NR_clock_nanosleep
-    case TARGET_NR_clock_nanosleep:
-    {
-        struct timespec ts;
-        target_to_host_timespec(&ts, arg3);
-        ret = get_errno(safe_clock_nanosleep(arg1, arg2,
-                                             &ts, arg4 ? &ts : NULL));
-        if (arg4)
-            host_to_target_timespec(arg4, &ts);
-
-#if defined(TARGET_PPC)
-        /* clock_nanosleep is odd in that it returns positive errno values.
-         * On PPC, CR0 bit 3 should be set in such a situation. */
-        if (ret && ret != -TARGET_ERESTARTSYS) {
-            ((CPUPPCState *)cpu_env)->crf[0] |= 1;
-        }
-#endif
-        return ret;
-    }
-#endif
-
 #if defined(TARGET_NR_set_tid_address) && defined(__NR_set_tid_address)
     case TARGET_NR_set_tid_address:
         return get_errno(set_tid_address((int *)g2h(arg1)));
@@ -13292,6 +13293,10 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef CONFIG_CLOCK_ADJTIME
         SYSCALL(clock_adjtime);
 #endif
+        SYSCALL(clock_getres);
+        SYSCALL(clock_gettime);
+        SYSCALL(clock_nanosleep);
+        SYSCALL(clock_settime);
         SYSCALL(clone);
         SYSCALL(close);
         SYSCALL(chdir);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 090/108] linux-user: Fix clock_nanosleep
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (88 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 089/108] linux-user: Split out clock syscalls Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 091/108] linux-user: Split out set_tid_address, tgkill, tkill Richard Henderson
                   ` (21 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

When we switched from using clock_nanosleep to safe_clock_nanosleep,
we changed from the user-level API to the kernel-level ABI.  These
have different senses of the errno value.

The special handling for PowerPC is not requied while we're following
the kernel ABI.

Fixes: 9e518226f43
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 6f19f75c67..1c1e05dc26 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7884,18 +7884,20 @@ IMPL(clock_nanosleep)
     struct timespec ts;
     abi_long ret;
 
-    target_to_host_timespec(&ts, arg3);
-    ret = get_errno(safe_clock_nanosleep(arg1, arg2, &ts, arg4 ? &ts : NULL));
-    if (arg4) {
-        host_to_target_timespec(arg4, &ts);
+    /* Note that while the user-level api for clock_nanosleep
+     * returns a positive errno values, the kernel-level api
+     * continues to return negative errno values.  Also note
+     * that safe_clock_nanosleep mirrors the kernel api.
+     */
+    ret = target_to_host_timespec(&ts, arg3);
+    if (ret == 0) {
+        ret = safe_clock_nanosleep(arg1, arg2, &ts, arg4 ? &ts : NULL);
+        if (ret) {
+            ret = -host_to_target_errno(-ret);
+        } else if (arg4) {
+            ret = host_to_target_timespec(arg4, &ts);
+        }
     }
-#if defined(TARGET_PPC)
-    /* clock_nanosleep is odd in that it returns positive errno values.
-     * On PPC, CR0 bit 3 should be set in such a situation. */
-    if (ret && ret != -TARGET_ERESTARTSYS) {
-        ((CPUPPCState *)cpu_env)->crf[0] |= 1;
-    }
-#endif
     return ret;
 }
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 091/108] linux-user: Split out set_tid_address, tgkill, tkill
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (89 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 090/108] linux-user: Fix clock_nanosleep Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 092/108] linux-user: Split out futex, utimensat Richard Henderson
                   ` (20 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define set_tid_address; remove the ifdef.
Use the bogus syscall method to supply the host syscall.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 37 ++++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 15 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1c1e05dc26..8406b9d8d3 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -250,6 +250,9 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,	\
 #ifndef __NR_gettid
 #define __NR_gettid  -1
 #endif
+#ifndef __NR_set_tid_address
+#define __NR_set_tid_address  -1
+#endif
 
 _syscall0(int, gettid)
 
@@ -278,9 +281,7 @@ _syscall3(int,sys_syslog,int,type,char*,bufp,int,len)
 #ifdef __NR_exit_group
 _syscall1(int,exit_group,int,error_code)
 #endif
-#if defined(TARGET_NR_set_tid_address) && defined(__NR_set_tid_address)
 _syscall1(int,set_tid_address,int *,tidptr)
-#endif
 #if defined(TARGET_NR_futex) && defined(__NR_futex)
 _syscall6(int,sys_futex,int *,uaddr,int,op,int,val,
           const struct timespec *,timeout,int *,uaddr2,int,val3)
@@ -11578,6 +11579,11 @@ IMPL(set_thread_area)
 }
 #endif
 
+IMPL(set_tid_address)
+{
+    return get_errno(set_tid_address((int *)g2h(arg1)));
+}
+
 IMPL(settimeofday)
 {
     struct timeval tv;
@@ -12210,6 +12216,12 @@ IMPL(syslog)
     }
 }
 
+IMPL(tgkill)
+{
+    return get_errno(safe_tgkill((int)arg1, (int)arg2,
+                                 target_to_host_signal(arg3)));
+}
+
 #ifdef TARGET_NR_time
 IMPL(time)
 {
@@ -12244,6 +12256,11 @@ IMPL(times)
     return host_to_target_clock_t(ret);
 }
 
+IMPL(tkill)
+{
+    return get_errno(safe_tkill((int)arg1, target_to_host_signal(arg2)));
+}
+
 IMPL(truncate)
 {
     char *p = lock_user_string(arg1);
@@ -12562,19 +12579,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#if defined(TARGET_NR_set_tid_address) && defined(__NR_set_tid_address)
-    case TARGET_NR_set_tid_address:
-        return get_errno(set_tid_address((int *)g2h(arg1)));
-#endif
-
-    case TARGET_NR_tkill:
-        return get_errno(safe_tkill((int)arg1, target_to_host_signal(arg2)));
-
-    case TARGET_NR_tgkill:
-        return get_errno(safe_tgkill((int)arg1, (int)arg2,
-                         target_to_host_signal(arg3)));
-
-
 #if defined(TARGET_NR_utimensat)
     case TARGET_NR_utimensat:
         {
@@ -13762,6 +13766,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_set_thread_area
         SYSCALL(set_thread_area);
 #endif
+        SYSCALL(set_tid_address);
         SYSCALL(settimeofday);
         SYSCALL(setsid);
         SYSCALL(setuid);
@@ -13827,10 +13832,12 @@ static impl_fn *syscall_table(unsigned num)
 #endif
         SYSCALL(sysinfo);
         SYSCALL(syslog);
+        SYSCALL(tgkill);
 #ifdef TARGET_NR_time
         SYSCALL(time);
 #endif
         SYSCALL(times);
+        SYSCALL(tkill);
         SYSCALL(truncate);
 #ifdef TARGET_NR_truncate64
         SYSCALL(truncate64);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 092/108] linux-user: Split out futex, utimensat
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (90 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 091/108] linux-user: Split out set_tid_address, tgkill, tkill Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 093/108] linux-user: Remove sys_futex Richard Henderson
                   ` (19 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

At the same time, merge do_futex into the new function.
All targets define utimensat; remove the ifdef.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 161 ++++++++++++++++++++++---------------------
 1 file changed, 81 insertions(+), 80 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8406b9d8d3..800b79276f 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -602,8 +602,7 @@ static int sys_getcwd1(char *buf, size_t size)
   return strlen(buf)+1;
 }
 
-#ifdef TARGET_NR_utimensat
-#if defined(__NR_utimensat)
+#ifdef __NR_utimensat
 #define __NR_sys_utimensat __NR_utimensat
 _syscall4(int,sys_utimensat,int,dirfd,const char *,pathname,
           const struct timespec *,tsp,int,flags)
@@ -615,7 +614,6 @@ static int sys_utimensat(int dirfd, const char *pathname,
     return -1;
 }
 #endif
-#endif /* TARGET_NR_utimensat */
 
 #if defined(__NR_renameat2)
 #define __NR_sys_renameat2 __NR_renameat2
@@ -7024,58 +7022,6 @@ static abi_long host_to_target_statfs64(abi_ulong target_addr,
 }
 #endif
 
-/* ??? Using host futex calls even when target atomic operations
-   are not really atomic probably breaks things.  However implementing
-   futexes locally would make futexes shared between multiple processes
-   tricky.  However they're probably useless because guest atomic
-   operations won't work either.  */
-static int do_futex(target_ulong uaddr, int op, int val, target_ulong timeout,
-                    target_ulong uaddr2, int val3)
-{
-    struct timespec ts, *pts;
-    int base_op;
-
-    /* ??? We assume FUTEX_* constants are the same on both host
-       and target.  */
-#ifdef FUTEX_CMD_MASK
-    base_op = op & FUTEX_CMD_MASK;
-#else
-    base_op = op;
-#endif
-    switch (base_op) {
-    case FUTEX_WAIT:
-    case FUTEX_WAIT_BITSET:
-        if (timeout) {
-            pts = &ts;
-            target_to_host_timespec(pts, timeout);
-        } else {
-            pts = NULL;
-        }
-        return get_errno(safe_futex(g2h(uaddr), op, tswap32(val),
-                         pts, NULL, val3));
-    case FUTEX_WAKE:
-        return get_errno(safe_futex(g2h(uaddr), op, val, NULL, NULL, 0));
-    case FUTEX_FD:
-        return get_errno(safe_futex(g2h(uaddr), op, val, NULL, NULL, 0));
-    case FUTEX_REQUEUE:
-    case FUTEX_CMP_REQUEUE:
-    case FUTEX_WAKE_OP:
-        /* For FUTEX_REQUEUE, FUTEX_CMP_REQUEUE, and FUTEX_WAKE_OP, the
-           TIMEOUT parameter is interpreted as a uint32_t by the kernel.
-           But the prototype takes a `struct timespec *'; insert casts
-           to satisfy the compiler.  We do not need to tswap TIMEOUT
-           since it's not compared to guest memory.  */
-        pts = (struct timespec *)(uintptr_t) timeout;
-        return get_errno(safe_futex(g2h(uaddr), op, val, pts,
-                                    g2h(uaddr2),
-                                    (base_op == FUTEX_CMP_REQUEUE
-                                     ? tswap32(val3)
-                                     : val3)));
-    default:
-        return -TARGET_ENOSYS;
-    }
-}
-
 #if defined(TARGET_NR_signalfd) || defined(TARGET_NR_signalfd4)
 
 /* signalfd siginfo conversion */
@@ -8574,6 +8520,58 @@ IMPL(ftruncate64)
 }
 #endif
 
+IMPL(futex)
+{
+    target_ulong uaddr = arg1;
+    int op = arg2;
+    int val = arg3;
+    target_ulong timeout = arg4;
+    target_ulong uaddr2 = arg5;
+    int val3 = arg6;
+    struct timespec ts, *pts;
+    int base_op;
+
+    /* ??? We assume FUTEX_* constants are the same on both host
+       and target.  */
+#ifdef FUTEX_CMD_MASK
+    base_op = op & FUTEX_CMD_MASK;
+#else
+    base_op = op;
+#endif
+    switch (base_op) {
+    case FUTEX_WAIT:
+    case FUTEX_WAIT_BITSET:
+        if (timeout) {
+            pts = &ts;
+            target_to_host_timespec(pts, timeout);
+        } else {
+            pts = NULL;
+        }
+        return get_errno(safe_futex(g2h(uaddr), op, tswap32(val),
+                         pts, NULL, val3));
+    case FUTEX_WAKE:
+        return get_errno(safe_futex(g2h(uaddr), op, val, NULL, NULL, 0));
+    case FUTEX_FD:
+        return get_errno(safe_futex(g2h(uaddr), op, val, NULL, NULL, 0));
+    case FUTEX_REQUEUE:
+    case FUTEX_CMP_REQUEUE:
+    case FUTEX_WAKE_OP:
+        /* For FUTEX_REQUEUE, FUTEX_CMP_REQUEUE, and FUTEX_WAKE_OP, the
+           TIMEOUT parameter is interpreted as a uint32_t by the kernel.
+           But the prototype takes a `struct timespec *'; insert casts
+           to satisfy the compiler.  We do not need to tswap TIMEOUT
+           since it's not compared to guest memory.  */
+        pts = (struct timespec *)(uintptr_t) timeout;
+        return get_errno(safe_futex(g2h(uaddr), op, val, pts,
+                                    g2h(uaddr2),
+                                    (base_op == FUTEX_CMP_REQUEUE
+                                     ? tswap32(val3)
+                                     : val3)));
+    default:
+        return -TARGET_ENOSYS;
+    }
+}
+
 #ifdef TARGET_NR_futimesat
 IMPL(futimesat)
 {
@@ -12425,6 +12423,32 @@ IMPL(utime)
 }
 #endif
 
+IMPL(utimensat)
+{
+    struct timespec *tsp = NULL, ts[2];
+    abi_long ret;
+    char *p;
+
+    if (arg3) {
+        if (target_to_host_timespec(&ts[0], arg3) ||
+            target_to_host_timespec(&ts[1], arg3
+                                    + sizeof(struct target_timespec))) {
+            return -TARGET_EFAULT;
+        }
+        tsp = ts;
+    }
+    if (!arg2) {
+        return get_errno(sys_utimensat(arg1, NULL, tsp, arg4));
+    }
+    p = lock_user_string(arg2);
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(sys_utimensat(arg1, path(p), tsp, arg4));
+    unlock_user(p, arg2, 0);
+    return ret;
+}
+
 #ifdef TARGET_NR_utimes
 IMPL(utimes)
 {
@@ -12579,31 +12603,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#if defined(TARGET_NR_utimensat)
-    case TARGET_NR_utimensat:
-        {
-            struct timespec *tsp, ts[2];
-            if (!arg3) {
-                tsp = NULL;
-            } else {
-                target_to_host_timespec(ts, arg3);
-                target_to_host_timespec(ts+1, arg3+sizeof(struct target_timespec));
-                tsp = ts;
-            }
-            if (!arg2)
-                ret = get_errno(sys_utimensat(arg1, NULL, tsp, arg4));
-            else {
-                if (!(p = lock_user_string(arg2))) {
-                    return -TARGET_EFAULT;
-                }
-                ret = get_errno(sys_utimensat(arg1, path(p), tsp, arg4));
-                unlock_user(p, arg2, 0);
-            }
-        }
-        return ret;
-#endif
-    case TARGET_NR_futex:
-        return do_futex(arg1, arg2, arg3, arg4, arg5, arg6);
 #if defined(TARGET_NR_inotify_init) && defined(__NR_inotify_init)
     case TARGET_NR_inotify_init:
         ret = get_errno(sys_inotify_init());
@@ -13388,6 +13387,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_ftruncate64
         SYSCALL(ftruncate64);
 #endif
+        SYSCALL(futex);
 #ifdef TARGET_NR_futimesat
         SYSCALL(futimesat);
 #endif
@@ -13858,6 +13858,7 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_utime
         SYSCALL(utime);
 #endif
+        SYSCALL(utimensat);
 #ifdef TARGET_NR_utimes
         SYSCALL(utimes);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 093/108] linux-user: Remove sys_futex
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (91 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 092/108] linux-user: Split out futex, utimensat Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 094/108] linux-user: Split out inotify syscalls Richard Henderson
                   ` (18 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

We can use safe_futex in the one place that used sys_futex;
no need to define them both.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 800b79276f..95b30adea2 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -235,7 +235,6 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,	\
 #define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo
 #define __NR_sys_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo
 #define __NR_sys_syslog __NR_syslog
-#define __NR_sys_futex __NR_futex
 #define __NR_sys_inotify_init __NR_inotify_init
 #define __NR_sys_inotify_add_watch __NR_inotify_add_watch
 #define __NR_sys_inotify_rm_watch __NR_inotify_rm_watch
@@ -282,10 +281,6 @@ _syscall3(int,sys_syslog,int,type,char*,bufp,int,len)
 _syscall1(int,exit_group,int,error_code)
 #endif
 _syscall1(int,set_tid_address,int *,tidptr)
-#if defined(TARGET_NR_futex) && defined(__NR_futex)
-_syscall6(int,sys_futex,int *,uaddr,int,op,int,val,
-          const struct timespec *,timeout,int *,uaddr2,int,val3)
-#endif
 #define __NR_sys_sched_getaffinity __NR_sched_getaffinity
 _syscall3(int, sys_sched_getaffinity, pid_t, pid, unsigned int, len,
           unsigned long *, user_mask_ptr);
@@ -8079,8 +8074,8 @@ IMPL(exit)
         TaskState *ts = cpu->opaque;
         if (ts->child_tidptr) {
             put_user_u32(0, ts->child_tidptr);
-            sys_futex(g2h(ts->child_tidptr), FUTEX_WAKE, INT_MAX,
-                      NULL, NULL, 0);
+            safe_futex(g2h(ts->child_tidptr), FUTEX_WAKE, INT_MAX,
+                       NULL, NULL, 0);
         }
         thread_cpu = NULL;
         object_unref(OBJECT(cpu));
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 094/108] linux-user: Split out inotify syscalls
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (92 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 093/108] linux-user: Remove sys_futex Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 095/108] linux-user: Split out mq syscalls Richard Henderson
                   ` (17 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

This includes inotify_add_watch, inotify_init, inotify_init1,
and inotify_rm_watch.  At the same time, merge in the useless
wrappers around the libc functions.  If host inotify_init1 is
not available, use inotify_init if flags == 0.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 139 ++++++++++++++++++++-----------------------
 1 file changed, 65 insertions(+), 74 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 95b30adea2..a540c1455b 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -74,6 +74,9 @@
 #ifdef CONFIG_SENDFILE
 #include <sys/sendfile.h>
 #endif
+#ifdef CONFIG_INOTIFY
+#include <sys/inotify.h>
+#endif
 
 #define termios host_termios
 #define winsize host_winsize
@@ -235,9 +238,6 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,	\
 #define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo
 #define __NR_sys_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo
 #define __NR_sys_syslog __NR_syslog
-#define __NR_sys_inotify_init __NR_inotify_init
-#define __NR_sys_inotify_add_watch __NR_inotify_add_watch
-#define __NR_sys_inotify_rm_watch __NR_inotify_rm_watch
 
 /* These definitions produce an ENOSYS from the host kernel.
  * Performing a bogus syscall is lazier than boilerplating
@@ -626,43 +626,6 @@ static int sys_renameat2(int oldfd, const char *old,
 }
 #endif
 
-#ifdef CONFIG_INOTIFY
-#include <sys/inotify.h>
-
-#if defined(TARGET_NR_inotify_init) && defined(__NR_inotify_init)
-static int sys_inotify_init(void)
-{
-  return (inotify_init());
-}
-#endif
-#if defined(TARGET_NR_inotify_add_watch) && defined(__NR_inotify_add_watch)
-static int sys_inotify_add_watch(int fd,const char *pathname, int32_t mask)
-{
-  return (inotify_add_watch(fd, pathname, mask));
-}
-#endif
-#if defined(TARGET_NR_inotify_rm_watch) && defined(__NR_inotify_rm_watch)
-static int sys_inotify_rm_watch(int fd, int32_t wd)
-{
-  return (inotify_rm_watch(fd, wd));
-}
-#endif
-#ifdef CONFIG_INOTIFY1
-#if defined(TARGET_NR_inotify_init1) && defined(__NR_inotify_init1)
-static int sys_inotify_init1(int flags)
-{
-  return (inotify_init1(flags));
-}
-#endif
-#endif
-#else
-/* Userspace can usually survive runtime without inotify */
-#undef TARGET_NR_inotify_init
-#undef TARGET_NR_inotify_init1
-#undef TARGET_NR_inotify_add_watch
-#undef TARGET_NR_inotify_rm_watch
-#endif /* CONFIG_INOTIFY  */
-
 #if defined(TARGET_NR_prlimit64)
 #ifndef __NR_prlimit64
 # define __NR_prlimit64 -1
@@ -7421,9 +7384,7 @@ static TargetFdTrans target_eventfd_trans = {
     .target_to_host_data = swap_data_eventfd,
 };
 
-#if (defined(TARGET_NR_inotify_init) && defined(__NR_inotify_init)) || \
-    (defined(CONFIG_INOTIFY1) && defined(TARGET_NR_inotify_init1) && \
-     defined(__NR_inotify_init1))
+#ifdef CONFIG_INOTIFY
 static abi_long host_to_target_data_inotify(void *buf, size_t len)
 {
     struct inotify_event *ev;
@@ -9177,6 +9138,59 @@ IMPL(getxuid)
 }
 #endif
 
+#ifdef CONFIG_INOTIFY
+IMPL(inotify_add_watch)
+{
+    char *p;
+    abi_long ret;
+
+    p = lock_user_string(arg2);
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(inotify_add_watch(arg1, path(p), arg3));
+    unlock_user(p, arg2, 0);
+    return ret;
+}
+
+# ifdef TARGET_NR_inotify_init
+IMPL(inotify_init)
+{
+    abi_long ret = get_errno(inotify_init());
+    if (!is_error(ret)) {
+        fd_trans_register(ret, &target_inotify_trans);
+    }
+    return ret;
+}
+# endif
+
+IMPL(inotify_init1)
+{
+    int flags = target_to_host_bitmask(arg1, fcntl_flags_tbl);
+    abi_long ret;
+
+# ifdef CONFIG_INOTIFY1
+    ret = inotify_init1(flags);
+# else
+    if (arg1 == 0) {
+        ret = inotify_init();
+    } else {
+        return -TARGET_ENOSYS;
+    }
+# endif
+    ret = get_errno(ret);
+    if (!is_error(ret)) {
+        fd_trans_register(ret, &target_inotify_trans);
+    }
+    return ret;
+}
+
+IMPL(inotify_rm_watch)
+{
+    return get_errno(inotify_rm_watch(arg1, arg2));
+}
+#endif /* CONFIG_INOTIFY */
+
 /* ??? Implement proper locking for ioctls.  */
 IMPL(ioctl)
 {
@@ -12598,37 +12612,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#if defined(TARGET_NR_inotify_init) && defined(__NR_inotify_init)
-    case TARGET_NR_inotify_init:
-        ret = get_errno(sys_inotify_init());
-        if (ret >= 0) {
-            fd_trans_register(ret, &target_inotify_trans);
-        }
-        return ret;
-#endif
-#ifdef CONFIG_INOTIFY1
-#if defined(TARGET_NR_inotify_init1) && defined(__NR_inotify_init1)
-    case TARGET_NR_inotify_init1:
-        ret = get_errno(sys_inotify_init1(target_to_host_bitmask(arg1,
-                                          fcntl_flags_tbl)));
-        if (ret >= 0) {
-            fd_trans_register(ret, &target_inotify_trans);
-        }
-        return ret;
-#endif
-#endif
-#if defined(TARGET_NR_inotify_add_watch) && defined(__NR_inotify_add_watch)
-    case TARGET_NR_inotify_add_watch:
-        p = lock_user_string(arg2);
-        ret = get_errno(sys_inotify_add_watch(arg1, path(p), arg3));
-        unlock_user(p, arg2, 0);
-        return ret;
-#endif
-#if defined(TARGET_NR_inotify_rm_watch) && defined(__NR_inotify_rm_watch)
-    case TARGET_NR_inotify_rm_watch:
-        return get_errno(sys_inotify_rm_watch(arg1, arg2));
-#endif
-
 #if defined(TARGET_NR_mq_open) && defined(__NR_mq_open)
     case TARGET_NR_mq_open:
         {
@@ -13481,6 +13464,14 @@ static impl_fn *syscall_table(unsigned num)
 #endif
 #if defined(TARGET_NR_getxuid) && defined(TARGET_ALPHA)
         SYSCALL(getxuid);
+#endif
+#ifdef CONFIG_INOTIFY
+        SYSCALL(inotify_add_watch);
+# ifdef TARGET_NR_inotify_init
+        SYSCALL(inotify_init);
+# endif
+        SYSCALL(inotify_init1);
+        SYSCALL(inotify_rm_watch);
 #endif
         SYSCALL(ioctl);
 #ifdef TARGET_NR_ipc
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 095/108] linux-user: Split out mq syscalls
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (93 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 094/108] linux-user: Split out inotify syscalls Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 096/108] linux-user: Split out splice, tee, vmsplice Richard Henderson
                   ` (16 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

This includes mq_getsetattr, mq_open, mq_timedreceive, mq_timedsend,
and mq_unlink.  All targets define these syscalls; remove the ifdefs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 211 +++++++++++++++++++++++--------------------
 1 file changed, 112 insertions(+), 99 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index a540c1455b..0c312cd156 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -77,6 +77,7 @@
 #ifdef CONFIG_INOTIFY
 #include <sys/inotify.h>
 #endif
+#include <mqueue.h>
 
 #define termios host_termios
 #define winsize host_winsize
@@ -1000,12 +1001,10 @@ static int safe_semtimedop(int semid, struct sembuf *tsops, unsigned nsops,
                     (long)timeout);
 }
 #endif
-#if defined(TARGET_NR_mq_open) && defined(__NR_mq_open)
 safe_syscall5(int, mq_timedsend, int, mqdes, const char *, msg_ptr,
               size_t, len, unsigned, prio, const struct timespec *, timeout)
 safe_syscall5(int, mq_timedreceive, int, mqdes, char *, msg_ptr,
               size_t, len, unsigned *, prio, const struct timespec *, timeout)
-#endif
 /* We do ioctl like this rather than via safe_syscall3 to preserve the
  * "third argument might be integer or pointer or not present" behaviour of
  * the libc function.
@@ -1382,9 +1381,6 @@ static inline abi_long copy_from_user_timezone(struct timezone *tz,
     return 0;
 }
 
-#if defined(TARGET_NR_mq_open) && defined(__NR_mq_open)
-#include <mqueue.h>
-
 static inline abi_long copy_from_user_mq_attr(struct mq_attr *attr,
                                               abi_ulong target_mq_attr_addr)
 {
@@ -1422,7 +1418,6 @@ static inline abi_long copy_to_user_mq_attr(abi_ulong target_mq_attr_addr,
 
     return 0;
 }
-#endif
 
 #if defined(TARGET_NR_select) || defined(TARGET_NR__newselect)
 /* do_select() must return target values and target errnos. */
@@ -9836,6 +9831,112 @@ IMPL(mprotect)
     return get_errno(target_mprotect(arg1, arg2, arg3));
 }
 
+IMPL(mq_getsetattr)
+{
+    struct mq_attr in, out;
+    abi_long ret = 0;
+
+    if (arg2 != 0) {
+        ret = copy_from_user_mq_attr(&in, arg2);
+        if (ret) {
+            return ret;
+        }
+        ret = get_errno(mq_setattr(arg1, &in, &out));
+    } else if (arg3 != 0) {
+        ret = get_errno(mq_getattr(arg1, &out));
+    }
+    if (ret == 0 && arg3 != 0) {
+        ret = copy_to_user_mq_attr(arg3, &out);
+    }
+    return ret;
+}
+
+IMPL(mq_open)
+{
+    struct mq_attr posix_mq_attr;
+    struct mq_attr *pposix_mq_attr;
+    int host_flags;
+    abi_long ret;
+    char *p;
+
+    host_flags = target_to_host_bitmask(arg2, fcntl_flags_tbl);
+    pposix_mq_attr = NULL;
+    if (arg4) {
+        if (copy_from_user_mq_attr(&posix_mq_attr, arg4) != 0) {
+            return -TARGET_EFAULT;
+        }
+        pposix_mq_attr = &posix_mq_attr;
+    }
+    p = lock_user_string(arg1 - 1);
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(mq_open(p, host_flags, arg3, pposix_mq_attr));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+
+IMPL(mq_timedreceive)
+{
+    struct timespec ts;
+    unsigned int prio;
+    abi_long ret;
+    void *p;
+
+    p = lock_user(VERIFY_READ, arg2, arg3, 1);
+    if (arg5 != 0) {
+        ret = target_to_host_timespec(&ts, arg5);
+        if (ret == 0) {
+            ret = get_errno(safe_mq_timedreceive(arg1, p, arg3, &prio, &ts));
+            if (ret == 0) {
+                ret = host_to_target_timespec(arg5, &ts);
+            }
+        }
+    } else {
+        ret = get_errno(safe_mq_timedreceive(arg1, p, arg3, &prio, NULL));
+    }
+    unlock_user(p, arg2, arg3);
+    if (ret == 0 && arg4 != 0) {
+        ret = put_user_u32(prio, arg4);
+    }
+    return ret;
+}
+
+IMPL(mq_timedsend)
+{
+    struct timespec ts;
+    abi_long ret;
+    void *p;
+
+    p = lock_user(VERIFY_READ, arg2, arg3, 1);
+    if (arg5 != 0) {
+        ret = target_to_host_timespec(&ts, arg5);
+        if (ret == 0) {
+            ret = get_errno(safe_mq_timedsend(arg1, p, arg3, arg4, &ts));
+            if (ret == 0) {
+                ret = host_to_target_timespec(arg5, &ts);
+            }
+        }
+    } else {
+        ret = get_errno(safe_mq_timedsend(arg1, p, arg3, arg4, NULL));
+    }
+    unlock_user(p, arg2, arg3);
+    return ret;
+}
+
+IMPL(mq_unlink)
+{
+    char *p = lock_user_string(arg1 - 1);
+    abi_long ret;
+
+    if (!p) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(mq_unlink(p));
+    unlock_user(p, arg1, 0);
+    return ret;
+}
+
 IMPL(mremap)
 {
     return get_errno(target_mremap(arg1, arg2, arg3, arg4, arg5));
@@ -12609,101 +12710,8 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
 {
     CPUState *cpu __attribute__((unused)) = ENV_GET_CPU(cpu_env);
     abi_long ret;
-    void *p;
 
     switch(num) {
-#if defined(TARGET_NR_mq_open) && defined(__NR_mq_open)
-    case TARGET_NR_mq_open:
-        {
-            struct mq_attr posix_mq_attr;
-            struct mq_attr *pposix_mq_attr;
-            int host_flags;
-
-            host_flags = target_to_host_bitmask(arg2, fcntl_flags_tbl);
-            pposix_mq_attr = NULL;
-            if (arg4) {
-                if (copy_from_user_mq_attr(&posix_mq_attr, arg4) != 0) {
-                    return -TARGET_EFAULT;
-                }
-                pposix_mq_attr = &posix_mq_attr;
-            }
-            p = lock_user_string(arg1 - 1);
-            if (!p) {
-                return -TARGET_EFAULT;
-            }
-            ret = get_errno(mq_open(p, host_flags, arg3, pposix_mq_attr));
-            unlock_user (p, arg1, 0);
-        }
-        return ret;
-
-    case TARGET_NR_mq_unlink:
-        p = lock_user_string(arg1 - 1);
-        if (!p) {
-            return -TARGET_EFAULT;
-        }
-        ret = get_errno(mq_unlink(p));
-        unlock_user (p, arg1, 0);
-        return ret;
-
-    case TARGET_NR_mq_timedsend:
-        {
-            struct timespec ts;
-
-            p = lock_user (VERIFY_READ, arg2, arg3, 1);
-            if (arg5 != 0) {
-                target_to_host_timespec(&ts, arg5);
-                ret = get_errno(safe_mq_timedsend(arg1, p, arg3, arg4, &ts));
-                host_to_target_timespec(arg5, &ts);
-            } else {
-                ret = get_errno(safe_mq_timedsend(arg1, p, arg3, arg4, NULL));
-            }
-            unlock_user (p, arg2, arg3);
-        }
-        return ret;
-
-    case TARGET_NR_mq_timedreceive:
-        {
-            struct timespec ts;
-            unsigned int prio;
-
-            p = lock_user (VERIFY_READ, arg2, arg3, 1);
-            if (arg5 != 0) {
-                target_to_host_timespec(&ts, arg5);
-                ret = get_errno(safe_mq_timedreceive(arg1, p, arg3,
-                                                     &prio, &ts));
-                host_to_target_timespec(arg5, &ts);
-            } else {
-                ret = get_errno(safe_mq_timedreceive(arg1, p, arg3,
-                                                     &prio, NULL));
-            }
-            unlock_user (p, arg2, arg3);
-            if (arg4 != 0)
-                put_user_u32(prio, arg4);
-        }
-        return ret;
-
-    /* Not implemented for now... */
-/*     case TARGET_NR_mq_notify: */
-/*         break; */
-
-    case TARGET_NR_mq_getsetattr:
-        {
-            struct mq_attr posix_mq_attr_in, posix_mq_attr_out;
-            ret = 0;
-            if (arg2 != 0) {
-                copy_from_user_mq_attr(&posix_mq_attr_in, arg2);
-                ret = get_errno(mq_setattr(arg1, &posix_mq_attr_in,
-                                           &posix_mq_attr_out));
-            } else if (arg3 != 0) {
-                ret = get_errno(mq_getattr(arg1, &posix_mq_attr_out));
-            }
-            if (ret == 0 && arg3 != 0) {
-                copy_to_user_mq_attr(arg3, &posix_mq_attr_out);
-            }
-        }
-        return ret;
-#endif
-
 #ifdef CONFIG_SPLICE
 #ifdef TARGET_NR_tee
     case TARGET_NR_tee:
@@ -13537,6 +13545,11 @@ static impl_fn *syscall_table(unsigned num)
 #endif
         SYSCALL(mount);
         SYSCALL(mprotect);
+        SYSCALL(mq_getsetattr);
+        SYSCALL(mq_open);
+        SYSCALL(mq_timedreceive);
+        SYSCALL(mq_timedsend);
+        SYSCALL(mq_unlink);
         SYSCALL(mremap);
 #ifdef TARGET_NR_msgctl
         SYSCALL(msgctl);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 096/108] linux-user: Split out splice, tee, vmsplice
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (94 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 095/108] linux-user: Split out mq syscalls Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 097/108] linux-user: Split out eventfd, eventfd2 Richard Henderson
                   ` (15 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define all of these; remove the ifdefs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 117 +++++++++++++++++++++++--------------------
 1 file changed, 64 insertions(+), 53 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 0c312cd156..8548f113d1 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -12075,6 +12075,39 @@ IMPL(socketpair)
 }
 #endif
 
+#ifdef CONFIG_SPLICE
+IMPL(splice)
+{
+    loff_t loff_in, loff_out;
+    loff_t *ploff_in = NULL, *ploff_out = NULL;
+    abi_long ret;
+
+    if (arg2) {
+        if (get_user_u64(loff_in, arg2)) {
+            return -TARGET_EFAULT;
+        }
+        ploff_in = &loff_in;
+    }
+    if (arg4) {
+        if (get_user_u64(loff_out, arg4)) {
+            return -TARGET_EFAULT;
+        }
+        ploff_out = &loff_out;
+    }
+    ret = get_errno(splice(arg1, ploff_in, arg3, ploff_out, arg5, arg6));
+    if (arg2) {
+        if (put_user_u64(loff_in, arg2)) {
+            return -TARGET_EFAULT;
+        }
+    }
+    if (arg4) {
+        if (put_user_u64(loff_out, arg4)) {
+            return -TARGET_EFAULT;
+        }
+    }
+    return ret;
+}
+#endif
 #ifdef TARGET_NR_ssetmask
 IMPL(ssetmask)
 {
@@ -12324,6 +12357,13 @@ IMPL(syslog)
     }
 }
 
+#ifdef CONFIG_SPLICE
+IMPL(tee)
+{
+    return get_errno(tee(arg1, arg2, arg3, arg4));
+}
+#endif
+
 IMPL(tgkill)
 {
     return get_errno(safe_tgkill((int)arg1, (int)arg2,
@@ -12603,6 +12643,21 @@ IMPL(vm86)
 }
 #endif
 
+#ifdef CONFIG_SPLICE
+IMPL(vmsplice)
+{
+    struct iovec *vec = lock_iovec(VERIFY_READ, arg2, arg3, 1);
+    abi_long ret;
+
+    if (vec == NULL) {
+        return -host_to_target_errno(errno);
+    }
+    ret = get_errno(vmsplice(arg1, vec, arg3, arg4));
+    unlock_iovec(vec, arg2, arg3, 0);
+    return ret;
+}
+#endif
+
 IMPL(wait4)
 {
     int status;
@@ -12712,59 +12767,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     abi_long ret;
 
     switch(num) {
-#ifdef CONFIG_SPLICE
-#ifdef TARGET_NR_tee
-    case TARGET_NR_tee:
-        {
-            ret = get_errno(tee(arg1,arg2,arg3,arg4));
-        }
-        return ret;
-#endif
-#ifdef TARGET_NR_splice
-    case TARGET_NR_splice:
-        {
-            loff_t loff_in, loff_out;
-            loff_t *ploff_in = NULL, *ploff_out = NULL;
-            if (arg2) {
-                if (get_user_u64(loff_in, arg2)) {
-                    return -TARGET_EFAULT;
-                }
-                ploff_in = &loff_in;
-            }
-            if (arg4) {
-                if (get_user_u64(loff_out, arg4)) {
-                    return -TARGET_EFAULT;
-                }
-                ploff_out = &loff_out;
-            }
-            ret = get_errno(splice(arg1, ploff_in, arg3, ploff_out, arg5, arg6));
-            if (arg2) {
-                if (put_user_u64(loff_in, arg2)) {
-                    return -TARGET_EFAULT;
-                }
-            }
-            if (arg4) {
-                if (put_user_u64(loff_out, arg4)) {
-                    return -TARGET_EFAULT;
-                }
-            }
-        }
-        return ret;
-#endif
-#ifdef TARGET_NR_vmsplice
-	case TARGET_NR_vmsplice:
-        {
-            struct iovec *vec = lock_iovec(VERIFY_READ, arg2, arg3, 1);
-            if (vec != NULL) {
-                ret = get_errno(vmsplice(arg1, vec, arg3, arg4));
-                unlock_iovec(vec, arg2, arg3, 0);
-            } else {
-                ret = -host_to_target_errno(errno);
-            }
-        }
-        return ret;
-#endif
-#endif /* CONFIG_SPLICE */
 #ifdef CONFIG_EVENTFD
 #if defined(TARGET_NR_eventfd)
     case TARGET_NR_eventfd:
@@ -13800,6 +13802,9 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_socketpair
         SYSCALL(socketpair);
 #endif
+#ifdef CONFIG_SPLICE
+        SYSCALL(splice);
+#endif
 #ifdef TARGET_NR_ssetmask
         SYSCALL(ssetmask);
 #endif
@@ -13831,6 +13836,9 @@ static impl_fn *syscall_table(unsigned num)
 #endif
         SYSCALL(sysinfo);
         SYSCALL(syslog);
+#ifdef CONFIG_SPLICE
+        SYSCALL(tee);
+#endif
         SYSCALL(tgkill);
 #ifdef TARGET_NR_time
         SYSCALL(time);
@@ -13867,6 +13875,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(vhangup);
 #if defined(TARGET_I386) && !defined(TARGET_X86_64)
         SYSCALL(vm86);
+#endif
+#ifdef CONFIG_SPLICE
+        SYSCALL(vmsplice);
 #endif
         SYSCALL(wait4);
         SYSCALL(waitid);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 097/108] linux-user: Split out eventfd, eventfd2
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (95 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 096/108] linux-user: Split out splice, tee, vmsplice Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 098/108] linux-user: Split out fallocate, sync_file_range/2 Richard Henderson
                   ` (14 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define eventfd2; remove the ifdefs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 64 +++++++++++++++++++++++++-------------------
 1 file changed, 37 insertions(+), 27 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8548f113d1..1158afde27 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7903,6 +7903,37 @@ IMPL(dup3)
     return ret;
 }
 
+#ifdef CONFIG_EVENTFD
+# ifdef TARGET_NR_eventfd
+IMPL(eventfd)
+{
+    abi_long ret = get_errno(eventfd(arg1, 0));
+    if (ret >= 0) {
+        fd_trans_register(ret, &target_eventfd_trans);
+    }
+    return ret;
+}
+# endif
+
+IMPL(eventfd2)
+{
+    int host_flags = arg2 & (~(TARGET_O_NONBLOCK | TARGET_O_CLOEXEC));
+    abi_long ret;
+
+    if (arg2 & TARGET_O_NONBLOCK) {
+        host_flags |= O_NONBLOCK;
+    }
+    if (arg2 & TARGET_O_CLOEXEC) {
+        host_flags |= O_CLOEXEC;
+    }
+    ret = get_errno(eventfd(arg1, host_flags));
+    if (ret >= 0) {
+        fd_trans_register(ret, &target_eventfd_trans);
+    }
+    return ret;
+}
+#endif /* CONFIG_EVENTFD */
+
 IMPL(execve)
 {
     abi_ulong *guest_ptrs;
@@ -12767,33 +12798,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     abi_long ret;
 
     switch(num) {
-#ifdef CONFIG_EVENTFD
-#if defined(TARGET_NR_eventfd)
-    case TARGET_NR_eventfd:
-        ret = get_errno(eventfd(arg1, 0));
-        if (ret >= 0) {
-            fd_trans_register(ret, &target_eventfd_trans);
-        }
-        return ret;
-#endif
-#if defined(TARGET_NR_eventfd2)
-    case TARGET_NR_eventfd2:
-    {
-        int host_flags = arg2 & (~(TARGET_O_NONBLOCK | TARGET_O_CLOEXEC));
-        if (arg2 & TARGET_O_NONBLOCK) {
-            host_flags |= O_NONBLOCK;
-        }
-        if (arg2 & TARGET_O_CLOEXEC) {
-            host_flags |= O_CLOEXEC;
-        }
-        ret = get_errno(eventfd(arg1, host_flags));
-        if (ret >= 0) {
-            fd_trans_register(ret, &target_eventfd_trans);
-        }
-        return ret;
-    }
-#endif
-#endif /* CONFIG_EVENTFD  */
 #if defined(CONFIG_FALLOCATE) && defined(TARGET_NR_fallocate)
     case TARGET_NR_fallocate:
 #if TARGET_ABI_BITS == 32
@@ -13314,6 +13318,12 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(dup2);
 #endif
         SYSCALL(dup3);
+#ifdef CONFIG_EVENTFD
+# ifdef TARGET_NR_eventfd
+        SYSCALL(eventfd);
+# endif
+        SYSCALL(eventfd2);
+#endif
         SYSCALL(execve);
         SYSCALL(exit);
 #ifdef __NR_exit_group
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 098/108] linux-user: Split out fallocate, sync_file_range/2
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (96 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 097/108] linux-user: Split out eventfd, eventfd2 Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 099/108] linux-user: Split out signalfd, signalfd4 Richard Henderson
                   ` (13 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define fallocate; remove the ifdefs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 101 +++++++++++++++++++++++++++----------------
 1 file changed, 63 insertions(+), 38 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1158afde27..5edcb39b73 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8208,6 +8208,18 @@ IMPL(fadvise64)
 # endif
 #endif /* end fadvise64 handling */
 
+#ifdef CONFIG_FALLOCATE
+IMPL(fallocate)
+{
+# if TARGET_ABI_BITS == 32
+    return get_errno(fallocate(arg1, arg2, target_offset64(arg3, arg4),
+                               target_offset64(arg5, arg6)));
+# else
+    return get_errno(fallocate(arg1, arg2, arg3, arg4));
+# endif
+}
+#endif
+
 IMPL(fchdir)
 {
     return get_errno(fchdir(arg1));
@@ -12310,6 +12322,46 @@ IMPL(syncfs)
 }
 #endif
 
+#ifdef CONFIG_SYNC_FILE_RANGE
+# ifdef TARGET_NR_sync_file_range
+IMPL(sync_file_range)
+{
+    uint64_t off, len;
+    unsigned flags;
+
+#  if TARGET_ABI_BITS == 32
+    if (regpairs_aligned(cpu_env, TARGET_NR_sync_file_range)) {
+        off = target_offset64(arg3, arg4);
+        len = target_offset64(arg5, arg6);
+        flags = arg7;
+    } else {
+        off = target_offset64(arg2, arg3);
+        len = target_offset64(arg4, arg5);
+        flags = arg6;
+    }
+#  else
+    off = arg2;
+    len = arg3;
+    flags = arg4;
+#  endif
+    return get_errno(sync_file_range(arg1, off, len, flags));
+}
+# endif
+
+# ifdef TARGET_NR_sync_file_range2
+IMPL(sync_file_range2)
+{
+    /* This is like sync_file_range but the arguments are reordered */
+#  if TARGET_ABI_BITS == 32
+    return get_errno(sync_file_range(arg1, target_offset64(arg3, arg4),
+                                     target_offset64(arg5, arg6), arg2));
+#  else
+    return get_errno(sync_file_range(arg1, arg3, arg4, arg2));
+#  endif
+}
+# endif
+#endif /* CONFIG_SYNC_FILE_RANGE */
+
 #ifdef TARGET_NR__sysctl
 IMPL(_sysctl)
 {
@@ -12798,44 +12850,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     abi_long ret;
 
     switch(num) {
-#if defined(CONFIG_FALLOCATE) && defined(TARGET_NR_fallocate)
-    case TARGET_NR_fallocate:
-#if TARGET_ABI_BITS == 32
-        ret = get_errno(fallocate(arg1, arg2, target_offset64(arg3, arg4),
-                                  target_offset64(arg5, arg6)));
-#else
-        ret = get_errno(fallocate(arg1, arg2, arg3, arg4));
-#endif
-        return ret;
-#endif
-#if defined(CONFIG_SYNC_FILE_RANGE)
-#if defined(TARGET_NR_sync_file_range)
-    case TARGET_NR_sync_file_range:
-#if TARGET_ABI_BITS == 32
-#if defined(TARGET_MIPS)
-        ret = get_errno(sync_file_range(arg1, target_offset64(arg3, arg4),
-                                        target_offset64(arg5, arg6), arg7));
-#else
-        ret = get_errno(sync_file_range(arg1, target_offset64(arg2, arg3),
-                                        target_offset64(arg4, arg5), arg6));
-#endif /* !TARGET_MIPS */
-#else
-        ret = get_errno(sync_file_range(arg1, arg2, arg3, arg4));
-#endif
-        return ret;
-#endif
-#if defined(TARGET_NR_sync_file_range2)
-    case TARGET_NR_sync_file_range2:
-        /* This is like sync_file_range but the arguments are reordered */
-#if TARGET_ABI_BITS == 32
-        ret = get_errno(sync_file_range(arg1, target_offset64(arg3, arg4),
-                                        target_offset64(arg5, arg6), arg2));
-#else
-        ret = get_errno(sync_file_range(arg1, arg3, arg4, arg2));
-#endif
-        return ret;
-#endif
-#endif
 #if defined(TARGET_NR_signalfd4)
     case TARGET_NR_signalfd4:
         return do_signalfd4(arg1, arg2, arg4);
@@ -13341,6 +13355,9 @@ static impl_fn *syscall_table(unsigned num)
 # else
         SYSCALL_WITH(fadvise64_64, fadvise64);
 # endif
+#endif
+#ifdef CONFIG_FALLOCATE
+        SYSCALL(fallocate);
 #endif
         SYSCALL(fchdir);
         SYSCALL(fchmod);
@@ -13841,6 +13858,14 @@ static impl_fn *syscall_table(unsigned num)
 #ifdef CONFIG_SYNCFS
         SYSCALL(syncfs);
 #endif
+#ifdef CONFIG_SYNC_FILE_RANGE
+# ifdef TARGET_NR_sync_file_range
+        SYSCALL(sync_file_range);
+# endif
+# ifdef TARGET_NR_sync_file_range2
+        SYSCALL(sync_file_range2);
+# endif
+#endif
 #ifdef TARGET_NR__sysctl
         SYSCALL(_sysctl);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 099/108] linux-user: Split out signalfd, signalfd4
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (97 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 098/108] linux-user: Split out fallocate, sync_file_range/2 Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 100/108] linux-user: Split out epoll syscalls Richard Henderson
                   ` (12 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define signalfd4; remove the ifdefs.
In do_signalfd4, unlock the target sigmask earlier and use is_error.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5edcb39b73..e630a43f97 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6975,8 +6975,6 @@ static abi_long host_to_target_statfs64(abi_ulong target_addr,
 }
 #endif
 
-#if defined(TARGET_NR_signalfd) || defined(TARGET_NR_signalfd4)
-
 /* signalfd siginfo conversion */
 
 static void
@@ -7045,21 +7043,17 @@ static abi_long do_signalfd4(int fd, abi_long mask, int flags)
     if (!lock_user_struct(VERIFY_READ, target_mask, mask, 1)) {
         return -TARGET_EFAULT;
     }
-
     target_to_host_sigset(&host_mask, target_mask);
+    unlock_user_struct(target_mask, mask, 0);
 
     host_flags = target_to_host_bitmask(flags, fcntl_flags_tbl);
 
     ret = get_errno(signalfd(fd, &host_mask, host_flags));
-    if (ret >= 0) {
+    if (!is_error(ret)) {
         fd_trans_register(ret, &target_signalfd_trans);
     }
-
-    unlock_user_struct(target_mask, mask, 0);
-
     return ret;
 }
-#endif
 
 /* Map host to target signal numbers for the wait family of syscalls.
    Assume all other status bits are the same.  */
@@ -11884,6 +11878,18 @@ IMPL(sigaltstack)
     return do_sigaltstack(arg1, arg2, get_sp_from_cpustate(cpu_env));
 }
 
+#ifdef TARGET_NR_signalfd
+IMPL(signalfd)
+{
+    return do_signalfd4(arg1, arg2, 0);
+}
+#endif
+
+IMPL(signalfd4)
+{
+    return do_signalfd4(arg1, arg2, arg4);
+}
+
 #ifdef TARGET_NR_sigpending
 IMPL(sigpending)
 {
@@ -12850,14 +12856,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     abi_long ret;
 
     switch(num) {
-#if defined(TARGET_NR_signalfd4)
-    case TARGET_NR_signalfd4:
-        return do_signalfd4(arg1, arg2, arg4);
-#endif
-#if defined(TARGET_NR_signalfd)
-    case TARGET_NR_signalfd:
-        return do_signalfd4(arg1, arg2, 0);
-#endif
 #if defined(CONFIG_EPOLL)
 #if defined(TARGET_NR_epoll_create)
     case TARGET_NR_epoll_create:
@@ -13808,6 +13806,10 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(sigaction);
 #endif
         SYSCALL(sigaltstack);
+#ifdef TARGET_NR_signalfd
+        SYSCALL(signalfd);
+#endif
+        SYSCALL(signalfd4);
 #ifdef TARGET_NR_sigpending
         SYSCALL(sigpending);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 100/108] linux-user: Split out epoll syscalls
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (98 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 099/108] linux-user: Split out signalfd, signalfd4 Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 101/108] linux-user: Split out prlimit64 Richard Henderson
                   ` (11 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

This includes epoll_create, epoll_create1, epoll_ctl,
epoll_pwait, epoll_wait.  All targets define epoll_create1,
epoll_ctl, epoll_pwait; remove those ifdefs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 244 +++++++++++++++++++++++--------------------
 1 file changed, 128 insertions(+), 116 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e630a43f97..9ce37c1119 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7897,6 +7897,123 @@ IMPL(dup3)
     return ret;
 }
 
+#ifdef CONFIG_EPOLL
+# ifdef TARGET_NR_epoll_create
+IMPL(epoll_create)
+{
+    return get_errno(epoll_create(arg1));
+}
+# endif
+
+IMPL(epoll_create1)
+{
+# ifdef CONFIG_EPOLL_CREATE1
+    return get_errno(epoll_create1(arg1));
+# else
+    /* If flags are 0, we can emulate with epoll_create.
+     * The size argument is ignored after linux 2.6.8,
+     * other than verifying that it is positive.
+     */
+    if (arg1 == 0) {
+        return get_errno(epoll_create(1));
+    }
+    return -TARGET_ENOSYS;
+# endif
+}
+
+IMPL(epoll_ctl)
+{
+    struct epoll_event ep;
+    struct epoll_event *epp = 0;
+
+    if (arg4) {
+        struct target_epoll_event *target_ep;
+        if (!lock_user_struct(VERIFY_READ, target_ep, arg4, 1)) {
+            return -TARGET_EFAULT;
+        }
+        ep.events = tswap32(target_ep->events);
+        /* The epoll_data_t union is just opaque data to the kernel,
+         * so we transfer all 64 bits across and need not worry what
+         * actual data type it is.
+         */
+        ep.data.u64 = tswap64(target_ep->data.u64);
+        unlock_user_struct(target_ep, arg4, 0);
+        epp = &ep;
+    }
+    return get_errno(epoll_ctl(arg1, arg2, arg3, epp));
+}
+
+IMPL(epoll_pwait_wait)
+{
+    struct target_epoll_event *target_ep;
+    struct epoll_event *ep;
+    int epfd = arg1;
+    int maxevents = arg3;
+    int timeout = arg4;
+    abi_long ret;
+
+    if (maxevents <= 0 || maxevents > TARGET_EP_MAX_EVENTS) {
+        return -TARGET_EINVAL;
+    }
+
+    target_ep = lock_user(VERIFY_WRITE, arg2,
+                          maxevents * sizeof(struct target_epoll_event), 1);
+    if (!target_ep) {
+        return -TARGET_EFAULT;
+    }
+
+    ep = g_try_new(struct epoll_event, maxevents);
+    if (!ep) {
+        unlock_user(target_ep, arg2, 0);
+        return -TARGET_ENOMEM;
+    }
+
+    switch (num) {
+    default: /* TARGET_NR_epoll_pwait */
+        if (arg5) {
+            target_sigset_t *target_set;
+            sigset_t set;
+
+            if (arg6 != sizeof(target_sigset_t)) {
+                ret = -TARGET_EINVAL;
+                break;
+            }
+            target_set = lock_user(VERIFY_READ, arg5,
+                                   sizeof(target_sigset_t), 1);
+            if (!target_set) {
+                ret = -TARGET_EFAULT;
+                break;
+            }
+            target_to_host_sigset(&set, target_set);
+            unlock_user(target_set, arg5, 0);
+
+            ret = get_errno(safe_epoll_pwait(epfd, ep, maxevents, timeout,
+                                             &set, SIGSET_T_SIZE));
+            break;
+        }
+        /* fallthru */
+# ifdef TARGET_NR_epoll_wait
+    case TARGET_NR_epoll_wait:
+# endif
+        ret = get_errno(safe_epoll_pwait(epfd, ep, maxevents,
+                                         timeout, NULL, 0));
+        break;
+    }
+    if (!is_error(ret)) {
+        int i;
+        for (i = 0; i < ret; i++) {
+            target_ep[i].events = tswap32(ep[i].events);
+            target_ep[i].data.u64 = tswap64(ep[i].data.u64);
+        }
+        unlock_user(target_ep, arg2, ret * sizeof(struct target_epoll_event));
+    } else {
+        unlock_user(target_ep, arg2, 0);
+    }
+    g_free(ep);
+    return ret;
+}
+#endif /* CONFIG_EPOLL */
+
 #ifdef CONFIG_EVENTFD
 # ifdef TARGET_NR_eventfd
 IMPL(eventfd)
@@ -12856,122 +12973,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     abi_long ret;
 
     switch(num) {
-#if defined(CONFIG_EPOLL)
-#if defined(TARGET_NR_epoll_create)
-    case TARGET_NR_epoll_create:
-        return get_errno(epoll_create(arg1));
-#endif
-#if defined(TARGET_NR_epoll_create1) && defined(CONFIG_EPOLL_CREATE1)
-    case TARGET_NR_epoll_create1:
-        return get_errno(epoll_create1(arg1));
-#endif
-#if defined(TARGET_NR_epoll_ctl)
-    case TARGET_NR_epoll_ctl:
-    {
-        struct epoll_event ep;
-        struct epoll_event *epp = 0;
-        if (arg4) {
-            struct target_epoll_event *target_ep;
-            if (!lock_user_struct(VERIFY_READ, target_ep, arg4, 1)) {
-                return -TARGET_EFAULT;
-            }
-            ep.events = tswap32(target_ep->events);
-            /* The epoll_data_t union is just opaque data to the kernel,
-             * so we transfer all 64 bits across and need not worry what
-             * actual data type it is.
-             */
-            ep.data.u64 = tswap64(target_ep->data.u64);
-            unlock_user_struct(target_ep, arg4, 0);
-            epp = &ep;
-        }
-        return get_errno(epoll_ctl(arg1, arg2, arg3, epp));
-    }
-#endif
-
-#if defined(TARGET_NR_epoll_wait) || defined(TARGET_NR_epoll_pwait)
-#if defined(TARGET_NR_epoll_wait)
-    case TARGET_NR_epoll_wait:
-#endif
-#if defined(TARGET_NR_epoll_pwait)
-    case TARGET_NR_epoll_pwait:
-#endif
-    {
-        struct target_epoll_event *target_ep;
-        struct epoll_event *ep;
-        int epfd = arg1;
-        int maxevents = arg3;
-        int timeout = arg4;
-
-        if (maxevents <= 0 || maxevents > TARGET_EP_MAX_EVENTS) {
-            return -TARGET_EINVAL;
-        }
-
-        target_ep = lock_user(VERIFY_WRITE, arg2,
-                              maxevents * sizeof(struct target_epoll_event), 1);
-        if (!target_ep) {
-            return -TARGET_EFAULT;
-        }
-
-        ep = g_try_new(struct epoll_event, maxevents);
-        if (!ep) {
-            unlock_user(target_ep, arg2, 0);
-            return -TARGET_ENOMEM;
-        }
-
-        switch (num) {
-#if defined(TARGET_NR_epoll_pwait)
-        case TARGET_NR_epoll_pwait:
-        {
-            target_sigset_t *target_set;
-            sigset_t _set, *set = &_set;
-
-            if (arg5) {
-                if (arg6 != sizeof(target_sigset_t)) {
-                    ret = -TARGET_EINVAL;
-                    break;
-                }
-
-                target_set = lock_user(VERIFY_READ, arg5,
-                                       sizeof(target_sigset_t), 1);
-                if (!target_set) {
-                    ret = -TARGET_EFAULT;
-                    break;
-                }
-                target_to_host_sigset(set, target_set);
-                unlock_user(target_set, arg5, 0);
-            } else {
-                set = NULL;
-            }
-
-            ret = get_errno(safe_epoll_pwait(epfd, ep, maxevents, timeout,
-                                             set, SIGSET_T_SIZE));
-        }
-#endif
-#if defined(TARGET_NR_epoll_wait)
-        case TARGET_NR_epoll_wait:
-            ret = get_errno(safe_epoll_pwait(epfd, ep, maxevents, timeout,
-                                             NULL, 0));
-            break;
-#endif
-        default:
-            ret = -TARGET_ENOSYS;
-        }
-        if (!is_error(ret)) {
-            int i;
-            for (i = 0; i < ret; i++) {
-                target_ep[i].events = tswap32(ep[i].events);
-                target_ep[i].data.u64 = tswap64(ep[i].data.u64);
-            }
-            unlock_user(target_ep, arg2,
-                        ret * sizeof(struct target_epoll_event));
-        } else {
-            unlock_user(target_ep, arg2, 0);
-        }
-        g_free(ep);
-        return ret;
-    }
-#endif
-#endif
 #ifdef TARGET_NR_prlimit64
     case TARGET_NR_prlimit64:
     {
@@ -13330,6 +13331,17 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(dup2);
 #endif
         SYSCALL(dup3);
+#ifdef CONFIG_EPOLL
+# ifdef TARGET_NR_epoll_create
+        SYSCALL(epoll_create);
+# endif
+        SYSCALL(epoll_create1);
+        SYSCALL(epoll_ctl);
+        SYSCALL_WITH(epoll_pwait, epoll_pwait_wait);
+# ifdef TARGET_NR_epoll_wait
+        SYSCALL_WITH(epoll_wait, epoll_pwait_wait);
+# endif
+#endif
 #ifdef CONFIG_EVENTFD
 # ifdef TARGET_NR_eventfd
         SYSCALL(eventfd);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 101/108] linux-user: Split out prlimit64
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (99 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 100/108] linux-user: Split out epoll syscalls Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 102/108] linux-user: Split out atomic_barrier, gethostname Richard Henderson
                   ` (10 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define prlimit64; remove the ifdefs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 65 ++++++++++++++++++++++----------------------
 1 file changed, 33 insertions(+), 32 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 9ce37c1119..91d90c7417 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -627,7 +627,6 @@ static int sys_renameat2(int oldfd, const char *old,
 }
 #endif
 
-#if defined(TARGET_NR_prlimit64)
 #ifndef __NR_prlimit64
 # define __NR_prlimit64 -1
 #endif
@@ -640,8 +639,6 @@ struct host_rlimit64 {
 _syscall4(int, sys_prlimit64, pid_t, pid, int, resource,
           const struct host_rlimit64 *, new_limit,
           struct host_rlimit64 *, old_limit)
-#endif
-
 
 #if defined(TARGET_NR_timer_create)
 /* Maxiumum of 32 active POSIX timers allowed at any one time. */
@@ -10713,6 +10710,38 @@ IMPL(preadv)
     return ret;
 }
 
+IMPL(prlimit64)
+{
+    /* args: pid, resource number, ptr to new rlimit, ptr to old rlimit */
+    struct host_rlimit64 rnew, rold;
+    int resource = target_to_host_resource(arg2);
+    abi_long ret;
+
+    if (arg3) {
+        struct target_rlimit64 *target_rnew;
+        if (!lock_user_struct(VERIFY_READ, target_rnew, arg3, 1)) {
+            return -TARGET_EFAULT;
+        }
+        rnew.rlim_cur = tswap64(target_rnew->rlim_cur);
+        rnew.rlim_max = tswap64(target_rnew->rlim_max);
+        unlock_user_struct(target_rnew, arg3, 0);
+    }
+
+    ret = get_errno(sys_prlimit64(arg1, resource, arg3 ? &rnew : NULL,
+                                  arg4 ? &rold : NULL));
+
+    if (!is_error(ret) && arg4) {
+        struct target_rlimit64 *target_rold;
+        if (!lock_user_struct(VERIFY_WRITE, target_rold, arg4, 1)) {
+            return -TARGET_EFAULT;
+        }
+        target_rold->rlim_cur = tswap64(rold.rlim_cur);
+        target_rold->rlim_max = tswap64(rold.rlim_max);
+        unlock_user_struct(target_rold, arg4, 1);
+    }
+    return ret;
+}
+
 IMPL(pselect6)
 {
     abi_long rfd_addr, wfd_addr, efd_addr, n, ts_addr;
@@ -12973,35 +13002,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     abi_long ret;
 
     switch(num) {
-#ifdef TARGET_NR_prlimit64
-    case TARGET_NR_prlimit64:
-    {
-        /* args: pid, resource number, ptr to new rlimit, ptr to old rlimit */
-        struct target_rlimit64 *target_rnew, *target_rold;
-        struct host_rlimit64 rnew, rold, *rnewp = 0;
-        int resource = target_to_host_resource(arg2);
-        if (arg3) {
-            if (!lock_user_struct(VERIFY_READ, target_rnew, arg3, 1)) {
-                return -TARGET_EFAULT;
-            }
-            rnew.rlim_cur = tswap64(target_rnew->rlim_cur);
-            rnew.rlim_max = tswap64(target_rnew->rlim_max);
-            unlock_user_struct(target_rnew, arg3, 0);
-            rnewp = &rnew;
-        }
-
-        ret = get_errno(sys_prlimit64(arg1, resource, rnewp, arg4 ? &rold : 0));
-        if (!is_error(ret) && arg4) {
-            if (!lock_user_struct(VERIFY_WRITE, target_rold, arg4, 1)) {
-                return -TARGET_EFAULT;
-            }
-            target_rold->rlim_cur = tswap64(rold.rlim_cur);
-            target_rold->rlim_max = tswap64(rold.rlim_max);
-            unlock_user_struct(target_rold, arg4, 1);
-        }
-        return ret;
-    }
-#endif
 #ifdef TARGET_NR_gethostname
     case TARGET_NR_gethostname:
     {
@@ -13650,6 +13650,7 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(prctl);
         SYSCALL(pread64);
         SYSCALL(preadv);
+        SYSCALL(prlimit64);
         SYSCALL(pselect6);
         SYSCALL(pwrite64);
         SYSCALL(pwritev);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 102/108] linux-user: Split out atomic_barrier, gethostname
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (100 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 101/108] linux-user: Split out prlimit64 Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 103/108] linux-user: Split out atomic_cmpxchg_32 Richard Henderson
                   ` (9 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 49 ++++++++++++++++++++++++++------------------
 1 file changed, 29 insertions(+), 20 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 91d90c7417..f898e70e98 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7552,6 +7552,14 @@ IMPL(arch_prctl)
 }
 #endif
 
+#ifdef TARGET_NR_atomic_barrier
+IMPL(atomic_barrier)
+{
+    /* Like the kernel implementation and the qemu arm barrier, no-op this.  */
+    return 0;
+}
+#endif
+
 #ifdef TARGET_NR_bind
 IMPL(bind)
 {
@@ -8987,6 +8995,21 @@ IMPL(getgroups32)
 }
 #endif
 
+#ifdef TARGET_NR_gethostname
+IMPL(gethostname)
+{
+    char *name = lock_user(VERIFY_WRITE, arg1, arg2, 0);
+    abi_long ret;
+
+    if (!name) {
+        ret = -TARGET_EFAULT;
+    }
+    ret = get_errno(gethostname(name, arg2));
+    unlock_user(name, arg1, arg2);
+    return ret;
+}
+#endif
+
 IMPL(getitimer)
 {
     struct itimerval value;
@@ -13002,19 +13025,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     abi_long ret;
 
     switch(num) {
-#ifdef TARGET_NR_gethostname
-    case TARGET_NR_gethostname:
-    {
-        char *name = lock_user(VERIFY_WRITE, arg1, arg2, 0);
-        if (name) {
-            ret = get_errno(gethostname(name, arg2));
-            unlock_user(name, arg1, arg2);
-        } else {
-            ret = -TARGET_EFAULT;
-        }
-        return ret;
-    }
-#endif
 #ifdef TARGET_NR_atomic_cmpxchg_32
     case TARGET_NR_atomic_cmpxchg_32:
     {
@@ -13036,13 +13046,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
         return mem_value;
     }
 #endif
-#ifdef TARGET_NR_atomic_barrier
-    case TARGET_NR_atomic_barrier:
-        /* Like the kernel implementation and the
-           qemu arm barrier, no-op this? */
-        return 0;
-#endif
-
 #ifdef TARGET_NR_timer_create
     case TARGET_NR_timer_create:
     {
@@ -13293,6 +13296,9 @@ static impl_fn *syscall_table(unsigned num)
 #endif
 #ifdef TARGET_NR_bind
         SYSCALL(bind);
+#endif
+#ifdef TARGET_NR_atomic_barrier
+        SYSCALL(atomic_barrier);
 #endif
         SYSCALL(brk);
 #ifdef TARGET_NR_cacheflush
@@ -13448,6 +13454,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(getgroups);
 #ifdef TARGET_NR_getgroups32
         SYSCALL(getgroups32);
+#endif
+#ifdef TARGET_NR_gethostname
+        SYSCALL(gethostname);
 #endif
         SYSCALL(getitimer);
 #ifdef TARGET_NR_getpagesize
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 103/108] linux-user: Split out atomic_cmpxchg_32
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (101 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 102/108] linux-user: Split out atomic_barrier, gethostname Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 104/108] linux-user: Split out timer syscalls Richard Henderson
                   ` (8 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

At the same time, make it atomic.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 47 ++++++++++++++++++++++++--------------------
 1 file changed, 26 insertions(+), 21 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index f898e70e98..5d60872587 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7560,6 +7560,29 @@ IMPL(atomic_barrier)
 }
 #endif
 
+#ifdef TARGET_NR_atomic_cmpxchg_32
+IMPL(atomic_cmpxchg_32)
+{
+    /* This is m68k specific.  */
+    uint32_t newval = arg1;
+    uint32_t oldval = arg2;
+    abi_ulong target_addr = arg6;
+    uint32_t *host_addr;
+
+    if (!access_ok(VERIFY_WRITE, target_addr, 4)) {
+        target_siginfo_t info;
+        info.si_signo = SIGSEGV;
+        info.si_errno = 0;
+        info.si_code = TARGET_SEGV_MAPERR;
+        info._sifields._sigfault._addr = target_addr;
+        queue_signal(cpu_env, info.si_signo, QEMU_SI_FAULT, &info);
+        return 0xdeadbeef;
+    }
+    host_addr = g2h(target_addr);
+    return atomic_cmpxchg(host_addr, oldval, newval);
+}
+#endif
+
 #ifdef TARGET_NR_bind
 IMPL(bind)
 {
@@ -13025,27 +13048,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     abi_long ret;
 
     switch(num) {
-#ifdef TARGET_NR_atomic_cmpxchg_32
-    case TARGET_NR_atomic_cmpxchg_32:
-    {
-        /* should use start_exclusive from main.c */
-        abi_ulong mem_value;
-        if (get_user_u32(mem_value, arg6)) {
-            target_siginfo_t info;
-            info.si_signo = SIGSEGV;
-            info.si_errno = 0;
-            info.si_code = TARGET_SEGV_MAPERR;
-            info._sifields._sigfault._addr = arg6;
-            queue_signal((CPUArchState *)cpu_env, info.si_signo,
-                         QEMU_SI_FAULT, &info);
-            ret = 0xdeadbeef;
-
-        }
-        if (mem_value == arg2)
-            put_user_u32(arg1, arg6);
-        return mem_value;
-    }
-#endif
 #ifdef TARGET_NR_timer_create
     case TARGET_NR_timer_create:
     {
@@ -13299,6 +13301,9 @@ static impl_fn *syscall_table(unsigned num)
 #endif
 #ifdef TARGET_NR_atomic_barrier
         SYSCALL(atomic_barrier);
+#endif
+#ifdef TARGET_NR_atomic_cmpxchg_32
+        SYSCALL(atomic_cmpxchg_32);
 #endif
         SYSCALL(brk);
 #ifdef TARGET_NR_cacheflush
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 104/108] linux-user: Split out timer syscalls
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (102 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 103/108] linux-user: Split out atomic_cmpxchg_32 Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 105/108] linux-user: Split out timerfd syscalls Richard Henderson
                   ` (7 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

This includes timer_create, timer_delete, timer_getoverrun,
timer_gettime, and timer_settime.  All targets define all of
these; remove the ifdefs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 234 ++++++++++++++++++++-----------------------
 1 file changed, 111 insertions(+), 123 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5d60872587..0f12a945ea 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -640,7 +640,6 @@ _syscall4(int, sys_prlimit64, pid_t, pid, int, resource,
           const struct host_rlimit64 *, new_limit,
           struct host_rlimit64 *, old_limit)
 
-#if defined(TARGET_NR_timer_create)
 /* Maxiumum of 32 active POSIX timers allowed at any one time. */
 static timer_t g_posix_timers[32] = { 0, } ;
 
@@ -656,7 +655,6 @@ static inline int next_free_host_timer(void)
     }
     return -1;
 }
-#endif
 
 /* ARM EABI and MIPS expect 64bit types aligned even on pairs or registers */
 #ifdef TARGET_ARM
@@ -12685,6 +12683,112 @@ IMPL(times)
     return host_to_target_clock_t(ret);
 }
 
+IMPL(timer_create)
+{
+    /* args: clockid_t clockid, struct sigevent *sevp, timer_t *timerid */
+    struct sigevent host_sevp, *phost_sevp = NULL;
+    int clkid = arg1;
+    int timer_index;
+    timer_t *phtimer;
+    abi_long ret;
+
+    timer_index = next_free_host_timer();
+    if (timer_index < 0) {
+        return -TARGET_EAGAIN;
+    }
+
+    phtimer = g_posix_timers + timer_index;
+    if (arg2) {
+        phost_sevp = &host_sevp;
+        ret = target_to_host_sigevent(phost_sevp, arg2);
+        if (ret != 0) {
+            return ret;
+        }
+    }
+
+    ret = get_errno(timer_create(clkid, phost_sevp, phtimer));
+    if (!ret && put_user(TIMER_MAGIC | timer_index, arg3, target_timer_t)) {
+        /* ??? Leak timer.  */
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+
+IMPL(timer_delete)
+{
+    /* args: timer_t timerid */
+    target_timer_t timerid = get_timer_id(arg1);
+    timer_t htimer;
+    abi_long ret;
+
+    if (timerid < 0) {
+        return timerid;
+    }
+    htimer = g_posix_timers[timerid];
+    ret = get_errno(timer_delete(htimer));
+    g_posix_timers[timerid] = 0;
+    return ret;
+}
+
+IMPL(timer_getoverrun)
+{
+    /* args: timer_t timerid */
+    target_timer_t timerid = get_timer_id(arg1);
+    timer_t htimer;
+    abi_long ret;
+
+    if (timerid < 0) {
+        return timerid;
+    }
+    htimer = g_posix_timers[timerid];
+    ret = get_errno(timer_getoverrun(htimer));
+    fd_trans_unregister(ret);
+    return ret;
+}
+
+IMPL(timer_gettime)
+{
+    /* args: timer_t timerid, struct itimerspec *curr_value */
+    target_timer_t timerid = get_timer_id(arg1);
+    struct itimerspec hspec;
+    timer_t htimer;
+    abi_long ret;
+
+    if (timerid < 0) {
+        return timerid;
+    }
+    htimer = g_posix_timers[timerid];
+    ret = get_errno(timer_gettime(htimer, &hspec));
+    if (!ret && host_to_target_itimerspec(arg2, &hspec)) {
+        ret = -TARGET_EFAULT;
+    }
+    return ret;
+}
+
+IMPL(timer_settime)
+{
+    /* args: timer_t timerid, int flags, const struct itimerspec *new_value,
+     * struct itimerspec * old_value
+     */
+    struct itimerspec hspec_new, hspec_old;
+    target_timer_t timerid = get_timer_id(arg1);
+    timer_t htimer;
+    abi_long ret;
+
+    if (timerid < 0) {
+        return timerid;
+    }
+    if (target_to_host_itimerspec(&hspec_new, arg3)) {
+        return -TARGET_EFAULT;
+    }
+    htimer = g_posix_timers[timerid];
+    ret = get_errno(timer_settime(htimer, arg2, &hspec_new, &hspec_old));
+    if (!ret && arg4 && host_to_target_itimerspec(arg4, &hspec_old)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+
 IMPL(tkill)
 {
     return get_errno(safe_tkill((int)arg1, target_to_host_signal(arg2)));
@@ -13048,127 +13152,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     abi_long ret;
 
     switch(num) {
-#ifdef TARGET_NR_timer_create
-    case TARGET_NR_timer_create:
-    {
-        /* args: clockid_t clockid, struct sigevent *sevp, timer_t *timerid */
-
-        struct sigevent host_sevp = { {0}, }, *phost_sevp = NULL;
-
-        int clkid = arg1;
-        int timer_index = next_free_host_timer();
-
-        if (timer_index < 0) {
-            ret = -TARGET_EAGAIN;
-        } else {
-            timer_t *phtimer = g_posix_timers  + timer_index;
-
-            if (arg2) {
-                phost_sevp = &host_sevp;
-                ret = target_to_host_sigevent(phost_sevp, arg2);
-                if (ret != 0) {
-                    return ret;
-                }
-            }
-
-            ret = get_errno(timer_create(clkid, phost_sevp, phtimer));
-            if (ret) {
-                phtimer = NULL;
-            } else {
-                if (put_user(TIMER_MAGIC | timer_index, arg3, target_timer_t)) {
-                    return -TARGET_EFAULT;
-                }
-            }
-        }
-        return ret;
-    }
-#endif
-
-#ifdef TARGET_NR_timer_settime
-    case TARGET_NR_timer_settime:
-    {
-        /* args: timer_t timerid, int flags, const struct itimerspec *new_value,
-         * struct itimerspec * old_value */
-        target_timer_t timerid = get_timer_id(arg1);
-
-        if (timerid < 0) {
-            ret = timerid;
-        } else if (arg3 == 0) {
-            ret = -TARGET_EINVAL;
-        } else {
-            timer_t htimer = g_posix_timers[timerid];
-            struct itimerspec hspec_new = {{0},}, hspec_old = {{0},};
-
-            if (target_to_host_itimerspec(&hspec_new, arg3)) {
-                return -TARGET_EFAULT;
-            }
-            ret = get_errno(
-                          timer_settime(htimer, arg2, &hspec_new, &hspec_old));
-            if (arg4 && host_to_target_itimerspec(arg4, &hspec_old)) {
-                return -TARGET_EFAULT;
-            }
-        }
-        return ret;
-    }
-#endif
-
-#ifdef TARGET_NR_timer_gettime
-    case TARGET_NR_timer_gettime:
-    {
-        /* args: timer_t timerid, struct itimerspec *curr_value */
-        target_timer_t timerid = get_timer_id(arg1);
-
-        if (timerid < 0) {
-            ret = timerid;
-        } else if (!arg2) {
-            ret = -TARGET_EFAULT;
-        } else {
-            timer_t htimer = g_posix_timers[timerid];
-            struct itimerspec hspec;
-            ret = get_errno(timer_gettime(htimer, &hspec));
-
-            if (host_to_target_itimerspec(arg2, &hspec)) {
-                ret = -TARGET_EFAULT;
-            }
-        }
-        return ret;
-    }
-#endif
-
-#ifdef TARGET_NR_timer_getoverrun
-    case TARGET_NR_timer_getoverrun:
-    {
-        /* args: timer_t timerid */
-        target_timer_t timerid = get_timer_id(arg1);
-
-        if (timerid < 0) {
-            ret = timerid;
-        } else {
-            timer_t htimer = g_posix_timers[timerid];
-            ret = get_errno(timer_getoverrun(htimer));
-        }
-        fd_trans_unregister(ret);
-        return ret;
-    }
-#endif
-
-#ifdef TARGET_NR_timer_delete
-    case TARGET_NR_timer_delete:
-    {
-        /* args: timer_t timerid */
-        target_timer_t timerid = get_timer_id(arg1);
-
-        if (timerid < 0) {
-            ret = timerid;
-        } else {
-            timer_t htimer = g_posix_timers[timerid];
-            ret = get_errno(timer_delete(htimer));
-            g_posix_timers[timerid] = 0;
-        }
-        return ret;
-    }
-#endif
-
 #if defined(TARGET_NR_timerfd_create) && defined(CONFIG_TIMERFD)
     case TARGET_NR_timerfd_create:
         return get_errno(timerfd_create(arg1,
@@ -13908,6 +13891,11 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(time);
 #endif
         SYSCALL(times);
+        SYSCALL(timer_create);
+        SYSCALL(timer_delete);
+        SYSCALL(timer_getoverrun);
+        SYSCALL(timer_gettime);
+        SYSCALL(timer_settime);
         SYSCALL(tkill);
         SYSCALL(truncate);
 #ifdef TARGET_NR_truncate64
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 105/108] linux-user: Split out timerfd syscalls
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (103 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 104/108] linux-user: Split out timer syscalls Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 106/108] linux-user: Split out ioprio_get, ioprio_set, kcmp Richard Henderson
                   ` (6 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

This includes timerfd_create, timerfd_gettime, timerfd_settime.
All targets define all of these; remove the ifdefs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 83 +++++++++++++++++++++-----------------------
 1 file changed, 40 insertions(+), 43 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 0f12a945ea..c0752ad6e0 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -12789,6 +12789,41 @@ IMPL(timer_settime)
     return ret;
 }
 
+#ifdef CONFIG_TIMERFD
+IMPL(timerfd_create)
+{
+    int host_flags = target_to_host_bitmask(arg2, fcntl_flags_tbl);
+    return get_errno(timerfd_create(arg1, host_flags));
+}
+
+IMPL(timerfd_gettime)
+{
+    struct itimerspec its_curr;
+    abi_long ret;
+
+    ret = get_errno(timerfd_gettime(arg1, &its_curr));
+    if (!ret && host_to_target_itimerspec(arg2, &its_curr)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+
+IMPL(timerfd_settime)
+{
+    struct itimerspec its_new, its_old;
+    abi_long ret;
+
+    if (target_to_host_itimerspec(&its_new, arg3)) {
+        return -TARGET_EFAULT;
+    }
+    ret = get_errno(timerfd_settime(arg1, arg2, &its_new, &its_old));
+    if (!ret && arg4 && host_to_target_itimerspec(arg4, &its_old)) {
+        return -TARGET_EFAULT;
+    }
+    return ret;
+}
+#endif /* CONFIG_TIMERFD */
+
 IMPL(tkill)
 {
     return get_errno(safe_tkill((int)arg1, target_to_host_signal(arg2)));
@@ -13152,49 +13187,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     abi_long ret;
 
     switch(num) {
-#if defined(TARGET_NR_timerfd_create) && defined(CONFIG_TIMERFD)
-    case TARGET_NR_timerfd_create:
-        return get_errno(timerfd_create(arg1,
-                          target_to_host_bitmask(arg2, fcntl_flags_tbl)));
-#endif
-
-#if defined(TARGET_NR_timerfd_gettime) && defined(CONFIG_TIMERFD)
-    case TARGET_NR_timerfd_gettime:
-        {
-            struct itimerspec its_curr;
-
-            ret = get_errno(timerfd_gettime(arg1, &its_curr));
-
-            if (arg2 && host_to_target_itimerspec(arg2, &its_curr)) {
-                return -TARGET_EFAULT;
-            }
-        }
-        return ret;
-#endif
-
-#if defined(TARGET_NR_timerfd_settime) && defined(CONFIG_TIMERFD)
-    case TARGET_NR_timerfd_settime:
-        {
-            struct itimerspec its_new, its_old, *p_new;
-
-            if (arg3) {
-                if (target_to_host_itimerspec(&its_new, arg3)) {
-                    return -TARGET_EFAULT;
-                }
-                p_new = &its_new;
-            } else {
-                p_new = NULL;
-            }
-
-            ret = get_errno(timerfd_settime(arg1, arg2, p_new, &its_old));
-
-            if (arg4 && host_to_target_itimerspec(arg4, &its_old)) {
-                return -TARGET_EFAULT;
-            }
-        }
-        return ret;
-#endif
-
 #if defined(TARGET_NR_ioprio_get) && defined(__NR_ioprio_get)
     case TARGET_NR_ioprio_get:
         return get_errno(ioprio_get(arg1, arg2));
@@ -13896,6 +13888,11 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(timer_getoverrun);
         SYSCALL(timer_gettime);
         SYSCALL(timer_settime);
+#ifdef CONFIG_TIMERFD
+        SYSCALL(timerfd_create);
+        SYSCALL(timerfd_gettime);
+        SYSCALL(timerfd_settime);
+#endif
         SYSCALL(tkill);
         SYSCALL(truncate);
 #ifdef TARGET_NR_truncate64
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 106/108] linux-user: Split out ioprio_get, ioprio_set, kcmp
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (104 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 105/108] linux-user: Split out timerfd syscalls Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 107/108] linux-user: Split out setns, unshare Richard Henderson
                   ` (5 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define all of these; remove the ifdefs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 49 ++++++++++++++++++++++++--------------------
 1 file changed, 27 insertions(+), 22 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index c0752ad6e0..d15f994039 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -250,6 +250,15 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,	\
 #ifndef __NR_gettid
 #define __NR_gettid  -1
 #endif
+#ifndef __NR_ioprio_get
+#define __NR_ioprio_get  -1
+#endif
+#ifndef __NR_ioprio_set
+#define __NR_ioprio_set  -1
+#endif
+#ifndef __NR_kcmp
+#define __NR_kcmp  -1
+#endif
 #ifndef __NR_set_tid_address
 #define __NR_set_tid_address  -1
 #endif
@@ -296,18 +305,11 @@ _syscall2(int, capget, struct __user_cap_header_struct *, header,
           struct __user_cap_data_struct *, data);
 _syscall2(int, capset, struct __user_cap_header_struct *, header,
           struct __user_cap_data_struct *, data);
-#if defined(TARGET_NR_ioprio_get) && defined(__NR_ioprio_get)
 _syscall2(int, ioprio_get, int, which, int, who)
-#endif
-#if defined(TARGET_NR_ioprio_set) && defined(__NR_ioprio_set)
 _syscall3(int, ioprio_set, int, which, int, who, int, ioprio)
-#endif
 _syscall3(int, getrandom, void *, buf, size_t, buflen, unsigned int, flags)
-
-#if defined(TARGET_NR_kcmp) && defined(__NR_kcmp)
 _syscall5(int, kcmp, pid_t, pid1, pid_t, pid2, int, type,
           unsigned long, idx1, unsigned long, idx2)
-#endif
 
 static bitmask_transtbl fcntl_flags_tbl[] = {
   { TARGET_O_ACCMODE,   TARGET_O_WRONLY,    O_ACCMODE,   O_WRONLY,    },
@@ -9474,6 +9476,16 @@ IMPL(ioctl)
     return ret;
 }
 
+IMPL(ioprio_get)
+{
+    return get_errno(ioprio_get(arg1, arg2));
+}
+
+IMPL(ioprio_set)
+{
+    return get_errno(ioprio_set(arg1, arg2, arg3));
+}
+
 #ifdef TARGET_NR_ipc
 IMPL(ipc)
 {
@@ -9553,6 +9565,11 @@ IMPL(ipc)
 }
 #endif
 
+IMPL(kcmp)
+{
+    return get_errno(kcmp(arg1, arg2, arg3, arg4, arg5));
+}
+
 IMPL(kill)
 {
     return get_errno(safe_kill(arg1, target_to_host_signal(arg2)));
@@ -13187,16 +13204,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     abi_long ret;
 
     switch(num) {
-#if defined(TARGET_NR_ioprio_get) && defined(__NR_ioprio_get)
-    case TARGET_NR_ioprio_get:
-        return get_errno(ioprio_get(arg1, arg2));
-#endif
-
-#if defined(TARGET_NR_ioprio_set) && defined(__NR_ioprio_set)
-    case TARGET_NR_ioprio_set:
-        return get_errno(ioprio_set(arg1, arg2, arg3));
-#endif
-
 #if defined(TARGET_NR_setns) && defined(CONFIG_SETNS)
     case TARGET_NR_setns:
         return get_errno(setns(arg1, arg2));
@@ -13205,11 +13212,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     case TARGET_NR_unshare:
         return get_errno(unshare(arg1));
 #endif
-#if defined(TARGET_NR_kcmp) && defined(__NR_kcmp)
-    case TARGET_NR_kcmp:
-        return get_errno(kcmp(arg1, arg2, arg3, arg4, arg5));
-#endif
-
     default:
         gemu_log("qemu: Unsupported syscall: %d\n", num);
         return -TARGET_ENOSYS;
@@ -13510,9 +13512,12 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(inotify_rm_watch);
 #endif
         SYSCALL(ioctl);
+        SYSCALL(ioprio_get);
+        SYSCALL(ioprio_set);
 #ifdef TARGET_NR_ipc
         SYSCALL(ipc);
 #endif
+        SYSCALL(kcmp);
         SYSCALL(kill);
 #ifdef TARGET_NR_lchown
         SYSCALL(lchown);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 107/108] linux-user: Split out setns, unshare
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (105 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 106/108] linux-user: Split out ioprio_get, ioprio_set, kcmp Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 108/108] linux-user: Fold away do_syscall1 Richard Henderson
                   ` (4 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

All targets define both of these; remove the ifdefs.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index d15f994039..7a94a0b0e9 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -11820,6 +11820,13 @@ IMPL(setitimer)
     return ret;
 }
 
+#ifdef CONFIG_SETNS
+IMPL(setns)
+{
+    return get_errno(setns(arg1, arg2));
+}
+#endif
+
 IMPL(setpgid)
 {
     return get_errno(setpgid(arg1, arg2));
@@ -12984,6 +12991,13 @@ IMPL(unlinkat)
     return ret;
 }
 
+#ifdef CONFIG_SETNS
+IMPL(unshare)
+{
+    return get_errno(unshare(arg1));
+}
+#endif
+
 #ifdef TARGET_NR_utime
 IMPL(utime)
 {
@@ -13200,23 +13214,11 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
                             abi_long arg5, abi_long arg6, abi_long arg7,
                             abi_long arg8)
 {
-    CPUState *cpu __attribute__((unused)) = ENV_GET_CPU(cpu_env);
-    abi_long ret;
-
     switch(num) {
-#if defined(TARGET_NR_setns) && defined(CONFIG_SETNS)
-    case TARGET_NR_setns:
-        return get_errno(setns(arg1, arg2));
-#endif
-#if defined(TARGET_NR_unshare) && defined(CONFIG_SETNS)
-    case TARGET_NR_unshare:
-        return get_errno(unshare(arg1));
-#endif
     default:
         gemu_log("qemu: Unsupported syscall: %d\n", num);
         return -TARGET_ENOSYS;
     }
-    return ret;
 }
 
 /* The default action for a syscall not listed in syscall_table is to
@@ -13770,6 +13772,9 @@ static impl_fn *syscall_table(unsigned num)
 #endif
         SYSCALL(sethostname);
         SYSCALL(setitimer);
+#ifdef CONFIG_SETNS
+        SYSCALL(setns);
+#endif
         SYSCALL(setpgid);
         SYSCALL(setpriority);
         SYSCALL(setregid);
@@ -13916,6 +13921,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(unlink);
 #endif
         SYSCALL(unlinkat);
+#ifdef CONFIG_SETNS
+        SYSCALL(unshare);
+#endif
 #ifdef TARGET_NR_utime
         SYSCALL(utime);
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* [Qemu-devel] [PATCH v2 108/108] linux-user: Fold away do_syscall1
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (106 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 107/108] linux-user: Split out setns, unshare Richard Henderson
@ 2018-06-10  3:02 ` Richard Henderson
  2018-06-10  4:30 ` [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall no-reply
                   ` (3 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10  3:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 7a94a0b0e9..a4cef22436 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -13204,23 +13204,6 @@ IMPL(writev)
     return ret;
 }
 
-/* This is an internal helper for do_syscall so that it is easier
- * to have a single return point, so that actions, such as logging
- * of syscall results, can be performed.
- * All errnos that do_syscall() returns must be -TARGET_<errcode>.
- */
-static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
-                            abi_long arg2, abi_long arg3, abi_long arg4,
-                            abi_long arg5, abi_long arg6, abi_long arg7,
-                            abi_long arg8)
-{
-    switch(num) {
-    default:
-        gemu_log("qemu: Unsupported syscall: %d\n", num);
-        return -TARGET_ENOSYS;
-    }
-}
-
 /* The default action for a syscall not listed in syscall_table is to
  * log the missing syscall.  If a syscall is intentionally emulated as
  * not present, then list it with impl_enosys as the implementation,
@@ -13953,8 +13936,8 @@ static impl_fn *syscall_table(unsigned num)
 #undef SYSCALL
 #undef SYSCALL_WITH
 
-    /* After do_syscall1 is fully split, this will be impl_enosys.  */
-    return do_syscall1;
+    gemu_log("qemu: Unsupported syscall: %u\n", num);
+    return impl_enosys;
 }
 
 abi_long do_syscall(void *cpu_env, unsigned num, abi_long arg1,
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 119+ messages in thread

* Re: [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (107 preceding siblings ...)
  2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 108/108] linux-user: Fold away do_syscall1 Richard Henderson
@ 2018-06-10  4:30 ` no-reply
  2018-06-10  4:44 ` no-reply
                   ` (2 subsequent siblings)
  111 siblings, 0 replies; 119+ messages in thread
From: no-reply @ 2018-06-10  4:30 UTC (permalink / raw)
  To: richard.henderson; +Cc: famz, qemu-devel, laurent

Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20180610030220.3777-1-richard.henderson@linaro.org
Subject: [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]               patchew/20180610030220.3777-1-richard.henderson@linaro.org -> patchew/20180610030220.3777-1-richard.henderson@linaro.org
Switched to a new branch 'test'
142736fa01 linux-user: Fold away do_syscall1
b2fe320d4d linux-user: Split out setns, unshare
33ff337032 linux-user: Split out ioprio_get, ioprio_set, kcmp
3ee28ca711 linux-user: Split out timerfd syscalls
5537a2d2ce linux-user: Split out timer syscalls
956dc14fee linux-user: Split out atomic_cmpxchg_32
e7a1e5442b linux-user: Split out atomic_barrier, gethostname
b795dc37af linux-user: Split out prlimit64
b872c05a7b linux-user: Split out epoll syscalls
2b1db10c6b linux-user: Split out signalfd, signalfd4
69c7eef49d linux-user: Split out fallocate, sync_file_range/2
41b5a76976 linux-user: Split out eventfd, eventfd2
7aaafd89f6 linux-user: Split out splice, tee, vmsplice
961a2eb243 linux-user: Split out mq syscalls
64070cf90c linux-user: Split out inotify syscalls
09338954b0 linux-user: Remove sys_futex
984e9f5622 linux-user: Split out futex, utimensat
bd7c9988f3 linux-user: Split out set_tid_address, tgkill, tkill
2b632458ae linux-user: Fix clock_nanosleep
3a312f25d3 linux-user: Split out clock syscalls
abe5a1b94d linux-user: Split out getdomainname, get_thread_area, set_thread_area
0722311d8c linux-user: Split out xattr syscalls
570cf4cf05 linux-user: Split out gettid, readahead
863d38626f linux-user: Split out cacheflush, fcntl64, getpagesize, madvise
ab4c8863c6 linux-user: Split out fadvise64, fadvise64_64
65f8f2263b linux-user: Split out mincore
27893e3664 linux-user: Split out chown32, setfsgid32, setfsuid32, setgid32, setuid32
c46299c2db linux-user: Split out getresgid32, getresuid32, setresgid32, setresuid32
84a40d4226 linux-user: Split out fchown32, getgroups32, setgroups32
db41e152e5 linux-user: Split out getegid32, geteuid32, getgid32, setregid32, setreuid32
a0c6ad4e91 linux-user: Split out osf_getsysinfo, osf_setsysinfo, osf_sigprocmask
d344b150d9 linux-user: Split out getuid32, getxgid, getxuid, lchown32
e074a94e8f linux-user: Split out setfsgid, setfsuid, setgid, setuid
8613205669 linux-user: Split out chown, getresgid, getresuid
ca3e6e25ee linux-user: Split out fchown, fchownat, setresgid, setresuid
c4b670a25b linux-user: Split out getgroups, setgroups, setregid, setreuid
e9ea9a67b8 linux-user: Split out getegid, geteuid, getgid, getuid, lchown
8cf5c522fe linux-user: Split out fstat64, fstatat64, newfstatat, lstat64, stat64
a7aed32bd2 linux-user: Split out ftruncate64, truncate64, ugetrlimit, vfork
cebb6ef034 linux-user: Split out sendfile, sendfile64
bd2685b32a linux-user: Split out capget, capset
04ec16bc18 linux-user: Split out getcwd, pread64, pwrite64, sigaltstack
6e31fdfe46 linux-user: Split out arch_prctl
0099ab046e linux-user: Split out getcpu, nanosleep, prctl
64abc0d8c0 linux-user: Split out sched syscalls
da229f4f47 linux-user: Split out fdatasync, getsid, _sysctl
309936b671 linux-user: Split out flock, preadv, pwritev, readv, writev
22eb82902c linux-user: Split out poll, ppoll
b2c1d23350 linux-user: Split out getdents, getdents64
8d6564790a linux-user: Split out fchdir, getpgid, llseek, personality
c03d18c884 linux-user: Split out adjtimex, clock_adjtime, vm86
7203e31f9a linux-user: Split out modify_ldt, setdomainname, uname
e0f3e1ae92 linux-user: Split out clone, exit_group, fsync
d5f6938594 linux-user: Split out ipc syscalls
206d20e09d linux-user: Split out ipc
a8ff1f9c61 linux-user: Split out swapoff, sysinfo, vhangup, wait4
a96df8a712 linux-user: Unwrap TARGET_NR_syscall early
39526d0b45 linux-user: Split out fstat, lstat, stat
c8dc0c7596 linux-user: Split out getitimer, setitimer, syslog
01d065020b linux-user: Fix stub gettid
d89802d484 linux-user: Split out getrandom, shutdown, setsockopt, socket, socketpair
43a8fed411 linux-user: Split out recvmmsg, send, sendmmsg, sendmsg, sendto
6d6f6b0903 linux-user: Split out 7 syscalls
86639c65aa linux-user: Split out accept, accept4, bind, connect
21aa01481b linux-user: Split out socketcall
aafdcc007c linux-user: Split out getpriority, setpriority
14a6348a73 linux-user: Split out fstatfs, fstatfs64, statfs, statfs64
ff2d572b96 linux-user: Split out fchmod, fchmodat, ftruncate, truncate
8994add885 linux-user: Split out mlock, mlockall, munlock, munlockall
5d517b07ee linux-user: Split out mprotect, mremap, msync, munmap
756b5a7202 linux-user: Split out mmap, mmap2, reboot, swapon
dc9c3cb856 linux-user: Split out readlink, readlinkat
59a76e3a59 linux-user: Split out symlink, symlinkat
f731972ba9 linux-user: Split out select, pselect6, newselect
2edfe69a2e linux-user: Split out getrlimit, getrusage, gettimeofday, settimeofday
18aa8ff445 linux-user: Split out rt_sigreturn, sethostname, setrlimit, sigreturn
6687654059 linux-user: Split out rt_sigqueueinfo, rt_sigtimedwait, rt_tgsigqueueinfo
1bdc78b2f5 linux-user: Split out rt_sigpending, rt_sigsuspend, sigpending, sigsuspend
46720dcba9 linux-user: Split out rt_sigprocmask, sgetmask, sigprocmask, ssetmask
425e2caad8 linux-user: Split out rt_sigaction, sigaction
f41d33e02c linux-user: Split out getpgrp, getppid, setsid
7cec32d139 linux-user: Split out chroot, dup2, dup3, fcntl, setpgid, umask
583c2e1a87 linux-user: Split out ioctl
09798331c5 linux-user: Split out acct, pipe, pipe2, times, umount2
1c9f99810a linux-user: Split out dup, mkdir, mkdirat, rmdir
f65bfb57e0 linux-user: Split out rename, renameat, renameat2
e150ec4e3a linux-user: Split out access, faccessat, futimesat, kill, nice, sync, syncfs
4f48d262f9 linux-user: Split out alarm, pause, stime, utime, utimes
3050953a7a linux-user: Split out mount, umount
cd012801d4 linux-user: Split out getpid, getxpid, lseek
b2b2f13dce linux-user: Split out chdir, mknod, mknodat, time, chmod
35fa2508f8 linux-user: Split out unlink, unlinkat
2dbc0673fe linux-user: Split out link, linkat
256c818331 linux-user: Split out creat, fork, waitid, waitpid
4755e70b9b linux-user: Split out open_to_handle_at
472ad288c2 linux-user: Split out name_to_handle_at
b130be5247 linux-user: Split out open, openat
b8369df267 linux-user: Split out execve
fd1ec09ca4 linux-user: Split out brk, close, exit, read, write
4059c672d0 linux-user: Set up infrastructure for table-izing syscalls
e7c3c884d9 linux-user: Make syscall number unsigned
f0e92210cc linux-user: Propagate goto fail to return
127dd9fbe1 linux-user: Propagate goto unimplemented to default
2db600f0f7 linux-user: Propagate goto unimplemented_nowarn to return
c0b2105c4a linux-user: Propagate goto efault to return
4c16dbe787 linux-user: Relax single exit from "break"
78abe22609 linux-user: Split out do_syscall1
7f0b7b14c2 linux-user: Remove DEBUG

=== OUTPUT BEGIN ===
Checking PATCH 1/108: linux-user: Remove DEBUG...
Checking PATCH 2/108: linux-user: Split out do_syscall1...
Checking PATCH 3/108: linux-user: Relax single exit from "break"...
Checking PATCH 4/108: linux-user: Propagate goto efault to return...
ERROR: do not use assignment in if condition
#257: FILE: linux-user/syscall.c:8465:
+            if (!(p = lock_user_string(arg2))) {

ERROR: do not use assignment in if condition
#269: FILE: linux-user/syscall.c:8483:
+        if (!(p = lock_user_string(arg1))) {

ERROR: do not use assignment in if condition
#280: FILE: linux-user/syscall.c:8492:
+        if (!(p = lock_user_string(arg2))) {

ERROR: do not use assignment in if condition
#328: FILE: linux-user/syscall.c:8631:
+            if (!(p = lock_user_string(arg1))) {

ERROR: suspect code indent for conditional statements (11, 15)
#652: FILE: linux-user/syscall.c:9462:
            if (!p) {
+               return -TARGET_EFAULT;

ERROR: do not use assignment in if condition
#691: FILE: linux-user/syscall.c:9596:
+        if (!(p = lock_user_string(arg1))) {

ERROR: do not use assignment in if condition
#712: FILE: linux-user/syscall.c:9632:
+        if (!(p = lock_user_string(arg1))) {

ERROR: do not use assignment in if condition
#767: FILE: linux-user/syscall.c:9838:
+        if (!(p = lock_user_string(arg1))) {

ERROR: do not use assignment in if condition
#778: FILE: linux-user/syscall.c:9847:
+        if (!(p = lock_user_string(arg1))) {

ERROR: do not use assignment in if condition
#1084: FILE: linux-user/syscall.c:10938:
+        if (!(p = lock_user_string(arg1))) {

ERROR: do not use assignment in if condition
#1096: FILE: linux-user/syscall.c:10949:
+        if (!(p = lock_user_string(arg1))) {

ERROR: do not use assignment in if condition
#1108: FILE: linux-user/syscall.c:10972:
+        if (!(p = lock_user_string(arg2))) {

total: 12 errors, 0 warnings, 1228 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 5/108: linux-user: Propagate goto unimplemented_nowarn to return...
Checking PATCH 6/108: linux-user: Propagate goto unimplemented to default...
Checking PATCH 7/108: linux-user: Propagate goto fail to return...
Checking PATCH 8/108: linux-user: Make syscall number unsigned...
Checking PATCH 9/108: linux-user: Set up infrastructure for table-izing syscalls...
Checking PATCH 10/108: linux-user: Split out brk, close, exit, read, write...
Checking PATCH 11/108: linux-user: Split out execve...
Checking PATCH 12/108: linux-user: Split out open, openat...
Checking PATCH 13/108: linux-user: Split out name_to_handle_at...
Checking PATCH 14/108: linux-user: Split out open_to_handle_at...
Checking PATCH 15/108: linux-user: Split out creat, fork, waitid, waitpid...
Checking PATCH 16/108: linux-user: Split out link, linkat...
Checking PATCH 17/108: linux-user: Split out unlink, unlinkat...
Checking PATCH 18/108: linux-user: Split out chdir, mknod, mknodat, time, chmod...
Checking PATCH 19/108: linux-user: Split out getpid, getxpid, lseek...
Checking PATCH 20/108: linux-user: Split out mount, umount...
Checking PATCH 21/108: linux-user: Split out alarm, pause, stime, utime, utimes...
Checking PATCH 22/108: linux-user: Split out access, faccessat, futimesat, kill, nice, sync, syncfs...
Checking PATCH 23/108: linux-user: Split out rename, renameat, renameat2...
Checking PATCH 24/108: linux-user: Split out dup, mkdir, mkdirat, rmdir...
Checking PATCH 25/108: linux-user: Split out acct, pipe, pipe2, times, umount2...
Checking PATCH 26/108: linux-user: Split out ioctl...
Checking PATCH 27/108: linux-user: Split out chroot, dup2, dup3, fcntl, setpgid, umask...
Checking PATCH 28/108: linux-user: Split out getpgrp, getppid, setsid...
Checking PATCH 29/108: linux-user: Split out rt_sigaction, sigaction...
Checking PATCH 30/108: linux-user: Split out rt_sigprocmask, sgetmask, sigprocmask, ssetmask...
Checking PATCH 31/108: linux-user: Split out rt_sigpending, rt_sigsuspend, sigpending, sigsuspend...
Checking PATCH 32/108: linux-user: Split out rt_sigqueueinfo, rt_sigtimedwait, rt_tgsigqueueinfo...
Checking PATCH 33/108: linux-user: Split out rt_sigreturn, sethostname, setrlimit, sigreturn...
Checking PATCH 34/108: linux-user: Split out getrlimit, getrusage, gettimeofday, settimeofday...
Checking PATCH 35/108: linux-user: Split out select, pselect6, newselect...
Checking PATCH 36/108: linux-user: Split out symlink, symlinkat...
Checking PATCH 37/108: linux-user: Split out readlink, readlinkat...
Checking PATCH 38/108: linux-user: Split out mmap, mmap2, reboot, swapon...
Checking PATCH 39/108: linux-user: Split out mprotect, mremap, msync, munmap...
Checking PATCH 40/108: linux-user: Split out mlock, mlockall, munlock, munlockall...
Checking PATCH 41/108: linux-user: Split out fchmod, fchmodat, ftruncate, truncate...
Checking PATCH 42/108: linux-user: Split out fstatfs, fstatfs64, statfs, statfs64...
Checking PATCH 43/108: linux-user: Split out getpriority, setpriority...
Checking PATCH 44/108: linux-user: Split out socketcall...
Checking PATCH 45/108: linux-user: Split out accept, accept4, bind, connect...
Checking PATCH 46/108: linux-user: Split out 7 syscalls...
Checking PATCH 47/108: linux-user: Split out recvmmsg, send, sendmmsg, sendmsg, sendto...
Checking PATCH 48/108: linux-user: Split out getrandom, shutdown, setsockopt, socket, socketpair...
WARNING: architecture specific defines should be avoided
#25: FILE: linux-user/syscall.c:256:
+#ifndef __NR_getrandom

total: 0 errors, 1 warnings, 166 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 49/108: linux-user: Fix stub gettid...
WARNING: architecture specific defines should be avoided
#32: FILE: linux-user/syscall.c:259:
+#ifndef __NR_gettid

total: 0 errors, 1 warnings, 21 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 50/108: linux-user: Split out getitimer, setitimer, syslog...
Checking PATCH 51/108: linux-user: Split out fstat, lstat, stat...
Checking PATCH 52/108: linux-user: Unwrap TARGET_NR_syscall early...
Checking PATCH 53/108: linux-user: Split out swapoff, sysinfo, vhangup, wait4...
Checking PATCH 54/108: linux-user: Split out ipc...
Checking PATCH 55/108: linux-user: Split out ipc syscalls...
Checking PATCH 56/108: linux-user: Split out clone, exit_group, fsync...
WARNING: architecture specific defines should be avoided
#43: FILE: linux-user/syscall.c:7995:
+#ifdef __NR_exit_group

WARNING: architecture specific defines should be avoided
#116: FILE: linux-user/syscall.c:12907:
+#ifdef __NR_exit_group

total: 0 errors, 2 warnings, 112 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 57/108: linux-user: Split out modify_ldt, setdomainname, uname...
Checking PATCH 58/108: linux-user: Split out adjtimex, clock_adjtime, vm86...
Checking PATCH 59/108: linux-user: Split out fchdir, getpgid, llseek, personality...
Checking PATCH 60/108: linux-user: Split out getdents, getdents64...
WARNING: architecture specific defines should be avoided
#148: FILE: linux-user/syscall.c:8255:
+#if defined(TARGET_NR_getdents64) && defined(__NR_getdents64)

WARNING: architecture specific defines should be avoided
#357: FILE: linux-user/syscall.c:12951:
+#if defined(TARGET_NR_getdents64) && defined(__NR_getdents64)

total: 0 errors, 2 warnings, 347 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 61/108: linux-user: Split out poll, ppoll...
Checking PATCH 62/108: linux-user: Split out flock, preadv, pwritev, readv, writev...
Checking PATCH 63/108: linux-user: Split out fdatasync, getsid, _sysctl...
Checking PATCH 64/108: linux-user: Split out sched syscalls...
Checking PATCH 65/108: linux-user: Split out getcpu, nanosleep, prctl...
Checking PATCH 66/108: linux-user: Split out arch_prctl...
Checking PATCH 67/108: linux-user: Split out getcwd, pread64, pwrite64, sigaltstack...
Checking PATCH 68/108: linux-user: Split out capget, capset...
Checking PATCH 69/108: linux-user: Split out sendfile, sendfile64...
Checking PATCH 70/108: linux-user: Split out ftruncate64, truncate64, ugetrlimit, vfork...
Checking PATCH 71/108: linux-user: Split out fstat64, fstatat64, newfstatat, lstat64, stat64...
Checking PATCH 72/108: linux-user: Split out getegid, geteuid, getgid, getuid, lchown...
Checking PATCH 73/108: linux-user: Split out getgroups, setgroups, setregid, setreuid...
Checking PATCH 74/108: linux-user: Split out fchown, fchownat, setresgid, setresuid...
Checking PATCH 75/108: linux-user: Split out chown, getresgid, getresuid...
Checking PATCH 76/108: linux-user: Split out setfsgid, setfsuid, setgid, setuid...
Checking PATCH 77/108: linux-user: Split out getuid32, getxgid, getxuid, lchown32...
Checking PATCH 78/108: linux-user: Split out osf_getsysinfo, osf_setsysinfo, osf_sigprocmask...
Checking PATCH 79/108: linux-user: Split out getegid32, geteuid32, getgid32, setregid32, setreuid32...
Checking PATCH 80/108: linux-user: Split out fchown32, getgroups32, setgroups32...
Checking PATCH 81/108: linux-user: Split out getresgid32, getresuid32, setresgid32, setresuid32...
Checking PATCH 82/108: linux-user: Split out chown32, setfsgid32, setfsuid32, setgid32, setuid32...
Checking PATCH 83/108: linux-user: Split out mincore...
Checking PATCH 84/108: linux-user: Split out fadvise64, fadvise64_64...
Checking PATCH 85/108: linux-user: Split out cacheflush, fcntl64, getpagesize, madvise...
Checking PATCH 86/108: linux-user: Split out gettid, readahead...
Checking PATCH 87/108: linux-user: Split out xattr syscalls...
Checking PATCH 88/108: linux-user: Split out getdomainname, get_thread_area, set_thread_area...
Checking PATCH 89/108: linux-user: Split out clock syscalls...
Checking PATCH 90/108: linux-user: Fix clock_nanosleep...
Checking PATCH 91/108: linux-user: Split out set_tid_address, tgkill, tkill...
WARNING: architecture specific defines should be avoided
#20: FILE: linux-user/syscall.c:253:
+#ifndef __NR_set_tid_address

total: 0 errors, 1 warnings, 90 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 92/108: linux-user: Split out futex, utimensat...
WARNING: architecture specific defines should be avoided
#22: FILE: linux-user/syscall.c:605:
+#ifdef __NR_utimensat

total: 0 errors, 1 warnings, 209 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 93/108: linux-user: Remove sys_futex...
Checking PATCH 94/108: linux-user: Split out inotify syscalls...
Checking PATCH 95/108: linux-user: Split out mq syscalls...
Checking PATCH 96/108: linux-user: Split out splice, tee, vmsplice...
Checking PATCH 97/108: linux-user: Split out eventfd, eventfd2...
Checking PATCH 98/108: linux-user: Split out fallocate, sync_file_range/2...
Checking PATCH 99/108: linux-user: Split out signalfd, signalfd4...
Checking PATCH 100/108: linux-user: Split out epoll syscalls...
Checking PATCH 101/108: linux-user: Split out prlimit64...
Checking PATCH 102/108: linux-user: Split out atomic_barrier, gethostname...
Checking PATCH 103/108: linux-user: Split out atomic_cmpxchg_32...
Checking PATCH 104/108: linux-user: Split out timer syscalls...
Checking PATCH 105/108: linux-user: Split out timerfd syscalls...
Checking PATCH 106/108: linux-user: Split out ioprio_get, ioprio_set, kcmp...
WARNING: architecture specific defines should be avoided
#19: FILE: linux-user/syscall.c:253:
+#ifndef __NR_ioprio_get

WARNING: architecture specific defines should be avoided
#22: FILE: linux-user/syscall.c:256:
+#ifndef __NR_ioprio_set

WARNING: architecture specific defines should be avoided
#25: FILE: linux-user/syscall.c:259:
+#ifndef __NR_kcmp

total: 0 errors, 3 warnings, 99 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 107/108: linux-user: Split out setns, unshare...
Checking PATCH 108/108: linux-user: Fold away do_syscall1...
=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 119+ messages in thread

* Re: [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (108 preceding siblings ...)
  2018-06-10  4:30 ` [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall no-reply
@ 2018-06-10  4:44 ` no-reply
  2018-06-10 12:34 ` Peter Maydell
  2018-06-10 19:08 ` Richard Henderson
  111 siblings, 0 replies; 119+ messages in thread
From: no-reply @ 2018-06-10  4:44 UTC (permalink / raw)
  To: richard.henderson; +Cc: famz, qemu-devel, laurent

Hi,

This series failed build test on s390x host. Please find the details below.

Type: series
Message-id: 20180610030220.3777-1-richard.henderson@linaro.org
Subject: [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall

=== TEST SCRIPT BEGIN ===
#!/bin/bash
# Testing script will be invoked under the git checkout with
# HEAD pointing to a commit that has the patches applied on top of "base"
# branch
set -e
echo "=== ENV ==="
env
echo "=== PACKAGES ==="
rpm -qa
echo "=== TEST BEGIN ==="
CC=$HOME/bin/cc
INSTALL=$PWD/install
BUILD=$PWD/build
echo -n "Using CC: "
realpath $CC
mkdir -p $BUILD $INSTALL
SRC=$PWD
cd $BUILD
$SRC/configure --cc=$CC --prefix=$INSTALL
make -j4
# XXX: we need reliable clean up
# make check -j4 V=1
make install
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]               patchew/20180610030220.3777-1-richard.henderson@linaro.org -> patchew/20180610030220.3777-1-richard.henderson@linaro.org
Switched to a new branch 'test'
142736fa01 linux-user: Fold away do_syscall1
b2fe320d4d linux-user: Split out setns, unshare
33ff337032 linux-user: Split out ioprio_get, ioprio_set, kcmp
3ee28ca711 linux-user: Split out timerfd syscalls
5537a2d2ce linux-user: Split out timer syscalls
956dc14fee linux-user: Split out atomic_cmpxchg_32
e7a1e5442b linux-user: Split out atomic_barrier, gethostname
b795dc37af linux-user: Split out prlimit64
b872c05a7b linux-user: Split out epoll syscalls
2b1db10c6b linux-user: Split out signalfd, signalfd4
69c7eef49d linux-user: Split out fallocate, sync_file_range/2
41b5a76976 linux-user: Split out eventfd, eventfd2
7aaafd89f6 linux-user: Split out splice, tee, vmsplice
961a2eb243 linux-user: Split out mq syscalls
64070cf90c linux-user: Split out inotify syscalls
09338954b0 linux-user: Remove sys_futex
984e9f5622 linux-user: Split out futex, utimensat
bd7c9988f3 linux-user: Split out set_tid_address, tgkill, tkill
2b632458ae linux-user: Fix clock_nanosleep
3a312f25d3 linux-user: Split out clock syscalls
abe5a1b94d linux-user: Split out getdomainname, get_thread_area, set_thread_area
0722311d8c linux-user: Split out xattr syscalls
570cf4cf05 linux-user: Split out gettid, readahead
863d38626f linux-user: Split out cacheflush, fcntl64, getpagesize, madvise
ab4c8863c6 linux-user: Split out fadvise64, fadvise64_64
65f8f2263b linux-user: Split out mincore
27893e3664 linux-user: Split out chown32, setfsgid32, setfsuid32, setgid32, setuid32
c46299c2db linux-user: Split out getresgid32, getresuid32, setresgid32, setresuid32
84a40d4226 linux-user: Split out fchown32, getgroups32, setgroups32
db41e152e5 linux-user: Split out getegid32, geteuid32, getgid32, setregid32, setreuid32
a0c6ad4e91 linux-user: Split out osf_getsysinfo, osf_setsysinfo, osf_sigprocmask
d344b150d9 linux-user: Split out getuid32, getxgid, getxuid, lchown32
e074a94e8f linux-user: Split out setfsgid, setfsuid, setgid, setuid
8613205669 linux-user: Split out chown, getresgid, getresuid
ca3e6e25ee linux-user: Split out fchown, fchownat, setresgid, setresuid
c4b670a25b linux-user: Split out getgroups, setgroups, setregid, setreuid
e9ea9a67b8 linux-user: Split out getegid, geteuid, getgid, getuid, lchown
8cf5c522fe linux-user: Split out fstat64, fstatat64, newfstatat, lstat64, stat64
a7aed32bd2 linux-user: Split out ftruncate64, truncate64, ugetrlimit, vfork
cebb6ef034 linux-user: Split out sendfile, sendfile64
bd2685b32a linux-user: Split out capget, capset
04ec16bc18 linux-user: Split out getcwd, pread64, pwrite64, sigaltstack
6e31fdfe46 linux-user: Split out arch_prctl
0099ab046e linux-user: Split out getcpu, nanosleep, prctl
64abc0d8c0 linux-user: Split out sched syscalls
da229f4f47 linux-user: Split out fdatasync, getsid, _sysctl
309936b671 linux-user: Split out flock, preadv, pwritev, readv, writev
22eb82902c linux-user: Split out poll, ppoll
b2c1d23350 linux-user: Split out getdents, getdents64
8d6564790a linux-user: Split out fchdir, getpgid, llseek, personality
c03d18c884 linux-user: Split out adjtimex, clock_adjtime, vm86
7203e31f9a linux-user: Split out modify_ldt, setdomainname, uname
e0f3e1ae92 linux-user: Split out clone, exit_group, fsync
d5f6938594 linux-user: Split out ipc syscalls
206d20e09d linux-user: Split out ipc
a8ff1f9c61 linux-user: Split out swapoff, sysinfo, vhangup, wait4
a96df8a712 linux-user: Unwrap TARGET_NR_syscall early
39526d0b45 linux-user: Split out fstat, lstat, stat
c8dc0c7596 linux-user: Split out getitimer, setitimer, syslog
01d065020b linux-user: Fix stub gettid
d89802d484 linux-user: Split out getrandom, shutdown, setsockopt, socket, socketpair
43a8fed411 linux-user: Split out recvmmsg, send, sendmmsg, sendmsg, sendto
6d6f6b0903 linux-user: Split out 7 syscalls
86639c65aa linux-user: Split out accept, accept4, bind, connect
21aa01481b linux-user: Split out socketcall
aafdcc007c linux-user: Split out getpriority, setpriority
14a6348a73 linux-user: Split out fstatfs, fstatfs64, statfs, statfs64
ff2d572b96 linux-user: Split out fchmod, fchmodat, ftruncate, truncate
8994add885 linux-user: Split out mlock, mlockall, munlock, munlockall
5d517b07ee linux-user: Split out mprotect, mremap, msync, munmap
756b5a7202 linux-user: Split out mmap, mmap2, reboot, swapon
dc9c3cb856 linux-user: Split out readlink, readlinkat
59a76e3a59 linux-user: Split out symlink, symlinkat
f731972ba9 linux-user: Split out select, pselect6, newselect
2edfe69a2e linux-user: Split out getrlimit, getrusage, gettimeofday, settimeofday
18aa8ff445 linux-user: Split out rt_sigreturn, sethostname, setrlimit, sigreturn
6687654059 linux-user: Split out rt_sigqueueinfo, rt_sigtimedwait, rt_tgsigqueueinfo
1bdc78b2f5 linux-user: Split out rt_sigpending, rt_sigsuspend, sigpending, sigsuspend
46720dcba9 linux-user: Split out rt_sigprocmask, sgetmask, sigprocmask, ssetmask
425e2caad8 linux-user: Split out rt_sigaction, sigaction
f41d33e02c linux-user: Split out getpgrp, getppid, setsid
7cec32d139 linux-user: Split out chroot, dup2, dup3, fcntl, setpgid, umask
583c2e1a87 linux-user: Split out ioctl
09798331c5 linux-user: Split out acct, pipe, pipe2, times, umount2
1c9f99810a linux-user: Split out dup, mkdir, mkdirat, rmdir
f65bfb57e0 linux-user: Split out rename, renameat, renameat2
e150ec4e3a linux-user: Split out access, faccessat, futimesat, kill, nice, sync, syncfs
4f48d262f9 linux-user: Split out alarm, pause, stime, utime, utimes
3050953a7a linux-user: Split out mount, umount
cd012801d4 linux-user: Split out getpid, getxpid, lseek
b2b2f13dce linux-user: Split out chdir, mknod, mknodat, time, chmod
35fa2508f8 linux-user: Split out unlink, unlinkat
2dbc0673fe linux-user: Split out link, linkat
256c818331 linux-user: Split out creat, fork, waitid, waitpid
4755e70b9b linux-user: Split out open_to_handle_at
472ad288c2 linux-user: Split out name_to_handle_at
b130be5247 linux-user: Split out open, openat
b8369df267 linux-user: Split out execve
fd1ec09ca4 linux-user: Split out brk, close, exit, read, write
4059c672d0 linux-user: Set up infrastructure for table-izing syscalls
e7c3c884d9 linux-user: Make syscall number unsigned
f0e92210cc linux-user: Propagate goto fail to return
127dd9fbe1 linux-user: Propagate goto unimplemented to default
2db600f0f7 linux-user: Propagate goto unimplemented_nowarn to return
c0b2105c4a linux-user: Propagate goto efault to return
4c16dbe787 linux-user: Relax single exit from "break"
78abe22609 linux-user: Split out do_syscall1
7f0b7b14c2 linux-user: Remove DEBUG

=== OUTPUT BEGIN ===
=== ENV ===
LANG=en_US.UTF-8
XDG_SESSION_ID=225076
USER=fam
PWD=/var/tmp/patchew-tester-tmp-u8athipi/src
HOME=/home/fam
SHELL=/bin/sh
SHLVL=2
PATCHEW=/home/fam/patchew/patchew-cli -s http://patchew.org --nodebug
LOGNAME=fam
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1012/bus
XDG_RUNTIME_DIR=/run/user/1012
PATH=/usr/bin:/bin
_=/usr/bin/env
=== PACKAGES ===
gpg-pubkey-873529b8-54e386ff
glibc-debuginfo-common-2.24-10.fc25.s390x
fedora-release-26-1.noarch
dejavu-sans-mono-fonts-2.35-4.fc26.noarch
xemacs-filesystem-21.5.34-22.20170124hgf412e9f093d4.fc26.noarch
bash-4.4.12-7.fc26.s390x
libSM-1.2.2-5.fc26.s390x
libmpc-1.0.2-6.fc26.s390x
libaio-0.3.110-7.fc26.s390x
libverto-0.2.6-7.fc26.s390x
perl-Scalar-List-Utils-1.48-1.fc26.s390x
iptables-libs-1.6.1-2.fc26.s390x
tcl-8.6.6-2.fc26.s390x
libxshmfence-1.2-4.fc26.s390x
expect-5.45-23.fc26.s390x
perl-Thread-Queue-3.12-1.fc26.noarch
perl-encoding-2.19-6.fc26.s390x
keyutils-1.5.10-1.fc26.s390x
gmp-devel-6.1.2-4.fc26.s390x
enchant-1.6.0-16.fc26.s390x
python-gobject-base-3.24.1-1.fc26.s390x
python3-enchant-1.6.10-1.fc26.noarch
python-lockfile-0.11.0-6.fc26.noarch
python2-pyparsing-2.1.10-3.fc26.noarch
python2-lxml-4.1.1-1.fc26.s390x
librados2-10.2.7-2.fc26.s390x
trousers-lib-0.3.13-7.fc26.s390x
libdatrie-0.2.9-4.fc26.s390x
libsoup-2.58.2-1.fc26.s390x
passwd-0.79-9.fc26.s390x
bind99-libs-9.9.10-3.P3.fc26.s390x
python3-rpm-4.13.0.2-1.fc26.s390x
systemd-233-7.fc26.s390x
virglrenderer-0.6.0-1.20170210git76b3da97b.fc26.s390x
s390utils-ziomon-1.36.1-3.fc26.s390x
s390utils-osasnmpd-1.36.1-3.fc26.s390x
libXrandr-1.5.1-2.fc26.s390x
libglvnd-glx-1.0.0-1.fc26.s390x
texlive-ifxetex-svn19685.0.5-33.fc26.2.noarch
texlive-psnfss-svn33946.9.2a-33.fc26.2.noarch
texlive-dvipdfmx-def-svn40328-33.fc26.2.noarch
texlive-natbib-svn20668.8.31b-33.fc26.2.noarch
texlive-xdvi-bin-svn40750-33.20160520.fc26.2.s390x
texlive-cm-svn32865.0-33.fc26.2.noarch
texlive-beton-svn15878.0-33.fc26.2.noarch
texlive-fpl-svn15878.1.002-33.fc26.2.noarch
texlive-mflogo-svn38628-33.fc26.2.noarch
texlive-texlive-docindex-svn41430-33.fc26.2.noarch
texlive-luaotfload-bin-svn34647.0-33.20160520.fc26.2.noarch
texlive-koma-script-svn41508-33.fc26.2.noarch
texlive-pst-tree-svn24142.1.12-33.fc26.2.noarch
texlive-breqn-svn38099.0.98d-33.fc26.2.noarch
texlive-xetex-svn41438-33.fc26.2.noarch
gstreamer1-plugins-bad-free-1.12.3-1.fc26.s390x
xorg-x11-font-utils-7.5-33.fc26.s390x
ghostscript-fonts-5.50-36.fc26.noarch
libXext-devel-1.3.3-5.fc26.s390x
libusbx-devel-1.0.21-2.fc26.s390x
libglvnd-devel-1.0.0-1.fc26.s390x
emacs-25.3-3.fc26.s390x
alsa-lib-devel-1.1.4.1-1.fc26.s390x
kbd-2.0.4-2.fc26.s390x
dconf-0.26.0-2.fc26.s390x
mc-4.8.19-5.fc26.s390x
doxygen-1.8.13-9.fc26.s390x
dpkg-1.18.24-1.fc26.s390x
libtdb-1.3.13-1.fc26.s390x
python2-pynacl-1.1.1-1.fc26.s390x
perl-Filter-1.58-1.fc26.s390x
python2-pip-9.0.1-11.fc26.noarch
dnf-2.7.5-2.fc26.noarch
bind-license-9.11.2-1.P1.fc26.noarch
libtasn1-4.13-1.fc26.s390x
cpp-7.3.1-2.fc26.s390x
pkgconf-1.3.12-2.fc26.s390x
python2-fedora-0.10.0-1.fc26.noarch
cmake-filesystem-3.10.1-11.fc26.s390x
python3-requests-kerberos-0.12.0-1.fc26.noarch
libmicrohttpd-0.9.59-1.fc26.s390x
GeoIP-GeoLite-data-2018.01-1.fc26.noarch
python2-libs-2.7.14-7.fc26.s390x
libidn2-2.0.4-3.fc26.s390x
p11-kit-devel-0.23.10-1.fc26.s390x
perl-Errno-1.25-396.fc26.s390x
libdrm-2.4.90-2.fc26.s390x
sssd-common-1.16.1-1.fc26.s390x
boost-random-1.63.0-11.fc26.s390x
urw-fonts-2.4-24.fc26.noarch
ccache-3.3.6-1.fc26.s390x
glibc-debuginfo-2.24-10.fc25.s390x
dejavu-fonts-common-2.35-4.fc26.noarch
bind99-license-9.9.10-3.P3.fc26.noarch
ncurses-libs-6.0-8.20170212.fc26.s390x
libpng-1.6.28-2.fc26.s390x
libICE-1.0.9-9.fc26.s390x
perl-Text-ParseWords-3.30-366.fc26.noarch
libtool-ltdl-2.4.6-17.fc26.s390x
libselinux-utils-2.6-7.fc26.s390x
userspace-rcu-0.9.3-2.fc26.s390x
perl-Class-Inspector-1.31-3.fc26.noarch
keyutils-libs-devel-1.5.10-1.fc26.s390x
isl-0.16.1-1.fc26.s390x
libsecret-0.18.5-3.fc26.s390x
compat-openssl10-1.0.2m-1.fc26.s390x
python3-iniparse-0.4-24.fc26.noarch
python3-dateutil-2.6.0-3.fc26.noarch
python3-firewall-0.4.4.5-1.fc26.noarch
python-enum34-1.1.6-1.fc26.noarch
python2-pygments-2.2.0-7.fc26.noarch
python2-dockerfile-parse-0.0.7-1.fc26.noarch
perl-Net-SSLeay-1.81-1.fc26.s390x
hostname-3.18-2.fc26.s390x
libtirpc-1.0.2-0.fc26.s390x
rpm-build-libs-4.13.0.2-1.fc26.s390x
libutempter-1.1.6-9.fc26.s390x
systemd-pam-233-7.fc26.s390x
libXinerama-1.1.3-7.fc26.s390x
mesa-libGL-17.2.4-2.fc26.s390x
texlive-amsfonts-svn29208.3.04-33.fc26.2.noarch
texlive-caption-svn41409-33.fc26.2.noarch
texlive-enumitem-svn24146.3.5.2-33.fc26.2.noarch
texlive-pdftex-def-svn22653.0.06d-33.fc26.2.noarch
texlive-xdvi-svn40768-33.fc26.2.noarch
texlive-courier-svn35058.0-33.fc26.2.noarch
texlive-charter-svn15878.0-33.fc26.2.noarch
texlive-graphics-def-svn41879-33.fc26.2.noarch
texlive-mfnfss-svn19410.0-33.fc26.2.noarch
texlive-texlive-en-svn41185-33.fc26.2.noarch
texlive-ifplatform-svn21156.0.4-33.fc26.2.noarch
texlive-ms-svn29849.0-33.fc26.2.noarch
texlive-pst-tools-svn34067.0.05-33.fc26.2.noarch
texlive-powerdot-svn38984-33.fc26.2.noarch
texlive-xetexconfig-svn41133-33.fc26.2.noarch
libvdpau-1.1.1-4.fc26.s390x
zlib-devel-1.2.11-2.fc26.s390x
gdk-pixbuf2-devel-2.36.9-1.fc26.s390x
libX11-devel-1.6.5-2.fc26.s390x
libglvnd-core-devel-1.0.0-1.fc26.s390x
SDL2-devel-2.0.7-2.fc26.s390x
webkitgtk3-2.4.11-5.fc26.s390x
grubby-8.40-4.fc26.s390x
uboot-tools-2017.05-4.fc26.s390x
cracklib-dicts-2.9.6-5.fc26.s390x
texinfo-6.3-3.fc26.s390x
time-1.7-52.fc26.s390x
python2-deltarpm-3.6-19.fc26.s390x
python2-setuptools-37.0.0-1.fc26.noarch
python2-dnf-2.7.5-2.fc26.noarch
groff-base-1.22.3-10.fc26.s390x
python2-GitPython-2.1.7-2.fc26.noarch
cups-libs-2.2.2-8.fc26.s390x
bind-libs-lite-9.11.2-1.P1.fc26.s390x
libpkgconf-1.3.12-2.fc26.s390x
java-1.8.0-openjdk-headless-1.8.0.161-5.b14.fc26.s390x
python3-dnf-plugin-system-upgrade-2.0.5-1.fc26.noarch
dtc-1.4.6-1.fc26.s390x
glusterfs-client-xlators-3.10.11-1.fc26.s390x
libunistring-0.9.9-1.fc26.s390x
python3-libs-3.6.4-3.fc26.s390x
perl-IO-1.36-396.fc26.s390x
libXcursor-1.1.15-1.fc26.s390x
libdrm-devel-2.4.90-2.fc26.s390x
boost-thread-1.63.0-11.fc26.s390x
strace-4.21-1.fc26.s390x
boost-iostreams-1.63.0-11.fc26.s390x
gpg-pubkey-efe550f5-5220ba41
gpg-pubkey-81b46521-55b3ca9a
filesystem-3.2-40.fc26.s390x
basesystem-11-3.fc26.noarch
js-jquery-3.2.1-1.fc26.noarch
libidn-1.33-2.fc26.s390x
libogg-1.3.2-6.fc26.s390x
slang-2.3.1a-2.fc26.s390x
apr-1.6.3-1.fc26.s390x
libxkbcommon-0.7.1-3.fc26.s390x
less-487-3.fc26.s390x
lttng-ust-2.9.0-2.fc26.s390x
OpenEXR-libs-2.2.0-6.fc26.s390x
ipset-libs-6.29-3.fc26.s390x
perl-XML-XPath-1.42-1.fc26.noarch
lua-filesystem-1.6.3-3.fc24.s390x
gstreamer1-1.12.3-1.fc26.s390x
libpwquality-1.3.0-8.fc26.s390x
gettext-libs-0.19.8.1-9.fc26.s390x
python3-chardet-2.3.0-3.fc26.noarch
python3-slip-dbus-0.6.4-6.fc26.noarch
python-chardet-2.3.0-3.fc26.noarch
python2-pyasn1-0.2.3-1.fc26.noarch
python-slip-dbus-0.6.4-6.fc26.noarch
libarchive-3.2.2-4.fc26.s390x
libbabeltrace-1.5.2-2.fc26.s390x
cdparanoia-libs-10.2-22.fc26.s390x
gpgme-1.8.0-12.fc26.s390x
python2-gpg-1.8.0-12.fc26.s390x
shadow-utils-4.3.1-3.fc26.s390x
cryptsetup-libs-1.7.5-1.fc26.s390x
kpartx-0.4.9-88.fc26.s390x
libXi-1.7.9-2.fc26.s390x
texlive-tetex-svn41059-33.fc26.2.noarch
texlive-tools-svn40934-33.fc26.2.noarch
texlive-bibtex-bin-svn40473-33.20160520.fc26.2.s390x
texlive-mfware-bin-svn40473-33.20160520.fc26.2.s390x
texlive-underscore-svn18261.0-33.fc26.2.noarch
texlive-avantgar-svn31835.0-33.fc26.2.noarch
texlive-anysize-svn15878.0-33.fc26.2.noarch
texlive-lineno-svn21442.4.41-33.fc26.2.noarch
texlive-mathpazo-svn15878.1.003-33.fc26.2.noarch
texlive-soul-svn15878.2.4-33.fc26.2.noarch
texlive-luatexbase-svn38550-33.fc26.2.noarch
texlive-listings-svn37534.1.6-33.fc26.2.noarch
texlive-pstricks-svn41321-33.fc26.2.noarch
texlive-metalogo-svn18611.0.12-33.fc26.2.noarch
texlive-dvipdfmx-svn41149-33.fc26.2.noarch
kbd-legacy-2.0.4-2.fc26.noarch
ghostscript-x11-9.20-10.fc26.s390x
libXrender-devel-0.9.10-2.fc26.s390x
libxkbcommon-devel-0.7.1-3.fc26.s390x
mesa-libGL-devel-17.2.4-2.fc26.s390x
usbredir-devel-0.7.1-3.fc26.s390x
libcap-devel-2.25-5.fc26.s390x
brlapi-devel-0.6.6-5.fc26.s390x
python3-pygpgme-0.3-22.fc26.s390x
pinentry-0.9.7-3.fc26.s390x
qemu-sanity-check-nodeps-1.1.5-6.fc26.s390x
libldb-1.1.29-5.fc26.s390x
libwayland-cursor-1.13.0-3.fc26.s390x
pulseaudio-libs-devel-11.1-7.fc26.s390x
json-c-0.12.1-5.fc26.s390x
libgcrypt-1.8.2-1.fc26.s390x
libgo-devel-7.3.1-2.fc26.s390x
ca-certificates-2018.2.22-1.0.fc26.noarch
python2-sphinx-1.5.6-1.fc26.noarch
dnsmasq-2.76-6.fc26.s390x
perl-Module-CoreList-5.20180120-1.fc26.noarch
pcre-8.41-6.fc26.s390x
net-snmp-libs-5.7.3-27.fc26.s390x
gnutls-dane-3.5.18-2.fc26.s390x
glusterfs-devel-3.10.11-1.fc26.s390x
libsss_nss_idmap-1.16.1-1.fc26.s390x
elfutils-0.170-4.fc26.s390x
nss-devel-3.36.0-1.0.fc26.s390x
perl-open-1.10-396.fc26.noarch
ethtool-4.15-1.fc26.s390x
gpg-pubkey-34ec9cba-54e38751
gpg-pubkey-030d5aed-55b577f0
setup-2.10.5-2.fc26.noarch
lato-fonts-2.015-3.fc26.noarch
web-assets-filesystem-5-5.fc26.noarch
libsepol-2.6-2.fc26.s390x
libcap-2.25-5.fc26.s390x
tcp_wrappers-libs-7.6-85.fc26.s390x
libnl3-3.3.0-1.fc26.s390x
pixman-0.34.0-3.fc26.s390x
lzo-2.08-9.fc26.s390x
libnl3-cli-3.3.0-1.fc26.s390x
gpm-libs-1.20.7-10.fc26.s390x
iso-codes-3.74-2.fc26.noarch
ipset-6.29-3.fc26.s390x
lua-term-0.07-1.fc25.s390x
libdb-utils-5.3.28-24.fc26.s390x
dbus-glib-0.108-2.fc26.s390x
pam-1.3.0-2.fc26.s390x
avahi-glib-0.6.32-7.fc26.s390x
python2-dateutil-2.6.0-3.fc26.noarch
python3-asn1crypto-0.23.0-1.fc26.noarch
python3-slip-0.6.4-6.fc26.noarch
python-backports-ssl_match_hostname-3.5.0.1-4.fc26.noarch
python2-pyOpenSSL-16.2.0-6.fc26.noarch
python-slip-0.6.4-6.fc26.noarch
nss-pem-1.0.3-3.fc26.s390x
fipscheck-1.5.0-1.fc26.s390x
cyrus-sasl-lib-2.1.26-32.fc26.s390x
python3-kerberos-1.2.5-3.fc26.s390x
rpmconf-1.0.19-1.fc26.noarch
libsemanage-2.6-4.fc26.s390x
device-mapper-libs-1.02.137-6.fc26.s390x
yum-3.4.3-512.fc26.noarch
device-mapper-multipath-0.4.9-88.fc26.s390x
libXtst-1.2.3-2.fc26.s390x
libXxf86vm-1.1.4-4.fc26.s390x
texlive-amsmath-svn41561-33.fc26.2.noarch
texlive-xkeyval-svn35741.2.7a-33.fc26.2.noarch
texlive-bibtex-svn40768-33.fc26.2.noarch
texlive-mfware-svn40768-33.fc26.2.noarch
texlive-wasy-svn35831.0-33.fc26.2.noarch
texlive-bookman-svn31835.0-33.fc26.2.noarch
texlive-babel-english-svn30264.3.3p-33.fc26.2.noarch
texlive-fix2col-svn38770-33.fc26.2.noarch
texlive-mdwtools-svn15878.1.05.4-33.fc26.2.noarch
texlive-tex-gyre-math-svn41264-33.fc26.2.noarch
texlive-luaotfload-svn40902-33.fc26.2.noarch
texlive-showexpl-svn32737.v0.3l-33.fc26.2.noarch
texlive-pstricks-add-svn40744-33.fc26.2.noarch
texlive-l3experimental-svn41163-33.fc26.2.noarch
texlive-xetex-bin-svn41091-33.20160520.fc26.2.s390x
kbd-misc-2.0.4-2.fc26.noarch
libpng-devel-1.6.28-2.fc26.s390x
ghostscript-core-9.20-10.fc26.s390x
libXfixes-devel-5.0.3-2.fc26.s390x
libverto-devel-0.2.6-7.fc26.s390x
mesa-libEGL-devel-17.2.4-2.fc26.s390x
popt-devel-1.16-12.fc26.s390x
readline-devel-7.0-5.fc26.s390x
cyrus-sasl-devel-2.1.26-32.fc26.s390x
sendmail-8.15.2-19.fc26.s390x
systemd-bootchart-231-3.fc26.s390x
perl-IO-Socket-SSL-2.049-1.fc26.noarch
python2-enchant-1.6.10-1.fc26.noarch
perl-generators-1.10-2.fc26.noarch
createrepo-0.10.3-11.fc26.noarch
pulseaudio-libs-glib2-11.1-7.fc26.s390x
dhcp-libs-4.3.5-10.fc26.s390x
libtiff-4.0.9-1.fc26.s390x
python-srpm-macros-3-21.fc26.noarch
libtalloc-2.1.11-1.fc26.s390x
nfs-utils-2.2.1-4.rc2.fc26.s390x
qt5-srpm-macros-5.9.4-2.fc26.noarch
python2-dnf-plugins-core-2.1.5-4.fc26.noarch
mariadb-libs-10.1.30-2.fc26.s390x
bind-libs-9.11.2-1.P1.fc26.s390x
acpica-tools-20180105-1.fc26.s390x
perl-podlators-4.09-3.fc26.noarch
glusterfs-3.10.11-1.fc26.s390x
nss-sysinit-3.36.0-1.0.fc26.s390x
gnutls-c++-3.5.18-2.fc26.s390x
perl-macros-5.24.3-396.fc26.s390x
sssd-client-1.16.1-1.fc26.s390x
elfutils-devel-0.170-4.fc26.s390x
kernel-4.15.12-201.fc26.s390x
vim-minimal-8.0.1553-1.fc26.s390x
desktop-file-utils-0.23-6.fc26.s390x
fontpackages-filesystem-1.44-18.fc26.noarch
vte-profile-0.48.4-1.fc26.s390x
texlive-kpathsea-doc-svn41139-33.fc26.2.noarch
zlib-1.2.11-2.fc26.s390x
readline-7.0-5.fc26.s390x
libattr-2.4.47-18.fc26.s390x
libglvnd-1.0.0-1.fc26.s390x
lz4-libs-1.8.0-1.fc26.s390x
perl-File-Path-2.12-367.fc26.noarch
perl-Unicode-EastAsianWidth-1.33-9.fc26.noarch
hunspell-1.5.4-2.fc26.s390x
libasyncns-0.8-11.fc26.s390x
libnetfilter_conntrack-1.0.6-2.fc26.s390x
perl-Storable-2.56-368.fc26.s390x
autoconf-2.69-24.fc26.noarch
device-mapper-persistent-data-0.6.3-5.fc26.s390x
quota-4.03-9.fc26.s390x
crypto-policies-20170606-1.git7c32281.fc26.noarch
glib2-2.52.3-2.fc26.s390x
python2-idna-2.5-1.fc26.noarch
python2-libcomps-0.1.8-3.fc26.s390x
gsettings-desktop-schemas-3.24.1-1.fc26.s390x
javapackages-tools-4.7.0-17.fc26.noarch
libselinux-python3-2.6-7.fc26.s390x
python-backports-1.0-9.fc26.s390x
python2-cryptography-2.0.2-2.fc26.s390x
libselinux-python-2.6-7.fc26.s390x
Lmod-7.5.3-1.fc26.s390x
fipscheck-lib-1.5.0-1.fc26.s390x
libuser-0.62-6.fc26.s390x
npth-1.5-1.fc26.s390x
packagedb-cli-2.14.1-2.fc26.noarch
ustr-1.0.4-22.fc26.s390x
device-mapper-1.02.137-6.fc26.s390x
polkit-pkla-compat-0.1-8.fc26.s390x
fakeroot-1.22-1.fc26.s390x
libXmu-1.1.2-5.fc26.s390x
cairo-gobject-1.14.10-1.fc26.s390x
texlive-booktabs-svn40846-33.fc26.2.noarch
texlive-dvips-bin-svn40987-33.20160520.fc26.2.s390x
texlive-float-svn15878.1.3d-33.fc26.2.noarch
texlive-tex-svn40793-33.fc26.2.noarch
texlive-fancyref-svn15878.0.9c-33.fc26.2.noarch
texlive-manfnt-font-svn35799.0-33.fc26.2.noarch
texlive-cmap-svn41168-33.fc26.2.noarch
texlive-hyph-utf8-svn41189-33.fc26.2.noarch
texlive-paralist-svn39247-33.fc26.2.noarch
texlive-trimspaces-svn15878.1.1-33.fc26.2.noarch
texlive-tipa-svn29349.1.3-33.fc26.2.noarch
texlive-l3packages-svn41246-33.fc26.2.noarch
texlive-pst-pdf-svn31660.1.1v-33.fc26.2.noarch
texlive-tex-gyre-svn18651.2.004-33.fc26.2.noarch
texlive-beamer-svn36461.3.36-33.fc26.2.noarch
gd-2.2.5-1.fc26.s390x
gc-devel-7.6.0-2.fc26.s390x
libXft-devel-2.3.2-5.fc26.s390x
rpm-devel-4.13.0.2-1.fc26.s390x
bluez-libs-devel-5.46-6.fc26.s390x
trousers-0.3.13-7.fc26.s390x
iproute-tc-4.11.0-1.fc26.s390x
libgnome-keyring-3.12.0-8.fc26.s390x
perl-File-ShareDir-1.102-8.fc26.noarch
python2-paramiko-2.2.1-1.fc26.noarch
python2-openidc-client-0.4.0-1.20171113git54dee6e.fc26.noarch
openssh-server-7.5p1-4.fc26.s390x
pulseaudio-libs-11.1-7.fc26.s390x
python2-bodhi-2.12.2-3.fc26.noarch
lua-libs-5.3.4-7.fc26.s390x
dhcp-common-4.3.5-10.fc26.noarch
python3-pip-9.0.1-11.fc26.noarch
python2-py-1.4.34-1.fc26.noarch
glibc-common-2.25-13.fc26.s390x
webkitgtk4-jsc-2.18.6-1.fc26.s390x
glibc-devel-2.25-13.fc26.s390x
pcre2-10.23-13.fc26.s390x
linux-firmware-20171215-82.git2451bb22.fc26.noarch
libfdt-devel-1.4.6-1.fc26.s390x
audit-2.8.2-1.fc26.s390x
perl-Socket-2.027-1.fc26.s390x
nosync-1.0-6.fc26.s390x
redhat-rpm-config-65-1.fc26.noarch
freetype-2.7.1-10.fc26.s390x
gnutls-3.5.18-2.fc26.s390x
sqlite-3.20.1-2.fc26.s390x
pcre-devel-8.41-6.fc26.s390x
fedpkg-1.32-1.fc26.noarch
gnutls-devel-3.5.18-2.fc26.s390x
python2-pytz-2017.2-7.fc26.noarch
gsm-1.0.17-2.fc26.s390x
gpg-pubkey-95a43f54-5284415a
gpg-pubkey-fdb19c98-56fd6333
gpg-pubkey-64dab85d-57d33e22
firewalld-filesystem-0.4.4.5-1.fc26.noarch
xkeyboard-config-2.21-3.fc26.noarch
texlive-texlive-common-doc-svn40682-33.fc26.2.noarch
ncurses-base-6.0-8.20170212.fc26.noarch
libselinux-2.6-7.fc26.s390x
bzip2-libs-1.0.6-22.fc26.s390x
libdb-5.3.28-24.fc26.s390x
file-libs-5.30-11.fc26.s390x
libxslt-1.1.29-1.fc26.s390x
gdbm-1.13-1.fc26.s390x
libepoxy-1.4.3-1.fc26.s390x
libpsl-0.18.0-1.fc26.s390x
perl-Carp-1.40-366.fc26.noarch
e2fsprogs-libs-1.43.4-2.fc26.s390x
libmnl-1.0.4-2.fc26.s390x
openjpeg2-2.2.0-3.fc26.s390x
perl-PathTools-3.63-367.fc26.s390x
perl-File-Temp-0.230.400-2.fc26.noarch
perl-XML-Parser-2.44-6.fc26.s390x
libss-1.43.4-2.fc26.s390x
ilmbase-2.2.0-8.fc26.s390x
fuse-libs-2.9.7-2.fc26.s390x
libdaemon-0.14-11.fc26.s390x
libbasicobjects-0.1.1-34.fc26.s390x
iptables-1.6.1-2.fc26.s390x
perl-TermReadKey-2.37-2.fc26.s390x
perl-Term-ANSIColor-4.06-2.fc26.noarch
perl-libintl-perl-1.26-2.fc26.s390x
usbredir-0.7.1-3.fc26.s390x
fftw-libs-double-3.3.5-4.fc26.s390x
libiscsi-1.15.0-3.fc26.s390x
ttmkfdir-3.0.9-49.fc26.s390x
texlive-base-2016-33.20160520.fc26.1.noarch
python2-six-1.10.0-9.fc26.noarch
atk-2.24.0-1.fc26.s390x
python2-kitchen-1.2.4-6.fc26.noarch
guile-2.0.14-1.fc26.s390x
pyxattr-0.5.3-10.fc26.s390x
libyaml-0.1.7-2.fc26.s390x
python3-PyYAML-3.12-3.fc26.s390x
openssh-7.5p1-4.fc26.s390x
openssl-1.1.0g-1.fc26.s390x
gawk-4.1.4-6.fc26.s390x
openldap-2.4.45-2.fc26.s390x
NetworkManager-libnm-1.8.2-4.fc26.s390x
python2-urllib3-1.20-2.fc26.noarch
python3-py-1.4.34-1.fc26.noarch
perl-ExtUtils-Command-7.24-3.fc26.noarch
tzdata-2018c-1.fc26.noarch
libcrypt-nss-2.25-13.fc26.s390x
libstdc++-devel-7.3.1-2.fc26.s390x
rpcbind-0.2.4-8.rc3.fc26.s390x
gdb-headless-8.0.1-36.fc26.s390x
python3-dnf-plugins-extras-common-2.0.5-1.fc26.noarch
glibc-headers-2.25-13.fc26.s390x
libfdt-1.4.6-1.fc26.s390x
wget-1.19.4-1.fc26.s390x
mariadb-common-10.1.30-2.fc26.s390x
python2-dnf-plugin-migrate-2.1.5-4.fc26.noarch
pcre2-devel-10.23-13.fc26.s390x
perl-threads-shared-1.58-1.fc26.s390x
gcc-c++-7.3.1-2.fc26.s390x
ImageMagick-libs-6.9.9.27-1.fc26.s390x
poppler-0.52.0-11.fc26.s390x
perl-Data-Dumper-2.161-4.fc26.s390x
python2-dnf-plugins-extras-common-2.0.5-1.fc26.noarch
gcc-debuginfo-7.3.1-2.fc26.s390x
krb5-libs-1.15.2-7.fc26.s390x
nspr-devel-4.19.0-1.fc26.s390x
nss-softokn-3.36.0-1.0.fc26.s390x
libsss_idmap-1.16.1-1.fc26.s390x
systemtap-runtime-3.2-7.fc26.s390x
gnupg2-2.2.5-1.fc26.s390x
python2-gluster-3.10.11-1.fc26.s390x
sqlite-devel-3.20.1-2.fc26.s390x
git-2.13.6-3.fc26.s390x
libtevent-0.9.36-1.fc26.s390x
elfutils-libs-0.170-4.fc26.s390x
systemtap-3.2-7.fc26.s390x
vim-enhanced-8.0.1553-1.fc26.s390x
gnupg2-smime-2.2.5-1.fc26.s390x
libcurl-devel-7.53.1-16.fc26.s390x
python2-sssdconfig-1.16.1-1.fc26.noarch
patch-2.7.6-3.fc26.s390x
fedora-repos-26-3.noarch
python3-mock-2.0.0-4.fc26.noarch
libgudev-232-1.fc26.s390x
python3-javapackages-4.7.0-17.fc26.noarch
python3-ply-3.9-3.fc26.noarch
python3-systemd-234-1.fc26.s390x
python3-requests-2.13.0-1.fc26.noarch
blktrace-1.1.0-4.fc26.s390x
python2-asn1crypto-0.23.0-1.fc26.noarch
python2-cffi-1.9.1-2.fc26.s390x
python2-sphinx_rtd_theme-0.2.4-1.fc26.noarch
lua-json-1.3.2-7.fc26.noarch
libcephfs1-10.2.7-2.fc26.s390x
glib-networking-2.50.0-2.fc26.s390x
libedit-3.1-17.20160618cvs.fc26.s390x
libverto-libev-0.2.6-7.fc26.s390x
libserf-1.3.9-3.fc26.s390x
python2-kerberos-1.2.5-3.fc26.s390x
libsrtp-1.5.4-4.fc26.s390x
lzo-minilzo-2.08-9.fc26.s390x
librepo-1.8.0-1.fc26.s390x
sg3_utils-1.42-1.fc26.s390x
policycoreutils-2.6-6.fc26.s390x
lvm2-2.02.168-6.fc26.s390x
device-mapper-multipath-libs-0.4.9-88.fc26.s390x
s390utils-cmsfs-1.36.1-3.fc26.s390x
libXdamage-1.1.4-9.fc26.s390x
libXaw-1.0.13-5.fc26.s390x
brltty-5.5-5.fc26.s390x
librsvg2-2.40.18-1.fc26.s390x
texlive-tetex-bin-svn36770.0-33.20160520.fc26.2.noarch
texlive-etex-pkg-svn39355-33.fc26.2.noarch
texlive-graphics-svn41015-33.fc26.2.noarch
texlive-dvips-svn41149-33.fc26.2.noarch
texlive-zapfding-svn31835.0-33.fc26.2.noarch
texlive-footmisc-svn23330.5.5b-33.fc26.2.noarch
texlive-makeindex-svn40768-33.fc26.2.noarch
texlive-pst-ovl-svn40873-33.fc26.2.noarch
texlive-texlive-scripts-svn41433-33.fc26.2.noarch
texlive-ltabptch-svn17533.1.74d-33.fc26.2.noarch
texlive-euro-svn22191.1.1-33.fc26.2.noarch
texlive-mflogo-font-svn36898.1.002-33.fc26.2.noarch
texlive-zapfchan-svn31835.0-33.fc26.2.noarch
texlive-cmextra-svn32831.0-33.fc26.2.noarch
texlive-finstrut-svn21719.0.5-33.fc26.2.noarch
texlive-hyphen-base-svn41138-33.fc26.2.noarch
texlive-marginnote-svn41382-33.fc26.2.noarch
texlive-parallel-svn15878.0-33.fc26.2.noarch
texlive-sepnum-svn20186.2.0-33.fc26.2.noarch
texlive-environ-svn33821.0.3-33.fc26.2.noarch
texlive-type1cm-svn21820.0-33.fc26.2.noarch
texlive-xunicode-svn30466.0.981-33.fc26.2.noarch
texlive-attachfile-svn38830-33.fc26.2.noarch
texlive-fontspec-svn41262-33.fc26.2.noarch
texlive-fancyvrb-svn18492.2.8-33.fc26.2.noarch
texlive-pst-pdf-bin-svn7838.0-33.20160520.fc26.2.noarch
texlive-xcolor-svn41044-33.fc26.2.noarch
texlive-pdfpages-svn40638-33.fc26.2.noarch
texlive-sansmathaccent-svn30187.0-33.fc26.2.noarch
texlive-ucs-svn35853.2.2-33.fc26.2.noarch
texlive-dvipdfmx-bin-svn40273-33.20160520.fc26.2.s390x
libotf-0.9.13-8.fc26.s390x
go-srpm-macros-2-8.fc26.noarch
mesa-libwayland-egl-devel-17.2.4-2.fc26.s390x
ghostscript-9.20-10.fc26.s390x
libcephfs_jni-devel-10.2.7-2.fc26.s390x
libXdamage-devel-1.1.4-9.fc26.s390x
ncurses-devel-6.0-8.20170212.fc26.s390x
fontconfig-devel-2.12.6-4.fc26.s390x
cairo-devel-1.14.10-1.fc26.s390x
libselinux-devel-2.6-7.fc26.s390x
guile-devel-2.0.14-1.fc26.s390x
libcap-ng-devel-0.7.8-3.fc26.s390x
bash-completion-2.6-1.fc26.noarch
libXevie-1.0.3-12.fc26.s390x
python-firewall-0.4.4.5-1.fc26.noarch
python3-html5lib-0.999-13.fc26.noarch
python2-simplejson-3.10.0-3.fc26.s390x
flex-2.6.1-3.fc26.s390x
telnet-0.17-69.fc26.s390x
gpg-pubkey-8e1431d5-53bcbac7
emacs-filesystem-25.3-3.fc26.noarch
fontawesome-fonts-4.7.0-2.fc26.noarch
fontawesome-fonts-web-4.7.0-2.fc26.noarch
rpmconf-base-1.0.19-1.fc26.noarch
info-6.3-3.fc26.s390x
texlive-lib-2016-33.20160520.fc26.1.s390x
libicu-57.1-7.fc26.s390x
libcap-ng-0.7.8-3.fc26.s390x
nettle-3.3-2.fc26.s390x
lcms2-2.8-3.fc26.s390x
dbus-libs-1.11.18-1.fc26.s390x
perl-Exporter-5.72-367.fc26.noarch
unzip-6.0-34.fc26.s390x
iproute-4.11.0-1.fc26.s390x
zip-3.0-18.fc26.s390x
perl-constant-1.33-368.fc26.noarch
perl-MIME-Base64-3.15-366.fc26.s390x
lua-posix-33.3.1-4.fc26.s390x
bzip2-1.0.6-22.fc26.s390x
hyphen-2.8.8-6.fc26.s390x
libdvdread-5.0.3-4.fc26.s390x
libcollection-0.7.0-34.fc26.s390x
libdvdnav-5.0.3-5.fc26.s390x
perl-version-0.99.18-1.fc26.s390x
perl-Encode-2.88-6.fc26.s390x
automake-1.15-9.fc26.noarch
plymouth-core-libs-0.9.3-0.7.20160620git0e65b86c.fc26.s390x
hesiod-3.2.1-7.fc26.s390x
jasper-libs-2.0.14-1.fc26.s390x
mozjs17-17.0.0-18.fc26.s390x
fontconfig-2.12.6-4.fc26.s390x
harfbuzz-1.4.4-1.fc26.s390x
alsa-lib-1.1.4.1-1.fc26.s390x
make-4.2.1-2.fc26.s390x
gobject-introspection-1.52.1-1.fc26.s390x
hicolor-icon-theme-0.15-5.fc26.noarch
gdk-pixbuf2-2.36.9-1.fc26.s390x
libgusb-0.2.11-1.fc26.s390x
libdhash-0.5.0-34.fc26.s390x
python2-bcrypt-3.1.4-2.fc26.s390x
PyYAML-3.12-3.fc26.s390x
openssl-devel-1.1.0g-1.fc26.s390x
copy-jdk-configs-3.3-2.fc26.noarch
python3-setuptools-37.0.0-1.fc26.noarch
kernel-core-4.14.8-200.fc26.s390x
NetworkManager-1.8.2-4.fc26.s390x
libjpeg-turbo-devel-1.5.3-1.fc26.s390x
lua-5.3.4-7.fc26.s390x
kernel-devel-4.14.8-200.fc26.s390x
perl-autodie-2.29-367.fc26.noarch
tzdata-java-2018c-1.fc26.noarch
createrepo_c-0.10.0-15.fc26.s390x
libgfortran-7.3.1-2.fc26.s390x
mariadb-config-10.1.30-2.fc26.s390x
java-1.8.0-openjdk-1.8.0.161-5.b14.fc26.s390x
libtasn1-devel-4.13-1.fc26.s390x
gcc-gdb-plugin-7.3.1-2.fc26.s390x
python2-libxml2-2.9.7-1.fc26.s390x
net-tools-2.0-0.44.20160912git.fc26.s390x
python2-requests-kerberos-0.12.0-1.fc26.noarch
gcc-base-debuginfo-7.3.1-2.fc26.s390x
glusterfs-libs-3.10.11-1.fc26.s390x
system-python-libs-3.6.4-3.fc26.s390x
nss-softokn-freebl-3.36.0-1.0.fc26.s390x
git-core-2.13.6-3.fc26.s390x
libsss_certmap-1.16.1-1.fc26.s390x
nss-softokn-devel-3.36.0-1.0.fc26.s390x
python3-3.6.4-3.fc26.s390x
glusterfs-cli-3.10.11-1.fc26.s390x
perl-5.24.3-396.fc26.s390x
pcre-utf32-8.41-6.fc26.s390x
kernel-headers-4.15.12-201.fc26.s390x
mock-1.4.9-1.fc26.noarch
libXcursor-devel-1.1.15-1.fc26.s390x
python3-sssdconfig-1.16.1-1.fc26.noarch
freetype-devel-2.7.1-10.fc26.s390x
python2-devel-2.7.14-7.fc26.s390x
sssd-nfs-idmap-1.16.1-1.fc26.s390x
libsss_autofs-1.16.1-1.fc26.s390x
libzip-1.3.0-1.fc26.s390x
python3-lxml-4.1.1-1.fc26.s390x
python3-ordered-set-2.0.0-6.fc26.noarch
python3-rpmconf-1.0.19-1.fc26.noarch
python-offtrac-0.1.0-9.fc26.noarch
python2-pycparser-2.14-10.fc26.noarch
python2-sphinx-theme-alabaster-0.7.9-3.fc26.noarch
python2-pysocks-1.6.7-1.fc26.noarch
lua-lpeg-1.0.1-2.fc26.s390x
libproxy-0.4.15-2.fc26.s390x
crontabs-1.11-14.20150630git.fc26.noarch
libev-4.24-2.fc26.s390x
libsigsegv-2.11-1.fc26.s390x
fedora-cert-0.6.0.1-2.fc26.noarch
drpm-0.3.0-6.fc26.s390x
python2-cccolutils-1.5-3.fc26.s390x
m17n-lib-1.7.0-6.fc26.s390x
lsscsi-0.28-4.fc26.s390x
python3-gpg-1.8.0-12.fc26.s390x
sg3_utils-libs-1.42-1.fc26.s390x
SDL2-2.0.7-2.fc26.s390x
util-linux-2.30.2-1.fc26.s390x
s390utils-mon_statd-1.36.1-3.fc26.s390x
GConf2-3.2.6-17.fc26.s390x
systemd-container-233-7.fc26.s390x
libXt-1.1.5-4.fc26.s390x
libXpm-3.5.12-2.fc26.s390x
at-spi2-core-2.24.1-1.fc26.s390x
cairo-1.14.10-1.fc26.s390x
texlive-kpathsea-bin-svn40473-33.20160520.fc26.2.s390x
texlive-ifluatex-svn41346-33.fc26.2.noarch
texlive-babel-svn40706-33.fc26.2.noarch
texlive-colortbl-svn29803.v1.0a-33.fc26.2.noarch
texlive-marvosym-svn29349.2.2a-33.fc26.2.noarch
texlive-euler-svn17261.2.5-33.fc26.2.noarch
texlive-latexconfig-svn40274-33.fc26.2.noarch
texlive-plain-svn40274-33.fc26.2.noarch
texlive-texconfig-bin-svn29741.0-33.20160520.fc26.2.noarch
giflib-4.1.6-16.fc26.s390x
texlive-microtype-svn41127-33.fc26.2.noarch
texlive-eurosym-svn17265.1.4_subrfix-33.fc26.2.noarch
texlive-symbol-svn31835.0-33.fc26.2.noarch
texlive-chngcntr-svn17157.1.0a-33.fc26.2.noarch
texlive-euenc-svn19795.0.1h-33.fc26.2.noarch
texlive-luatex-svn40963-33.fc26.2.noarch
texlive-knuth-local-svn38627-33.fc26.2.noarch
texlive-mparhack-svn15878.1.4-33.fc26.2.noarch
texlive-rcs-svn15878.0-33.fc26.2.noarch
texlive-texlive-msg-translations-svn41431-33.fc26.2.noarch
texlive-updmap-map-svn41159-33.fc26.2.noarch
texlive-geometry-svn19716.5.6-33.fc26.2.noarch
texlive-memoir-svn41203-33.fc26.2.noarch
texlive-l3kernel-svn41246-33.fc26.2.noarch
texlive-pst-eps-svn15878.1.0-33.fc26.2.noarch
texlive-pst-text-svn15878.1.00-33.fc26.2.noarch
texlive-amscls-svn36804.0-33.fc26.2.noarch
texlive-pst-slpe-svn24391.1.31-33.fc26.2.noarch
texlive-extsizes-svn17263.1.4a-33.fc26.2.noarch
texlive-xetex-def-svn40327-33.fc26.2.noarch
texlive-collection-latex-svn41011-33.20160520.fc26.2.noarch
gstreamer1-plugins-base-1.12.3-1.fc26.s390x
fpc-srpm-macros-1.1-2.fc26.noarch
xorg-x11-proto-devel-7.7-22.fc26.noarch
atk-devel-2.24.0-1.fc26.s390x
libxcb-devel-1.12-3.fc26.s390x
libXrandr-devel-1.5.1-2.fc26.s390x
libcom_err-devel-1.43.4-2.fc26.s390x
dbus-devel-1.11.18-1.fc26.s390x
libepoxy-devel-1.4.3-1.fc26.s390x
libicu-devel-57.1-7.fc26.s390x
rpm-build-4.13.0.2-1.fc26.s390x
libssh2-devel-1.8.0-5.fc26.s390x
graphviz-2.40.1-4.fc26.s390x
zlib-static-1.2.11-2.fc26.s390x
mesa-libgbm-devel-17.2.4-2.fc26.s390x
screen-4.6.2-1.fc26.s390x
python-osbs-client-0.39.1-1.fc26.noarch
pyparsing-2.1.10-3.fc26.noarch
python3-pyasn1-0.2.3-1.fc26.noarch
python2-html5lib-0.999-13.fc26.noarch
teamd-1.27-1.fc26.s390x
hardlink-1.3-1.fc26.s390x
chrpath-0.16-4.fc26.s390x
texlive-pdftex-doc-svn41149-33.fc26.2.noarch
grep-3.1-1.fc26.s390x
libacl-2.2.52-15.fc26.s390x
cpio-2.12-4.fc26.s390x
libatomic_ops-7.4.4-2.fc26.s390x
gc-7.6.0-2.fc26.s390x
psmisc-22.21-9.fc26.s390x
systemd-libs-233-7.fc26.s390x
xz-5.2.3-2.fc26.s390x
libpcap-1.8.1-3.fc26.s390x
perl-parent-0.236-2.fc26.noarch
perl-Text-Unidecode-1.30-2.fc26.noarch
newt-0.52.20-1.fc26.s390x
libcomps-0.1.8-3.fc26.s390x
libfontenc-1.1.3-4.fc26.s390x
ipcalc-0.2.0-1.fc26.s390x
libnfnetlink-1.0.1-9.fc26.s390x
libref_array-0.1.5-34.fc26.s390x
perl-Term-Cap-1.17-366.fc26.noarch
perl-Digest-1.17-367.fc26.noarch
perl-Pod-Simple-3.35-2.fc26.noarch
perl-URI-1.71-6.fc26.noarch
attr-2.4.47-18.fc26.s390x
gmp-c++-6.1.2-4.fc26.s390x
harfbuzz-icu-1.4.4-1.fc26.s390x
http-parser-2.7.1-5.fc26.s390x
libsodium-1.0.14-1.fc26.s390x
python-gssapi-1.2.0-5.fc26.s390x
perl-libnet-3.11-1.fc26.noarch
libwayland-client-1.13.0-3.fc26.s390x
python3-dnf-2.7.5-2.fc26.noarch
kernel-modules-4.14.8-200.fc26.s390x
NetworkManager-ppp-1.8.2-4.fc26.s390x
wayland-devel-1.13.0-3.fc26.s390x
kernel-4.14.8-200.fc26.s390x
NetworkManager-glib-1.8.2-4.fc26.s390x
perl-IPC-System-Simple-1.25-12.fc26.noarch
sed-4.4-2.fc26.s390x
libassuan-2.5.1-1.fc26.s390x
createrepo_c-libs-0.10.0-15.fc26.s390x
dnf-utils-2.1.5-4.fc26.noarch
libobjc-7.3.1-2.fc26.s390x
dracut-046-8.git20180105.fc26.s390x
libseccomp-2.3.3-1.fc26.s390x
python-sphinx-locale-1.5.6-1.fc26.noarch
libxml2-devel-2.9.7-1.fc26.s390x
libseccomp-devel-2.3.3-1.fc26.s390x
fedora-upgrade-28.1-1.fc26.noarch
gcc-gfortran-7.3.1-2.fc26.s390x
gdb-8.0.1-36.fc26.s390x
unbound-libs-1.6.8-1.fc26.s390x
man-db-2.7.6.1-9.fc26.s390x
python2-rpm-macros-3-21.fc26.noarch
kernel-devel-4.15.4-200.fc26.s390x
sqlite-libs-3.20.1-2.fc26.s390x
python2-2.7.14-7.fc26.s390x
libkadm5-1.15.2-7.fc26.s390x
libcurl-7.53.1-16.fc26.s390x
net-snmp-agent-libs-5.7.3-27.fc26.s390x
p11-kit-trust-0.23.10-1.fc26.s390x
python3-koji-1.15.0-4.fc26.noarch
glusterfs-server-3.10.11-1.fc26.s390x
kernel-devel-4.15.12-201.fc26.s390x
pcre-utf16-8.41-6.fc26.s390x
jansson-2.11-1.fc26.s390x
python2-rpkg-1.52-1.fc26.noarch
pcre-static-8.41-6.fc26.s390x
systemtap-sdt-devel-3.2-7.fc26.s390x
libXfont-1.5.4-1.fc26.s390x
system-python-3.6.4-3.fc26.s390x
shared-mime-info-1.8-3.fc26.s390x
libpaper-1.1.24-21.fc26.s390x
python3-pbr-1.10.0-4.fc26.noarch
libcroco-0.6.12-1.fc26.s390x
libssh2-1.8.0-5.fc26.s390x
json-glib-1.2.6-1.fc26.s390x
libevent-2.0.22-3.fc26.s390x
gdk-pixbuf2-modules-2.36.9-1.fc26.s390x
colord-libs-1.3.5-1.fc26.s390x
python3-magic-5.30-11.fc26.noarch
python3-gobject-base-3.24.1-1.fc26.s390x
python3-pyroute2-0.4.13-1.fc26.noarch
python3-pysocks-1.6.7-1.fc26.noarch
python2-click-6.7-3.fc26.noarch
python-munch-2.1.0-2.fc26.noarch
python2-ply-3.9-3.fc26.noarch
python2-snowballstemmer-1.2.1-3.fc26.noarch
python-magic-5.30-11.fc26.noarch
python-beautifulsoup4-4.6.0-1.fc26.noarch
python2-gitdb-2.0.3-1.fc26.noarch
librados-devel-10.2.7-2.fc26.s390x
libcacard-2.5.3-1.fc26.s390x
libmodman-2.0.1-13.fc26.s390x
zziplib-0.13.62-8.fc26.s390x
lksctp-tools-1.0.16-6.fc26.s390x
procmail-3.22-44.fc26.s390x
libthai-0.1.25-2.fc26.s390x
libpipeline-1.4.1-3.fc26.s390x
python2-pycurl-7.43.0-8.fc26.s390x
deltarpm-3.6-19.fc26.s390x
subversion-libs-1.9.7-1.fc26.s390x
python-krbV-1.0.90-13.fc26.s390x
m17n-db-1.7.0-8.fc26.noarch
linux-atm-libs-2.5.1-17.fc26.s390x
python2-rpm-4.13.0.2-1.fc26.s390x
python2-librepo-1.8.0-1.fc26.s390x
qrencode-libs-3.4.4-1.fc26.s390x
s390utils-iucvterm-1.36.1-3.fc26.s390x
libsmartcols-2.30.2-1.fc26.s390x
dbus-1.11.18-1.fc26.s390x
systemd-udev-233-7.fc26.s390x
device-mapper-event-1.02.137-6.fc26.s390x
polkit-0.113-8.fc26.s390x
libwmf-lite-0.2.8.4-53.fc26.s390x
libXcomposite-0.4.4-9.fc26.s390x
at-spi2-atk-2.24.1-1.fc26.s390x
pango-1.40.12-1.fc26.s390x
texlive-metafont-bin-svn40987-33.20160520.fc26.2.s390x
texlive-url-svn32528.3.4-33.fc26.2.noarch
texlive-fp-svn15878.0-33.fc26.2.noarch
texlive-latex-fonts-svn28888.0-33.fc26.2.noarch
texlive-mptopdf-bin-svn18674.0-33.20160520.fc26.2.noarch
texlive-fancybox-svn18304.1.4-33.fc26.2.noarch
texlive-lua-alt-getopt-svn29349.0.7.0-33.fc26.2.noarch
texlive-tex-bin-svn40987-33.20160520.fc26.2.s390x
texlive-texconfig-svn40768-33.fc26.2.noarch
texlive-wasy2-ps-svn35830.0-33.fc26.2.noarch
texlive-psfrag-svn15878.3.04-33.fc26.2.noarch
texlive-helvetic-svn31835.0-33.fc26.2.noarch
texlive-times-svn35058.0-33.fc26.2.noarch
texlive-cite-svn36428.5.5-33.fc26.2.noarch
texlive-fancyhdr-svn15878.3.1-33.fc26.2.noarch
texlive-luatex-bin-svn41091-33.20160520.fc26.2.s390x
texlive-lm-math-svn36915.1.959-33.fc26.2.noarch
texlive-ntgclass-svn15878.2.1a-33.fc26.2.noarch
texlive-sansmath-svn17997.1.1-33.fc26.2.noarch
texlive-textcase-svn15878.0-33.fc26.2.noarch
texlive-unicode-data-svn39808-33.fc26.2.noarch
texlive-breakurl-svn29901.1.40-33.fc26.2.noarch
texlive-latex-svn40218-33.fc26.2.noarch
texlive-lualatex-math-svn40621-33.fc26.2.noarch
texlive-pst-coil-svn37377.1.07-33.fc26.2.noarch
texlive-pst-plot-svn41242-33.fc26.2.noarch
texlive-unicode-math-svn38462-33.fc26.2.noarch
texlive-pst-blur-svn15878.2.0-33.fc26.2.noarch
texlive-cm-super-svn15878.0-33.fc26.2.noarch
texlive-wasysym-svn15878.2.0-33.fc26.2.noarch
texlive-collection-fontsrecommended-svn35830.0-33.20160520.fc26.2.noarch
libXv-1.0.11-2.fc26.s390x
ghc-srpm-macros-1.4.2-5.fc26.noarch
latex2html-2017.2-2.fc26.noarch
libXau-devel-1.0.8-7.fc26.s390x
graphite2-devel-1.3.10-1.fc26.s390x
pixman-devel-0.34.0-3.fc26.s390x
wayland-protocols-devel-1.9-1.fc26.noarch
mesa-libGLES-devel-17.2.4-2.fc26.s390x
vte291-devel-0.48.4-1.fc26.s390x
ceph-devel-compat-10.2.7-2.fc26.s390x
lzo-devel-2.08-9.fc26.s390x
libiscsi-devel-1.15.0-3.fc26.s390x
avahi-autoipd-0.6.32-7.fc26.s390x
rpm-plugin-systemd-inhibit-4.13.0.2-1.fc26.s390x
python2-ndg_httpsclient-0.4.0-7.fc26.noarch
gettext-0.19.8.1-9.fc26.s390x
btrfs-progs-4.9.1-2.fc26.s390x
fedora-logos-26.0.1-1.fc26.s390x
dejagnu-1.6-2.fc26.noarch
libaio-devel-0.3.110-7.fc26.s390x
dos2unix-7.3.4-2.fc26.s390x
popt-1.16-12.fc26.s390x
tar-1.29-5.fc26.s390x
avahi-libs-0.6.32-7.fc26.s390x
m4-1.4.18-3.fc26.s390x
perl-Time-Local-1.250-2.fc26.noarch
libmetalink-0.1.3-2.fc26.s390x
jbigkit-libs-2.1-6.fc26.s390x
netpbm-10.80.00-2.fc26.s390x
perl-Digest-MD5-2.55-3.fc26.s390x
perl-Getopt-Long-2.49.1-2.fc26.noarch
libglvnd-opengl-1.0.0-1.fc26.s390x
libattr-devel-2.4.47-18.fc26.s390x
teckit-2.5.1-16.fc26.s390x
python3-six-1.10.0-9.fc26.noarch
python3-libcomps-0.1.8-3.fc26.s390x
python3-pyparsing-2.1.10-3.fc26.noarch
python2-markupsafe-0.23-13.fc26.s390x
python2-mock-2.0.0-4.fc26.noarch
python2-yubico-1.3.2-7.fc26.noarch
python2-smmap-2.0.3-1.fc26.noarch
librbd-devel-10.2.7-2.fc26.s390x
libnghttp2-1.21.1-1.fc26.s390x
ykpers-1.18.0-2.fc26.s390x
python3-librepo-1.8.0-1.fc26.s390x
geoclue2-2.4.5-4.fc26.s390x
initscripts-9.72-1.fc26.s390x
plymouth-0.9.3-0.7.20160620git0e65b86c.fc26.s390x
ebtables-2.0.10-22.fc26.s390x
gssproxy-0.7.0-9.fc26.s390x
libXext-1.3.3-5.fc26.s390x
mesa-libEGL-17.2.4-2.fc26.s390x
texlive-texlive.infra-bin-svn40312-33.20160520.fc26.2.s390x
texlive-thumbpdf-svn34621.3.16-33.fc26.2.noarch
texlive-carlisle-svn18258.0-33.fc26.2.noarch
texlive-gsftopk-svn40768-33.fc26.2.noarch
texlive-pdftex-svn41149-33.fc26.2.noarch
texlive-crop-svn15878.1.5-33.fc26.2.noarch
texlive-pxfonts-svn15878.0-33.fc26.2.noarch
texlive-enctex-svn34957.0-33.fc26.2.noarch
texlive-kastrup-svn15878.0-33.fc26.2.noarch
texlive-pspicture-svn15878.0-33.fc26.2.noarch
texlive-varwidth-svn24104.0.92-33.fc26.2.noarch
texlive-currfile-svn40725-33.fc26.2.noarch
texlive-pst-grad-svn15878.1.06-33.fc26.2.noarch
texlive-latex-bin-svn41438-33.fc26.2.noarch
texlive-ltxmisc-svn21927.0-33.fc26.2.noarch
lasi-1.1.2-7.fc26.s390x
adwaita-icon-theme-3.24.0-2.fc26.noarch
xz-devel-5.2.3-2.fc26.s390x
xorg-x11-fonts-Type1-7.5-17.fc26.noarch
libXi-devel-1.7.9-2.fc26.s390x
at-spi2-atk-devel-2.24.1-1.fc26.s390x
pango-devel-1.40.12-1.fc26.s390x
libcacard-devel-2.5.3-1.fc26.s390x
subversion-1.9.7-1.fc26.s390x
sudo-1.8.21p2-1.fc26.s390x
pykickstart-2.35-2.fc26.noarch
e2fsprogs-1.43.4-2.fc26.s390x
libbsd-0.8.3-3.fc26.s390x
c-ares-1.13.0-1.fc26.s390x
python2-pyxdg-0.25-12.fc26.noarch
valgrind-3.13.0-12.fc26.s390x
libwayland-server-1.13.0-3.fc26.s390x
dhcp-client-4.3.5-10.fc26.s390x
man-pages-4.09-4.fc26.noarch
libffi-devel-3.1-12.fc26.s390x
libxml2-2.9.7-1.fc26.s390x
kmod-25-1.fc26.s390x
dnf-plugins-core-2.1.5-4.fc26.noarch
kmod-libs-25-1.fc26.s390x
pigz-2.4-1.fc26.s390x
pkgconf-pkg-config-1.3.12-2.fc26.s390x
gcc-go-7.3.1-2.fc26.s390x
python-rpm-macros-3-21.fc26.noarch
perl-libs-5.24.3-396.fc26.s390x
glusterfs-api-3.10.11-1.fc26.s390x
git-core-doc-2.13.6-3.fc26.s390x
pcre-cpp-8.41-6.fc26.s390x
usermode-1.112-1.fc26.s390x
distribution-gpg-keys-1.19-1.fc26.noarch
perl-Test-Harness-3.41-1.fc26.noarch
krb5-devel-1.15.2-7.fc26.s390x
libvorbis-1.3.6-1.fc26.s390x
python2-configargparse-0.12.0-1.fc26.noarch
gpg-pubkey-a29cb19c-53bcbba6
quota-nls-4.03-9.fc26.noarch
xz-libs-5.2.3-2.fc26.s390x
gmp-6.1.2-4.fc26.s390x
file-5.30-11.fc26.s390x
libusbx-1.0.21-2.fc26.s390x
binutils-2.27-28.fc26.s390x
perl-HTTP-Tiny-0.070-2.fc26.noarch
xml-common-0.6.3-45.fc26.noarch
opus-1.2.1-1.fc26.s390x
flac-libs-1.3.2-2.fc26.s390x
libacl-devel-2.2.52-15.fc26.s390x
coreutils-common-8.27-7.fc26.s390x
cracklib-2.9.6-5.fc26.s390x
pyliblzma-0.5.3-17.fc26.s390x
libnotify-0.7.7-2.fc26.s390x
python3-idna-2.5-1.fc26.noarch
python3-pyOpenSSL-16.2.0-6.fc26.noarch
python2-pbr-1.10.0-4.fc26.noarch
pyusb-1.0.0-4.fc26.noarch
librbd1-10.2.7-2.fc26.s390x
libnfs-1.9.8-3.fc26.s390x
libsolv-0.6.30-2.fc26.s390x
python3-pycurl-7.43.0-8.fc26.s390x
libyubikey-1.13-3.fc26.s390x
rpmlint-1.10-5.fc26.noarch
python2-pygpgme-0.3-22.fc26.s390x
s390utils-base-1.36.1-3.fc26.s390x
ppp-2.4.7-11.fc26.s390x
s390utils-cpuplugd-1.36.1-3.fc26.s390x
libXrender-0.9.10-2.fc26.s390x
libglvnd-gles-1.0.0-1.fc26.s390x
texlive-texlive.infra-svn41280-33.fc26.2.noarch
texlive-lm-svn28119.2.004-33.fc26.2.noarch
texlive-babelbib-svn25245.1.31-33.fc26.2.noarch
texlive-index-svn24099.4.1beta-33.fc26.2.noarch
texlive-pdftex-bin-svn40987-33.20160520.fc26.2.s390x
texlive-csquotes-svn39538-33.fc26.2.noarch
texlive-rsfs-svn15878.0-33.fc26.2.noarch
texlive-etex-svn37057.0-33.fc26.2.noarch
texlive-knuth-lib-svn35820.0-33.fc26.2.noarch
texlive-pst-math-svn34786.0.63-33.fc26.2.noarch
texlive-utopia-svn15878.0-33.fc26.2.noarch
texlive-eso-pic-svn37925.2.0g-33.fc26.2.noarch
texlive-pst-fill-svn15878.1.01-33.fc26.2.noarch
texlive-latex-bin-bin-svn14050.0-33.20160520.fc26.2.noarch
texlive-jknapltx-svn19440.0-33.fc26.2.noarch
texlive-collection-latexrecommended-svn35765.0-33.20160520.fc26.2.noarch
adwaita-cursor-theme-3.24.0-2.fc26.noarch
xorg-x11-fonts-ISO8859-1-100dpi-7.5-17.fc26.noarch
libXcomposite-devel-0.4.4-9.fc26.s390x
at-spi2-core-devel-2.24.1-1.fc26.s390x
harfbuzz-devel-1.4.4-1.fc26.s390x
rpmdevtools-8.10-2.fc26.noarch
texi2html-5.0-5.fc26.noarch
libnfs-devel-1.9.8-3.fc26.s390x
firewalld-0.4.4.5-1.fc26.noarch
wpa_supplicant-2.6-12.fc26.s390x
newt-python-0.52.20-1.fc26.s390x
perl-Mozilla-CA-20160104-4.fc26.noarch
pth-2.0.7-28.fc26.s390x
python3-pyxdg-0.25-12.fc26.noarch
timedatex-0.4-3.fc26.s390x
libjpeg-turbo-1.5.3-1.fc26.s390x
dnf-yum-2.7.5-2.fc26.noarch
libuv-devel-1.11.0-1.fc26.s390x
libstdc++-7.3.1-2.fc26.s390x
libgo-7.3.1-2.fc26.s390x
python3-dnf-plugins-core-2.1.5-4.fc26.noarch
gtk3-3.22.21-3.fc26.s390x
perl-threads-2.21-1.fc26.s390x
pkgconf-m4-1.3.12-2.fc26.noarch
gtk3-devel-3.22.21-3.fc26.s390x
gcc-objc-7.3.1-2.fc26.s390x
nss-util-3.36.0-1.0.fc26.s390x
python2-koji-1.15.0-4.fc26.noarch
kernel-modules-4.15.12-201.fc26.s390x
elfutils-libelf-devel-0.170-4.fc26.s390x
selinux-policy-3.13.1-260.20.fc26.noarch
mock-core-configs-28.3-1.fc26.noarch
glusterfs-api-devel-3.10.11-1.fc26.s390x
krb5-workstation-1.15.2-7.fc26.s390x
libsss_sudo-1.16.1-1.fc26.s390x
mailcap-2.1.48-1.fc26.noarch
python-async-0.6.1-9.fc22.s390x
poppler-data-0.4.7-7.fc26.noarch
ocaml-srpm-macros-4-2.fc26.noarch
libuuid-2.30.2-1.fc26.s390x
libgpg-error-1.25-2.fc26.s390x
graphite2-1.3.10-1.fc26.s390x
perl-Text-Tabs+Wrap-2013.0523-366.fc26.noarch
perl-Error-0.17024-8.fc26.noarch
which-2.21-2.fc26.s390x
libXau-1.0.8-7.fc26.s390x
orc-0.4.27-1.fc26.s390x
perl-Pod-Perldoc-3.28-1.fc26.noarch
libsndfile-1.0.28-6.fc26.s390x
gzip-1.8-2.fc26.s390x
python-ipaddress-1.0.16-4.fc26.noarch
yum-metadata-parser-1.1.4-18.fc26.s390x
python3-dbus-1.2.4-6.fc26.s390x
python3-cryptography-2.0.2-2.fc26.s390x
python3-kickstart-2.35-2.fc26.noarch
python2-imagesize-0.7.1-5.fc26.noarch
python2-jinja2-2.9.6-1.fc26.noarch
libradosstriper-devel-10.2.7-2.fc26.s390x
soundtouch-1.9.2-4.fc26.s390x
libndp-1.6-2.fc26.s390x
rpm-4.13.0.2-1.fc26.s390x
rest-0.8.0-2.fc26.s390x
libvisual-0.4.0-21.fc26.s390x
python2-hawkey-0.11.1-1.fc26.s390x
fakeroot-libs-1.22-1.fc26.s390x
device-mapper-event-libs-1.02.137-6.fc26.s390x
cyrus-sasl-2.1.26-32.fc26.s390x
cronie-anacron-1.5.1-5.fc26.s390x
libpath_utils-0.2.1-34.fc26.s390x
libX11-common-1.6.5-2.fc26.noarch
libXft-2.3.2-5.fc26.s390x
gtk2-2.24.31-4.fc26.s390x
texlive-etoolbox-svn38031.2.2a-33.fc26.2.noarch
texlive-multido-svn18302.1.42-33.fc26.2.noarch
texlive-glyphlist-svn28576.0-33.fc26.2.noarch
texlive-setspace-svn24881.6.7a-33.fc26.2.noarch
texlive-mathtools-svn38833-33.fc26.2.noarch
texlive-ncntrsbk-svn31835.0-33.fc26.2.noarch
texlive-dvisvgm-def-svn41011-33.fc26.2.noarch
texlive-ifetex-svn24853.1.2-33.fc26.2.noarch
texlive-parskip-svn19963.2.0-33.fc26.2.noarch
texlive-bera-svn20031.0-33.fc26.2.noarch
texlive-pgf-svn40966-33.fc26.2.noarch
texlive-auto-pst-pdf-svn23723.0.6-33.fc26.2.noarch
texlive-ctable-svn38672-33.fc26.2.noarch
texlive-typehtml-svn17134.0-33.fc26.2.noarch
mesa-libGLES-17.2.4-2.fc26.s390x
vte291-0.48.4-1.fc26.s390x
libcephfs_jni1-10.2.7-2.fc26.s390x
bzip2-devel-1.0.6-22.fc26.s390x
expat-devel-2.2.4-1.fc26.s390x
libsepol-devel-2.6-2.fc26.s390x
glib2-static-2.52.3-2.fc26.s390x
virglrenderer-devel-0.6.0-1.20170210git76b3da97b.fc26.s390x
parted-3.2-24.fc26.s390x
python3-beautifulsoup4-4.6.0-1.fc26.noarch
python-bunch-1.0.1-10.fc26.noarch
lz4-1.8.0-1.fc26.s390x
openssh-clients-7.5p1-4.fc26.s390x
chrony-3.2-1.fc26.s390x
dnf-conf-2.7.5-2.fc26.noarch
bodhi-client-2.12.2-3.fc26.noarch
libuv-1.11.0-1.fc26.s390x
glibc-2.25-13.fc26.s390x
libgomp-7.3.1-2.fc26.s390x
cmake-rpm-macros-3.10.1-11.fc26.noarch
gtk-update-icon-cache-3.22.21-3.fc26.s390x
pcre2-utf32-10.23-13.fc26.s390x
kernel-modules-4.15.4-200.fc26.s390x
webkitgtk4-2.18.6-1.fc26.s390x
libstdc++-static-7.3.1-2.fc26.s390x
rsync-3.1.3-2.fc26.s390x
nspr-4.19.0-1.fc26.s390x
nss-util-devel-3.36.0-1.0.fc26.s390x
kernel-core-4.15.12-201.fc26.s390x
glusterfs-extra-xlators-3.10.11-1.fc26.s390x
vim-filesystem-8.0.1553-1.fc26.noarch
systemtap-client-3.2-7.fc26.s390x
net-snmp-5.7.3-27.fc26.s390x
mailx-12.5-25.fc26.s390x
mpfr-3.1.6-1.fc26.s390x
libzip-devel-1.3.0-1.fc26.s390x
hawkey-0.6.4-3.fc25.s390x
perl-srpm-macros-1-21.fc26.noarch
expat-2.2.4-1.fc26.s390x
chkconfig-1.10-1.fc26.s390x
findutils-4.6.0-12.fc26.s390x
mesa-libwayland-egl-17.2.4-2.fc26.s390x
procps-ng-3.3.10-13.fc26.s390x
mesa-libglapi-17.2.4-2.fc26.s390x
perl-Unicode-Normalize-1.25-366.fc26.s390x
perl-IO-Socket-IP-0.39-1.fc26.noarch
hunspell-en-US-0.20140811.1-6.fc26.noarch
libxcb-1.12-3.fc26.s390x
perl-Pod-Escapes-1.07-366.fc26.noarch
perl-Pod-Usage-1.69-2.fc26.noarch
libtheora-1.1.1-15.fc26.s390x
tcp_wrappers-7.6-85.fc26.s390x
coreutils-8.27-7.fc26.s390x
libmount-2.30.2-1.fc26.s390x
python2-iniparse-0.4-24.fc26.noarch
python2-decorator-4.0.11-2.fc26.noarch
ModemManager-glib-1.6.10-1.fc26.s390x
python3-decorator-4.0.11-2.fc26.noarch
python3-cffi-1.9.1-2.fc26.s390x
python-bugzilla-cli-2.1.0-1.fc26.noarch
python2-funcsigs-1.0.2-5.fc26.noarch
python2-babel-2.3.4-5.fc26.noarch
python-bugzilla-2.1.0-1.fc26.noarch
libradosstriper1-10.2.7-2.fc26.s390x
snappy-1.1.4-3.fc26.s390x
libmpcdec-1.2.6-17.fc26.s390x
rpm-libs-4.13.0.2-1.fc26.s390x
python-urlgrabber-3.10.1-11.fc26.noarch
sysfsutils-2.1.0-20.fc26.s390x
python3-hawkey-0.11.1-1.fc26.s390x
iputils-20161105-5.fc26.s390x
plymouth-scripts-0.9.3-0.7.20160620git0e65b86c.fc26.s390x
cronie-1.5.1-5.fc26.s390x
libini_config-1.3.1-34.fc26.s390x
libX11-1.6.5-2.fc26.s390x
libglvnd-egl-1.0.0-1.fc26.s390x
texlive-kpathsea-svn41139-33.fc26.2.noarch
texlive-thumbpdf-bin-svn6898.0-33.20160520.fc26.2.noarch
texlive-subfig-svn15878.1.3-33.fc26.2.noarch
texlive-gsftopk-bin-svn40473-33.20160520.fc26.2.s390x
texlive-tex-ini-files-svn40533-33.fc26.2.noarch
texlive-qstest-svn15878.0-33.fc26.2.noarch
texlive-palatino-svn31835.0-33.fc26.2.noarch
texlive-ec-svn25033.1.0-33.fc26.2.noarch
texlive-iftex-svn29654.0.2-33.fc26.2.noarch
texlive-pslatex-svn16416.0-33.fc26.2.noarch
texlive-algorithms-svn38085.0.1-33.fc26.2.noarch
texlive-filehook-svn24280.0.5d-33.fc26.2.noarch
texlive-pst-node-svn40743-33.fc26.2.noarch
texlive-rotating-svn16832.2.16b-33.fc26.2.noarch
texlive-seminar-svn34011.1.62-33.fc26.2.noarch
libuuid-devel-2.30.2-1.fc26.s390x
libXinerama-devel-1.1.3-7.fc26.s390x
emacs-common-25.3-3.fc26.s390x
fedora-packager-0.6.0.1-2.fc26.noarch
snappy-devel-1.1.4-3.fc26.s390x
authconfig-7.0.1-2.fc26.s390x
newt-python3-0.52.20-1.fc26.s390x
python-decoratortools-1.8-13.fc26.noarch
python-systemd-doc-234-1.fc26.s390x
openssl-libs-1.1.0g-1.fc26.s390x
lsof-4.89-5.fc26.s390x
glibc-all-langpacks-2.25-13.fc26.s390x
audit-libs-2.8.2-1.fc26.s390x
gcc-7.3.1-2.fc26.s390x
pcre2-utf16-10.23-13.fc26.s390x
kernel-core-4.15.4-200.fc26.s390x
dracut-config-rescue-046-8.git20180105.fc26.s390x
webkitgtk4-plugin-process-gtk2-2.18.6-1.fc26.s390x
perl-Time-HiRes-1.9753-1.fc26.s390x
haveged-1.9.1-6.fc26.s390x
p11-kit-0.23.10-1.fc26.s390x
boost-system-1.63.0-11.fc26.s390x
glusterfs-fuse-3.10.11-1.fc26.s390x
vim-common-8.0.1553-1.fc26.s390x
systemtap-devel-3.2-7.fc26.s390x
perl-SelfLoader-1.23-396.fc26.noarch
nss-tools-3.36.0-1.0.fc26.s390x
libwebp-0.6.1-8.fc26.s390x
python3-configargparse-0.12.0-1.fc26.noarch
gpg-pubkey-a0a7badb-52844296
gpg-pubkey-e372e838-56fd7943
gpg-pubkey-3b921d09-57a87096
google-roboto-slab-fonts-1.100263-0.5.20150923git.fc26.noarch
libreport-filesystem-2.9.1-3.fc26.s390x
libcom_err-1.43.4-2.fc26.s390x
libffi-3.1-12.fc26.s390x
keyutils-libs-1.5.10-1.fc26.s390x
diffutils-3.5-3.fc26.s390x
apr-util-1.5.4-6.fc26.s390x
bluez-libs-5.46-6.fc26.s390x
libksba-1.3.5-3.fc26.s390x
ncurses-6.0-8.20170212.fc26.s390x
libteam-1.27-1.fc26.s390x
perl-Fedora-VSP-0.001-5.fc26.noarch
libusb-0.1.5-8.fc26.s390x
acl-2.2.52-15.fc26.s390x
dwz-0.12-3.fc26.s390x
libblkid-2.30.2-1.fc26.s390x
polkit-libs-0.113-8.fc26.s390x
dbus-python-1.2.4-6.fc26.s390x
gts-0.7.6-30.20121130.fc26.s390x
libfdisk-2.30.2-1.fc26.s390x
python3-pycparser-2.14-10.fc26.noarch
python3-bugzilla-2.1.0-1.fc26.noarch
python2-docutils-0.13.1-4.fc26.noarch
python2-requests-2.13.0-1.fc26.noarch
libcephfs-devel-10.2.7-2.fc26.s390x
ncurses-c++-libs-6.0-8.20170212.fc26.s390x
GeoIP-1.6.11-1.fc26.s390x
liblockfile-1.09-5.fc26.s390x
rpm-plugin-selinux-4.13.0.2-1.fc26.s390x
libsysfs-2.1.0-20.fc26.s390x
libdnf-0.11.1-1.fc26.s390x
mesa-libgbm-17.2.4-2.fc26.s390x
lvm2-libs-2.02.168-6.fc26.s390x
libXfixes-5.0.3-2.fc26.s390x
brlapi-0.6.6-5.fc26.s390x
texlive-metafont-svn40793-33.fc26.2.noarch
texlive-graphics-cfg-svn40269-33.fc26.2.noarch
texlive-mptopdf-svn41282-33.fc26.2.noarch
texlive-makeindex-bin-svn40473-33.20160520.fc26.2.s390x
texlive-texlive-scripts-bin-svn29741.0-33.20160520.fc26.2.noarch
texlive-sauerj-svn15878.0-33.fc26.2.noarch
texlive-txfonts-svn15878.0-33.fc26.2.noarch
texlive-filecontents-svn24250.1.3-33.fc26.2.noarch
texlive-lualibs-svn40370-33.fc26.2.noarch
texlive-section-svn20180.0-33.fc26.2.noarch
texlive-ucharcat-svn38907-33.fc26.2.noarch
texlive-hyperref-svn41396-33.fc26.2.noarch
texlive-pst-3d-svn17257.1.10-33.fc26.2.noarch
texlive-oberdiek-svn41346-33.fc26.2.noarch
texlive-ae-svn15878.1.4-33.fc26.2.noarch
texlive-collection-basic-svn41149-33.20160520.fc26.2.noarch
gnat-srpm-macros-4-2.fc26.noarch
glib2-devel-2.52.3-2.fc26.s390x
netpbm-progs-10.80.00-2.fc26.s390x
libXxf86vm-devel-1.1.4-4.fc26.s390x
nettle-devel-3.3-2.fc26.s390x
cairo-gobject-devel-1.14.10-1.fc26.s390x
fedora-rpm-macros-26-2.fc26.noarch
libidn-devel-1.33-2.fc26.s390x
s390utils-1.36.1-3.fc26.s390x
libtool-2.4.6-17.fc26.s390x
python3-cssselect-0.9.2-4.fc26.noarch
python2-cssselect-0.9.2-4.fc26.noarch
bison-3.0.4-6.fc26.s390x
rootfiles-8.1-20.fc26.noarch
python3-urllib3-1.20-2.fc26.noarch
libgcc-7.3.1-2.fc26.s390x
python3-distro-1.2.0-1.fc26.noarch
libnfsidmap-2.2.1-4.rc2.fc26.s390x
kernel-4.15.4-200.fc26.s390x
glibc-static-2.25-13.fc26.s390x
xapian-core-libs-1.4.5-1.fc26.s390x
elfutils-libelf-0.170-4.fc26.s390x
nss-3.36.0-1.0.fc26.s390x
nss-softokn-freebl-devel-3.36.0-1.0.fc26.s390x
koji-1.15.0-4.fc26.noarch
perl-Git-2.13.6-3.fc26.noarch
elfutils-default-yama-scope-0.170-4.fc26.noarch
selinux-policy-targeted-3.13.1-260.20.fc26.noarch
curl-7.53.1-16.fc26.s390x
publicsuffix-list-dafsa-20180223-1.fc26.noarch
python3-funcsigs-1.0.2-5.fc26.noarch
=== TEST BEGIN ===
Using CC: /home/fam/bin/cc
Install prefix    /var/tmp/patchew-tester-tmp-u8athipi/src/install
BIOS directory    /var/tmp/patchew-tester-tmp-u8athipi/src/install/share/qemu
firmware path     /var/tmp/patchew-tester-tmp-u8athipi/src/install/share/qemu-firmware
binary directory  /var/tmp/patchew-tester-tmp-u8athipi/src/install/bin
library directory /var/tmp/patchew-tester-tmp-u8athipi/src/install/lib
module directory  /var/tmp/patchew-tester-tmp-u8athipi/src/install/lib/qemu
libexec directory /var/tmp/patchew-tester-tmp-u8athipi/src/install/libexec
include directory /var/tmp/patchew-tester-tmp-u8athipi/src/install/include
config directory  /var/tmp/patchew-tester-tmp-u8athipi/src/install/etc
local state directory   /var/tmp/patchew-tester-tmp-u8athipi/src/install/var
Manual directory  /var/tmp/patchew-tester-tmp-u8athipi/src/install/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path       /var/tmp/patchew-tester-tmp-u8athipi/src
GIT binary        git
GIT submodules    ui/keycodemapdb capstone
C compiler        /home/fam/bin/cc
Host C compiler   cc
C++ compiler      c++
Objective-C compiler /home/fam/bin/cc
ARFLAGS           rv
CFLAGS            -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g 
QEMU_CFLAGS       -I/usr/include/pixman-1   -Werror -DHAS_LIBSSH2_SFTP_FSYNC -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv  -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/include/p11-kit-1     -I/usr/include/libpng16  -I/usr/include/libdrm  -I$(SRC_PATH)/capstone/include
LDFLAGS           -Wl,--warn-common -m64 -g 
QEMU_LDFLAGS       
make              make
install           install
python            python -B
smbd              /usr/sbin/smbd
module support    no
host CPU          s390x
host big endian   yes
target list       aarch64-softmmu alpha-softmmu arm-softmmu cris-softmmu hppa-softmmu i386-softmmu lm32-softmmu m68k-softmmu microblazeel-softmmu microblaze-softmmu mips64el-softmmu mips64-softmmu mipsel-softmmu mips-softmmu moxie-softmmu nios2-softmmu or1k-softmmu ppc64-softmmu ppcemb-softmmu ppc-softmmu riscv32-softmmu riscv64-softmmu s390x-softmmu sh4eb-softmmu sh4-softmmu sparc64-softmmu sparc-softmmu tricore-softmmu unicore32-softmmu x86_64-softmmu xtensaeb-softmmu xtensa-softmmu aarch64_be-linux-user aarch64-linux-user alpha-linux-user armeb-linux-user arm-linux-user cris-linux-user hppa-linux-user i386-linux-user m68k-linux-user microblazeel-linux-user microblaze-linux-user mips64el-linux-user mips64-linux-user mipsel-linux-user mips-linux-user mipsn32el-linux-user mipsn32-linux-user nios2-linux-user or1k-linux-user ppc64abi32-linux-user ppc64le-linux-user ppc64-linux-user ppc-linux-user riscv32-linux-user riscv64-linux-user s390x-linux-user sh4eb-linux-user sh4-linux-user sparc32plus-linux-user sparc64-linux-user sparc-linux-user tilegx-linux-user x86_64-linux-user xtensaeb-linux-user xtensa-linux-user
gprof enabled     no
sparse enabled    no
strip binaries    yes
profiler          no
static build      no
SDL support       yes (2.0.7)
GTK support       yes (3.22.21)
GTK GL support    yes
VTE support       yes (0.48.4)
TLS priority      NORMAL
GNUTLS support    yes
GNUTLS rnd        yes
libgcrypt         no
libgcrypt kdf     no
nettle            yes (3.3)
nettle kdf        yes
libtasn1          yes
curses support    yes
virgl support     yes
curl support      yes
mingw32 support   no
Audio drivers     oss
Block whitelist (rw) 
Block whitelist (ro) 
VirtFS support    yes
Multipath support no
VNC support       yes
VNC SASL support  yes
VNC JPEG support  yes
VNC PNG support   yes
xen support       no
brlapi support    yes
bluez  support    yes
Documentation     yes
PIE               no
vde support       no
netmap support    no
Linux AIO support yes
ATTR/XATTR support yes
Install blobs     yes
KVM support       yes
HAX support       no
HVF support       no
WHPX support      no
TCG support       yes
TCG debug enabled no
TCG interpreter   no
malloc trim support yes
RDMA support      no
fdt support       system
membarrier        no
preadv support    yes
fdatasync         yes
madvise           yes
posix_madvise     yes
posix_memalign    yes
libcap-ng support yes
vhost-net support yes
vhost-crypto support yes
vhost-scsi support yes
vhost-vsock support yes
vhost-user support yes
Trace backends    log
spice support     no 
rbd support       yes
xfsctl support    no
smartcard support yes
libusb            yes
usb net redir     yes
OpenGL support    yes
OpenGL dmabufs    yes
libiscsi support  yes
libnfs support    yes
build guest agent yes
QGA VSS support   no
QGA w32 disk info no
QGA MSI support   no
seccomp support   yes
coroutine backend ucontext
coroutine pool    yes
debug stack usage no
crypto afalg      no
GlusterFS support yes
gcov              gcov
gcov enabled      no
TPM support       yes
libssh2 support   yes
TPM passthrough   no
TPM emulator      yes
QOM debugging     yes
Live block migration yes
lzo support       yes
snappy support    yes
bzip2 support     yes
NUMA host support no
libxml2           yes
tcmalloc support  no
jemalloc support  no
avx2 optimization no
replication support yes
VxHS block device no
capstone          git
docker            no
  GEN     aarch64-softmmu/config-devices.mak.tmp
  GEN     alpha-softmmu/config-devices.mak.tmp
  GEN     arm-softmmu/config-devices.mak.tmp
  GEN     cris-softmmu/config-devices.mak.tmp
  GEN     cris-softmmu/config-devices.mak
  GEN     hppa-softmmu/config-devices.mak.tmp
  GEN     alpha-softmmu/config-devices.mak
  GEN     i386-softmmu/config-devices.mak.tmp
  GEN     arm-softmmu/config-devices.mak
  GEN     aarch64-softmmu/config-devices.mak
  GEN     lm32-softmmu/config-devices.mak.tmp
  GEN     m68k-softmmu/config-devices.mak.tmp
  GEN     hppa-softmmu/config-devices.mak
  GEN     microblazeel-softmmu/config-devices.mak.tmp
  GEN     m68k-softmmu/config-devices.mak
  GEN     lm32-softmmu/config-devices.mak
  GEN     i386-softmmu/config-devices.mak
  GEN     microblaze-softmmu/config-devices.mak.tmp
  GEN     mips64el-softmmu/config-devices.mak.tmp
  GEN     mips64-softmmu/config-devices.mak.tmp
  GEN     microblazeel-softmmu/config-devices.mak
  GEN     microblaze-softmmu/config-devices.mak
  GEN     mipsel-softmmu/config-devices.mak.tmp
  GEN     mips-softmmu/config-devices.mak.tmp
  GEN     mips64-softmmu/config-devices.mak
  GEN     moxie-softmmu/config-devices.mak.tmp
  GEN     mips-softmmu/config-devices.mak
  GEN     mips64el-softmmu/config-devices.mak
  GEN     nios2-softmmu/config-devices.mak.tmp
  GEN     mipsel-softmmu/config-devices.mak
  GEN     or1k-softmmu/config-devices.mak.tmp
  GEN     moxie-softmmu/config-devices.mak
  GEN     ppc64-softmmu/config-devices.mak.tmp
  GEN     nios2-softmmu/config-devices.mak
  GEN     ppcemb-softmmu/config-devices.mak.tmp
  GEN     ppc-softmmu/config-devices.mak.tmp
  GEN     or1k-softmmu/config-devices.mak
  GEN     riscv32-softmmu/config-devices.mak.tmp
  GEN     ppcemb-softmmu/config-devices.mak
  GEN     ppc-softmmu/config-devices.mak
  GEN     riscv32-softmmu/config-devices.mak
  GEN     riscv64-softmmu/config-devices.mak.tmp
  GEN     s390x-softmmu/config-devices.mak.tmp
  GEN     ppc64-softmmu/config-devices.mak
  GEN     sh4eb-softmmu/config-devices.mak.tmp
  GEN     sh4-softmmu/config-devices.mak.tmp
  GEN     riscv64-softmmu/config-devices.mak
  GEN     sparc64-softmmu/config-devices.mak.tmp
  GEN     s390x-softmmu/config-devices.mak
  GEN     sparc-softmmu/config-devices.mak.tmp
  GEN     sh4eb-softmmu/config-devices.mak
  GEN     sh4-softmmu/config-devices.mak
  GEN     sparc-softmmu/config-devices.mak
  GEN     tricore-softmmu/config-devices.mak.tmp
  GEN     unicore32-softmmu/config-devices.mak.tmp
  GEN     sparc64-softmmu/config-devices.mak
  GEN     x86_64-softmmu/config-devices.mak.tmp
  GEN     xtensaeb-softmmu/config-devices.mak.tmp
  GEN     tricore-softmmu/config-devices.mak
  GEN     unicore32-softmmu/config-devices.mak
  GEN     xtensa-softmmu/config-devices.mak.tmp
  GEN     xtensaeb-softmmu/config-devices.mak
  GEN     aarch64_be-linux-user/config-devices.mak.tmp
  GEN     aarch64-linux-user/config-devices.mak.tmp
  GEN     x86_64-softmmu/config-devices.mak
  GEN     xtensa-softmmu/config-devices.mak
  GEN     alpha-linux-user/config-devices.mak.tmp
  GEN     aarch64_be-linux-user/config-devices.mak
  GEN     armeb-linux-user/config-devices.mak.tmp
  GEN     arm-linux-user/config-devices.mak.tmp
  GEN     aarch64-linux-user/config-devices.mak
  GEN     cris-linux-user/config-devices.mak.tmp
  GEN     alpha-linux-user/config-devices.mak
  GEN     arm-linux-user/config-devices.mak
  GEN     hppa-linux-user/config-devices.mak.tmp
  GEN     armeb-linux-user/config-devices.mak
  GEN     i386-linux-user/config-devices.mak.tmp
  GEN     cris-linux-user/config-devices.mak
  GEN     m68k-linux-user/config-devices.mak.tmp
  GEN     microblazeel-linux-user/config-devices.mak.tmp
  GEN     i386-linux-user/config-devices.mak
  GEN     hppa-linux-user/config-devices.mak
  GEN     microblazeel-linux-user/config-devices.mak
  GEN     m68k-linux-user/config-devices.mak
  GEN     microblaze-linux-user/config-devices.mak.tmp
  GEN     mips64el-linux-user/config-devices.mak.tmp
  GEN     mips64-linux-user/config-devices.mak.tmp
  GEN     mipsel-linux-user/config-devices.mak.tmp
  GEN     microblaze-linux-user/config-devices.mak
  GEN     mips64-linux-user/config-devices.mak
  GEN     mips64el-linux-user/config-devices.mak
  GEN     mips-linux-user/config-devices.mak.tmp
  GEN     mipsel-linux-user/config-devices.mak
  GEN     mipsn32el-linux-user/config-devices.mak.tmp
  GEN     mipsn32-linux-user/config-devices.mak.tmp
  GEN     nios2-linux-user/config-devices.mak.tmp
  GEN     mips-linux-user/config-devices.mak
  GEN     or1k-linux-user/config-devices.mak.tmp
  GEN     mipsn32-linux-user/config-devices.mak
  GEN     mipsn32el-linux-user/config-devices.mak
  GEN     ppc64abi32-linux-user/config-devices.mak.tmp
  GEN     nios2-linux-user/config-devices.mak
  GEN     ppc64le-linux-user/config-devices.mak.tmp
  GEN     ppc64-linux-user/config-devices.mak.tmp
  GEN     or1k-linux-user/config-devices.mak
  GEN     ppc64abi32-linux-user/config-devices.mak
  GEN     ppc-linux-user/config-devices.mak.tmp
  GEN     ppc64-linux-user/config-devices.mak
  GEN     ppc64le-linux-user/config-devices.mak
  GEN     riscv32-linux-user/config-devices.mak.tmp
  GEN     riscv64-linux-user/config-devices.mak.tmp
  GEN     s390x-linux-user/config-devices.mak.tmp
  GEN     ppc-linux-user/config-devices.mak
  GEN     riscv32-linux-user/config-devices.mak
  GEN     sh4eb-linux-user/config-devices.mak.tmp
  GEN     s390x-linux-user/config-devices.mak
  GEN     riscv64-linux-user/config-devices.mak
  GEN     sh4-linux-user/config-devices.mak.tmp
  GEN     sparc32plus-linux-user/config-devices.mak.tmp
  GEN     sparc64-linux-user/config-devices.mak.tmp
  GEN     sh4eb-linux-user/config-devices.mak
  GEN     sh4-linux-user/config-devices.mak
  GEN     sparc-linux-user/config-devices.mak.tmp
  GEN     tilegx-linux-user/config-devices.mak.tmp
  GEN     sparc64-linux-user/config-devices.mak
  GEN     sparc32plus-linux-user/config-devices.mak
  GEN     x86_64-linux-user/config-devices.mak.tmp
  GEN     sparc-linux-user/config-devices.mak
  GEN     xtensaeb-linux-user/config-devices.mak.tmp
  GEN     xtensa-linux-user/config-devices.mak.tmp
  GEN     tilegx-linux-user/config-devices.mak
  GEN     x86_64-linux-user/config-devices.mak
  GEN     config-host.h
  GEN     xtensa-linux-user/config-devices.mak
  GEN     xtensaeb-linux-user/config-devices.mak
  GIT     ui/keycodemapdb capstone
  GEN     qemu-options.def
  GEN     qapi-gen
  GEN     trace/generated-tcg-tracers.h
  GEN     trace/generated-helpers-wrappers.h
  GEN     trace/generated-helpers.h
  GEN     trace/generated-helpers.c
  GEN     module_block.h
  GEN     tests/test-qapi-gen
  GEN     trace-root.h
  GEN     accel/kvm/trace.h
  GEN     accel/tcg/trace.h
  GEN     audio/trace.h
  GEN     block/trace.h
  GEN     chardev/trace.h
  GEN     crypto/trace.h
  GEN     hw/9pfs/trace.h
  GEN     hw/acpi/trace.h
  GEN     hw/alpha/trace.h
  GEN     hw/arm/trace.h
  GEN     hw/audio/trace.h
  GEN     hw/block/trace.h
  GEN     hw/block/dataplane/trace.h
  GEN     hw/char/trace.h
  GEN     hw/display/trace.h
  GEN     hw/dma/trace.h
  GEN     hw/hppa/trace.h
  GEN     hw/i2c/trace.h
  GEN     hw/i386/trace.h
Submodule 'capstone' (git://git.qemu.org/capstone.git) registered for path 'capstone'
Submodule 'ui/keycodemapdb' (git://git.qemu.org/keycodemapdb.git) registered for path 'ui/keycodemapdb'
  GEN     hw/i386/xen/trace.h
Cloning into '/var/tmp/patchew-tester-tmp-u8athipi/src/capstone'...
  GEN     hw/ide/trace.h
  GEN     hw/input/trace.h
  GEN     hw/intc/trace.h
  GEN     hw/isa/trace.h
  GEN     hw/mem/trace.h
  GEN     hw/misc/trace.h
  GEN     hw/misc/macio/trace.h
  GEN     hw/net/trace.h
  GEN     hw/nvram/trace.h
  GEN     hw/pci/trace.h
  GEN     hw/pci-host/trace.h
  GEN     hw/ppc/trace.h
  GEN     hw/rdma/trace.h
  GEN     hw/rdma/vmw/trace.h
  GEN     hw/s390x/trace.h
  GEN     hw/scsi/trace.h
  GEN     hw/sd/trace.h
  GEN     hw/sparc/trace.h
  GEN     hw/sparc64/trace.h
  GEN     hw/timer/trace.h
  GEN     hw/tpm/trace.h
  GEN     hw/usb/trace.h
  GEN     hw/vfio/trace.h
  GEN     hw/virtio/trace.h
  GEN     hw/xen/trace.h
  GEN     io/trace.h
  GEN     linux-user/trace.h
  GEN     migration/trace.h
  GEN     nbd/trace.h
  GEN     net/trace.h
  GEN     qapi/trace.h
  GEN     qom/trace.h
  GEN     scsi/trace.h
  GEN     target/arm/trace.h
  GEN     target/i386/trace.h
  GEN     target/mips/trace.h
  GEN     target/ppc/trace.h
  GEN     target/s390x/trace.h
  GEN     target/sparc/trace.h
  GEN     ui/trace.h
  GEN     util/trace.h
  GEN     trace-root.c
  GEN     accel/kvm/trace.c
  GEN     accel/tcg/trace.c
  GEN     audio/trace.c
  GEN     block/trace.c
  GEN     chardev/trace.c
  GEN     crypto/trace.c
  GEN     hw/9pfs/trace.c
  GEN     hw/acpi/trace.c
  GEN     hw/alpha/trace.c
  GEN     hw/arm/trace.c
  GEN     hw/audio/trace.c
  GEN     hw/block/trace.c
  GEN     hw/block/dataplane/trace.c
  GEN     hw/char/trace.c
  GEN     hw/display/trace.c
  GEN     hw/dma/trace.c
  GEN     hw/hppa/trace.c
  GEN     hw/i2c/trace.c
  GEN     hw/i386/trace.c
  GEN     hw/i386/xen/trace.c
  GEN     hw/ide/trace.c
  GEN     hw/input/trace.c
  GEN     hw/intc/trace.c
  GEN     hw/isa/trace.c
  GEN     hw/mem/trace.c
  GEN     hw/misc/trace.c
  GEN     hw/misc/macio/trace.c
  GEN     hw/net/trace.c
  GEN     hw/nvram/trace.c
  GEN     hw/pci/trace.c
  GEN     hw/pci-host/trace.c
  GEN     hw/ppc/trace.c
  GEN     hw/rdma/trace.c
  GEN     hw/rdma/vmw/trace.c
  GEN     hw/s390x/trace.c
  GEN     hw/scsi/trace.c
  GEN     hw/sd/trace.c
  GEN     hw/sparc/trace.c
  GEN     hw/sparc64/trace.c
  GEN     hw/timer/trace.c
  GEN     hw/tpm/trace.c
  GEN     hw/usb/trace.c
  GEN     hw/vfio/trace.c
  GEN     hw/virtio/trace.c
  GEN     hw/xen/trace.c
  GEN     io/trace.c
  GEN     linux-user/trace.c
  GEN     migration/trace.c
  GEN     nbd/trace.c
  GEN     net/trace.c
  GEN     qapi/trace.c
  GEN     qom/trace.c
  GEN     scsi/trace.c
  GEN     target/arm/trace.c
  GEN     target/i386/trace.c
  GEN     target/mips/trace.c
  GEN     target/ppc/trace.c
  GEN     target/s390x/trace.c
  GEN     target/sparc/trace.c
  GEN     ui/trace.c
  GEN     util/trace.c
  GEN     config-all-devices.mak
Cloning into '/var/tmp/patchew-tester-tmp-u8athipi/src/ui/keycodemapdb'...
  GEN     ui/input-keymap-atset1-to-qcode.c
  GEN     ui/input-keymap-linux-to-qcode.c
  GEN     ui/input-keymap-qcode-to-atset1.c
  CC      cs.o
  GEN     ui/input-keymap-qcode-to-atset2.c
  GEN     ui/input-keymap-qcode-to-atset3.c
  GEN     ui/input-keymap-qcode-to-linux.c
  GEN     ui/input-keymap-qcode-to-qnum.c
  GEN     ui/input-keymap-qcode-to-sun.c
  GEN     ui/input-keymap-qnum-to-qcode.c
  GEN     ui/input-keymap-usb-to-qcode.c
  GEN     ui/input-keymap-win32-to-qcode.c
  GEN     ui/input-keymap-x11-to-qcode.c
  GEN     ui/input-keymap-xorgevdev-to-qcode.c
  GEN     ui/input-keymap-xorgkbd-to-qcode.c
  CC      utils.o
  GEN     ui/input-keymap-xorgxquartz-to-qcode.c
  GEN     ui/input-keymap-xorgxwin-to-qcode.c
  CC      SStream.o
  CC      MCInstrDesc.o
  CC      MCRegisterInfo.o
  CC      arch/ARM/ARMDisassembler.o
  CC      arch/ARM/ARMInstPrinter.o
  CC      arch/ARM/ARMMapping.o
  CC      arch/ARM/ARMModule.o
  CC      arch/AArch64/AArch64BaseInfo.o
  CC      arch/AArch64/AArch64Disassembler.o
  CC      arch/AArch64/AArch64InstPrinter.o
  CC      arch/AArch64/AArch64Mapping.o
  CC      arch/AArch64/AArch64Module.o
  CC      arch/Mips/MipsDisassembler.o
  CC      arch/Mips/MipsInstPrinter.o
  CC      arch/Mips/MipsMapping.o
  CC      arch/Mips/MipsModule.o
  CC      arch/PowerPC/PPCDisassembler.o
  CC      arch/PowerPC/PPCInstPrinter.o
  CC      arch/PowerPC/PPCMapping.o
  CC      arch/PowerPC/PPCModule.o
  CC      arch/Sparc/SparcDisassembler.o
  CC      arch/Sparc/SparcInstPrinter.o
  CC      arch/Sparc/SparcMapping.o
  CC      arch/Sparc/SparcModule.o
  CC      arch/SystemZ/SystemZDisassembler.o
  CC      arch/SystemZ/SystemZInstPrinter.o
  CC      arch/SystemZ/SystemZMapping.o
  CC      arch/SystemZ/SystemZModule.o
  CC      arch/SystemZ/SystemZMCTargetDesc.o
  CC      arch/X86/X86DisassemblerDecoder.o
  CC      arch/X86/X86Disassembler.o
  CC      arch/X86/X86IntelInstPrinter.o
  CC      arch/X86/X86ATTInstPrinter.o
  CC      arch/X86/X86Mapping.o
  CC      arch/X86/X86Module.o
  CC      arch/XCore/XCoreDisassembler.o
  CC      arch/XCore/XCoreInstPrinter.o
  CC      arch/XCore/XCoreMapping.o
  CC      arch/XCore/XCoreModule.o
  CC      MCInst.o
  AR      libcapstone.a
ar: creating /var/tmp/patchew-tester-tmp-u8athipi/src/build/capstone/libcapstone.a
  GEN     docs/version.texi
  GEN     qemu-options.texi
  CC      tests/qemu-iotests/socket_scm_helper.o
  GEN     qemu-monitor.texi
  GEN     qemu-img-cmds.texi
  GEN     qemu-monitor-info.texi
  GEN     qemu-img.1
  GEN     qemu-nbd.8
  GEN     qemu-ga.8
  GEN     qga/qapi-generated/qapi-gen
  GEN     docs/qemu-block-drivers.7
  GEN     fsdev/virtfs-proxy-helper.1
  CC      qapi/qapi-builtin-types.o
  CC      qapi/qapi-types.o
  CC      qapi/qapi-types-block-core.o
  CC      qapi/qapi-types-block.o
  CC      qapi/qapi-types-char.o
  CC      qapi/qapi-types-common.o
  CC      qapi/qapi-types-crypto.o
  CC      qapi/qapi-types-introspect.o
  CC      qapi/qapi-types-job.o
  CC      qapi/qapi-types-migration.o
  CC      qapi/qapi-types-misc.o
  CC      qapi/qapi-types-net.o
  CC      qapi/qapi-types-rocker.o
  CC      qapi/qapi-types-run-state.o
  CC      qapi/qapi-types-sockets.o
  CC      qapi/qapi-types-tpm.o
  CC      qapi/qapi-types-trace.o
  CC      qapi/qapi-types-ui.o
  CC      qapi/qapi-types-transaction.o
  CC      qapi/qapi-builtin-visit.o
  CC      qapi/qapi-visit.o
  CC      qapi/qapi-visit-block-core.o
  CC      qapi/qapi-visit-block.o
  CC      qapi/qapi-visit-char.o
  CC      qapi/qapi-visit-common.o
  CC      qapi/qapi-visit-crypto.o
  CC      qapi/qapi-visit-introspect.o
  CC      qapi/qapi-visit-job.o
  CC      qapi/qapi-visit-misc.o
  CC      qapi/qapi-visit-migration.o
  CC      qapi/qapi-visit-net.o
  CC      qapi/qapi-visit-rocker.o
  CC      qapi/qapi-visit-sockets.o
  CC      qapi/qapi-visit-run-state.o
  CC      qapi/qapi-visit-tpm.o
  CC      qapi/qapi-visit-trace.o
  CC      qapi/qapi-visit-transaction.o
  CC      qapi/qapi-visit-ui.o
  CC      qapi/qapi-events.o
  CC      qapi/qapi-events-block-core.o
  CC      qapi/qapi-events-block.o
  CC      qapi/qapi-events-char.o
  CC      qapi/qapi-events-common.o
  CC      qapi/qapi-events-crypto.o
  CC      qapi/qapi-events-introspect.o
  CC      qapi/qapi-events-job.o
  CC      qapi/qapi-events-migration.o
  CC      qapi/qapi-events-misc.o
  CC      qapi/qapi-events-net.o
  CC      qapi/qapi-events-rocker.o
  CC      qapi/qapi-events-run-state.o
  CC      qapi/qapi-events-sockets.o
  CC      qapi/qapi-events-tpm.o
  CC      qapi/qapi-events-trace.o
  CC      qapi/qapi-events-transaction.o
  CC      qapi/qapi-events-ui.o
  CC      qapi/qapi-introspect.o
  CC      qapi/qapi-visit-core.o
  CC      qapi/qapi-dealloc-visitor.o
  CC      qapi/qobject-input-visitor.o
  CC      qapi/qobject-output-visitor.o
  CC      qapi/qmp-registry.o
  CC      qapi/qmp-dispatch.o
  CC      qapi/string-input-visitor.o
  CC      qapi/string-output-visitor.o
  CC      qapi/opts-visitor.o
  CC      qapi/qapi-clone-visitor.o
  CC      qapi/qmp-event.o
  CC      qapi/qapi-util.o
  CC      qobject/qnull.o
  CC      qobject/qnum.o
  CC      qobject/qstring.o
  CC      qobject/qdict.o
  CC      qobject/qlist.o
  CC      qobject/qbool.o
  CC      qobject/qlit.o
  CC      qobject/qjson.o
  CC      qobject/qobject.o
  CC      qobject/json-lexer.o
  CC      qobject/json-streamer.o
  CC      qobject/json-parser.o
  CC      trace/control.o
  CC      trace/qmp.o
  CC      util/osdep.o
  CC      util/cutils.o
  CC      util/unicode.o
  CC      util/qemu-timer-common.o
  CC      util/bufferiszero.o
  CC      util/lockcnt.o
  CC      util/aiocb.o
  CC      util/async.o
  CC      util/aio-wait.o
  CC      util/thread-pool.o
  CC      util/qemu-timer.o
  CC      util/main-loop.o
  CC      util/iohandler.o
  CC      util/aio-posix.o
  CC      util/compatfd.o
  CC      util/event_notifier-posix.o
  CC      util/mmap-alloc.o
  CC      util/oslib-posix.o
  CC      util/qemu-openpty.o
  CC      util/qemu-thread-posix.o
  CC      util/memfd.o
  CC      util/envlist.o
  CC      util/path.o
  CC      util/module.o
  CC      util/host-utils.o
  CC      util/bitmap.o
  CC      util/bitops.o
  CC      util/hbitmap.o
  CC      util/fifo8.o
  CC      util/acl.o
  CC      util/cacheinfo.o
  CC      util/error.o
  CC      util/qemu-error.o
  CC      util/id.o
  CC      util/iov.o
  CC      util/qemu-config.o
  CC      util/qemu-sockets.o
  CC      util/uri.o
  CC      util/notify.o
  CC      util/qemu-option.o
  CC      util/qemu-progress.o
  CC      util/keyval.o
  CC      util/hexdump.o
  CC      util/crc32c.o
  CC      util/uuid.o
  CC      util/throttle.o
  CC      util/getauxval.o
  CC      util/readline.o
  CC      util/rcu.o
  CC      util/qemu-coroutine.o
  CC      util/qemu-coroutine-lock.o
  CC      util/qemu-coroutine-io.o
  CC      util/qemu-coroutine-sleep.o
  CC      util/coroutine-ucontext.o
  CC      util/buffer.o
  CC      util/timed-average.o
  CC      util/base64.o
  CC      util/log.o
  CC      util/pagesize.o
  CC      util/qdist.o
  CC      util/qht.o
  CC      util/range.o
  CC      util/stats64.o
  CC      util/systemd.o
  CC      util/iova-tree.o
  CC      util/vfio-helpers.o
  CC      trace-root.o
  CC      accel/kvm/trace.o
  CC      accel/tcg/trace.o
  CC      audio/trace.o
  CC      block/trace.o
  CC      chardev/trace.o
  CC      crypto/trace.o
  CC      hw/9pfs/trace.o
  CC      hw/acpi/trace.o
  CC      hw/alpha/trace.o
  CC      hw/arm/trace.o
  CC      hw/audio/trace.o
  CC      hw/block/trace.o
  CC      hw/block/dataplane/trace.o
  CC      hw/char/trace.o
  CC      hw/display/trace.o
  CC      hw/dma/trace.o
  CC      hw/hppa/trace.o
  CC      hw/i2c/trace.o
  CC      hw/i386/trace.o
  CC      hw/i386/xen/trace.o
  CC      hw/ide/trace.o
  CC      hw/input/trace.o
  CC      hw/intc/trace.o
  CC      hw/isa/trace.o
  CC      hw/mem/trace.o
  CC      hw/misc/trace.o
  CC      hw/misc/macio/trace.o
  CC      hw/net/trace.o
  CC      hw/nvram/trace.o
  CC      hw/pci/trace.o
  CC      hw/pci-host/trace.o
  CC      hw/ppc/trace.o
  CC      hw/rdma/trace.o
  CC      hw/rdma/vmw/trace.o
  CC      hw/s390x/trace.o
  CC      hw/scsi/trace.o
  CC      hw/sd/trace.o
  CC      hw/sparc/trace.o
  CC      hw/sparc64/trace.o
  CC      hw/timer/trace.o
  CC      hw/tpm/trace.o
  CC      hw/usb/trace.o
  CC      hw/vfio/trace.o
  CC      hw/virtio/trace.o
  CC      hw/xen/trace.o
  CC      io/trace.o
  CC      linux-user/trace.o
  CC      migration/trace.o
  CC      nbd/trace.o
  CC      net/trace.o
  CC      qapi/trace.o
  CC      qom/trace.o
  CC      scsi/trace.o
  CC      target/arm/trace.o
  CC      target/i386/trace.o
  CC      target/mips/trace.o
  CC      target/ppc/trace.o
  CC      target/s390x/trace.o
  CC      target/sparc/trace.o
  CC      ui/trace.o
  CC      util/trace.o
  CC      crypto/pbkdf-stub.o
  CC      stubs/arch-query-cpu-def.o
  CC      stubs/arch-query-cpu-model-expansion.o
  CC      stubs/arch-query-cpu-model-comparison.o
  CC      stubs/arch-query-cpu-model-baseline.o
  CC      stubs/bdrv-next-monitor-owned.o
  CC      stubs/blk-commit-all.o
  CC      stubs/blockdev-close-all-bdrv-states.o
  CC      stubs/clock-warp.o
  CC      stubs/cpu-get-clock.o
  CC      stubs/cpu-get-icount.o
  CC      stubs/dump.o
  CC      stubs/error-printf.o
  CC      stubs/fdset.o
  CC      stubs/gdbstub.o
  CC      stubs/get-vm-name.o
  CC      stubs/iothread.o
  CC      stubs/iothread-lock.o
  CC      stubs/is-daemonized.o
  CC      stubs/linux-aio.o
  CC      stubs/machine-init-done.o
  CC      stubs/migr-blocker.o
  CC      stubs/change-state-handler.o
  CC      stubs/monitor.o
  CC      stubs/notify-event.o
  CC      stubs/qtest.o
  CC      stubs/replay.o
  CC      stubs/runstate-check.o
  CC      stubs/set-fd-handler.o
  CC      stubs/slirp.o
  CC      stubs/sysbus.o
  CC      stubs/tpm.o
  CC      stubs/trace-control.o
  CC      stubs/uuid.o
  CC      stubs/vm-stop.o
  CC      stubs/vmstate.o
  CC      stubs/qmp_memory_device.o
  CC      stubs/target-monitor-defs.o
  CC      stubs/target-get-monitor-def.o
  CC      stubs/pc_madt_cpu_entry.o
  CC      stubs/vmgenid.o
  CC      stubs/xen-common.o
  CC      stubs/xen-hvm.o
  CC      stubs/pci-host-piix.o
  CC      stubs/ram-block.o
  CC      qemu-keymap.o
  CC      ui/input-keymap.o
  CC      contrib/ivshmem-client/ivshmem-client.o
  CC      contrib/ivshmem-client/main.o
  CC      contrib/ivshmem-server/ivshmem-server.o
  CC      contrib/ivshmem-server/main.o
  CC      qemu-nbd.o
  CC      block.o
  CC      blockjob.o
  CC      job.o
  CC      qemu-io-cmds.o
  CC      replication.o
  CC      block/raw-format.o
  CC      block/qcow.o
  CC      block/vdi.o
  CC      block/vmdk.o
  CC      block/cloop.o
  CC      block/bochs.o
  CC      block/vpc.o
  CC      block/vvfat.o
  CC      block/dmg.o
  CC      block/qcow2.o
  CC      block/qcow2-refcount.o
  CC      block/qcow2-cluster.o
  CC      block/qcow2-snapshot.o
  CC      block/qcow2-cache.o
  CC      block/qcow2-bitmap.o
  CC      block/qed.o
  CC      block/qed-l2-cache.o
  CC      block/qed-table.o
  CC      block/qed-cluster.o
  CC      block/qed-check.o
  CC      block/vhdx.o
  CC      block/vhdx-endian.o
  CC      block/vhdx-log.o
  CC      block/quorum.o
  CC      block/parallels.o
  CC      block/blkdebug.o
  CC      block/blkverify.o
  CC      block/blkreplay.o
  CC      block/block-backend.o
  CC      block/snapshot.o
  CC      block/qapi.o
  CC      block/file-posix.o
  CC      block/linux-aio.o
  CC      block/null.o
  CC      block/mirror.o
  CC      block/commit.o
  CC      block/io.o
  CC      block/create.o
  CC      block/throttle-groups.o
  CC      block/nvme.o
  CC      block/nbd.o
  CC      block/nbd-client.o
  CC      block/sheepdog.o
  CC      block/iscsi-opts.o
  CC      block/accounting.o
  CC      block/dirty-bitmap.o
  CC      block/write-threshold.o
  CC      block/backup.o
  CC      block/replication.o
  CC      block/throttle.o
  CC      block/copy-on-read.o
  CC      block/crypto.o
  CC      nbd/server.o
  CC      nbd/client.o
  CC      nbd/common.o
  CC      scsi/utils.o
  CC      scsi/pr-manager.o
  CC      scsi/pr-manager-helper.o
  CC      block/iscsi.o
  CC      block/nfs.o
  CC      block/curl.o
  CC      block/rbd.o
  CC      block/gluster.o
  CC      block/ssh.o
  CC      block/dmg-bz2.o
  CC      crypto/init.o
  CC      crypto/hash.o
  CC      crypto/hash-nettle.o
  CC      crypto/hmac.o
  CC      crypto/hmac-nettle.o
  CC      crypto/aes.o
  CC      crypto/desrfb.o
  CC      crypto/cipher.o
  CC      crypto/tlscreds.o
  CC      crypto/tlscredsanon.o
  CC      crypto/tlscredsx509.o
  CC      crypto/tlssession.o
  CC      crypto/secret.o
  CC      crypto/random-gnutls.o
  CC      crypto/pbkdf.o
  CC      crypto/pbkdf-nettle.o
  CC      crypto/ivgen.o
  CC      crypto/ivgen-essiv.o
  CC      crypto/ivgen-plain.o
  CC      crypto/ivgen-plain64.o
  CC      crypto/afsplit.o
  CC      crypto/xts.o
  CC      crypto/block.o
  CC      crypto/block-qcow.o
  CC      crypto/block-luks.o
  CC      io/channel.o
  CC      io/channel-buffer.o
  CC      io/channel-command.o
  CC      io/channel-file.o
  CC      io/channel-socket.o
  CC      io/channel-tls.o
  CC      io/channel-watch.o
  CC      io/channel-websock.o
  CC      io/channel-util.o
  CC      io/dns-resolver.o
  CC      io/net-listener.o
  CC      io/task.o
  CC      qom/object.o
  CC      qom/container.o
  CC      qom/qom-qobject.o
  CC      qom/object_interfaces.o
  GEN     qemu-img-cmds.h
  CC      qemu-io.o
  CC      fsdev/virtfs-proxy-helper.o
  CC      fsdev/9p-marshal.o
  CC      fsdev/9p-iov-marshal.o
  CC      scsi/qemu-pr-helper.o
  CC      qemu-bridge-helper.o
  CC      blockdev.o
  CC      blockdev-nbd.o
  CC      bootdevice.o
  CC      iothread.o
  CC      job-qmp.o
  CC      qdev-monitor.o
  CC      device-hotplug.o
  CC      os-posix.o
  CC      bt-host.o
  CC      bt-vhci.o
  CC      dma-helpers.o
  CC      vl.o
  CC      tpm.o
  CC      qemu-seccomp.o
  CC      device_tree.o
  CC      qapi/qapi-commands.o
  CC      qapi/qapi-commands-block-core.o
  CC      qapi/qapi-commands-block.o
  CC      qapi/qapi-commands-char.o
  CC      qapi/qapi-commands-common.o
  CC      qapi/qapi-commands-crypto.o
  CC      qapi/qapi-commands-introspect.o
  CC      qapi/qapi-commands-job.o
  CC      qapi/qapi-commands-migration.o
  CC      qapi/qapi-commands-misc.o
  CC      qapi/qapi-commands-net.o
  CC      qapi/qapi-commands-rocker.o
  CC      qapi/qapi-commands-run-state.o
  CC      qapi/qapi-commands-sockets.o
  CC      qapi/qapi-commands-tpm.o
  CC      qapi/qapi-commands-trace.o
  CC      qapi/qapi-commands-transaction.o
  CC      qapi/qapi-commands-ui.o
  CC      qmp.o
  CC      hmp.o
  CC      cpus-common.o
  CC      audio/audio.o
  CC      audio/noaudio.o
  CC      audio/wavaudio.o
  CC      audio/mixeng.o
  CC      audio/wavcapture.o
  CC      backends/rng.o
  CC      backends/rng-egd.o
  CC      backends/rng-random.o
  CC      backends/tpm.o
  CC      backends/hostmem.o
  CC      backends/hostmem-ram.o
  CC      backends/hostmem-file.o
  CC      backends/cryptodev.o
  CC      backends/cryptodev-builtin.o
  CC      backends/cryptodev-vhost.o
  CC      backends/cryptodev-vhost-user.o
  CC      backends/hostmem-memfd.o
  CC      block/stream.o
  CC      chardev/msmouse.o
  CC      chardev/wctablet.o
  CC      chardev/testdev.o
  CC      chardev/baum.o
  CC      disas/alpha.o
  CC      disas/arm.o
  CXX     disas/arm-a64.o
  CC      disas/cris.o
  CC      disas/hppa.o
  CC      disas/m68k.o
  CC      disas/i386.o
  CC      disas/microblaze.o
  CC      disas/mips.o
  CC      disas/nios2.o
  CC      disas/moxie.o
  CC      disas/ppc.o
  CC      disas/riscv.o
  CC      disas/s390.o
  CC      disas/sh4.o
  CC      disas/sparc.o
  CC      disas/lm32.o
  CC      disas/xtensa.o
  CXX     disas/libvixl/vixl/utils.o
  CXX     disas/libvixl/vixl/compiler-intrinsics.o
  CXX     disas/libvixl/vixl/a64/instructions-a64.o
  CXX     disas/libvixl/vixl/a64/decoder-a64.o
  CXX     disas/libvixl/vixl/a64/disasm-a64.o
  CC      fsdev/qemu-fsdev.o
  CC      fsdev/qemu-fsdev-opts.o
  CC      fsdev/qemu-fsdev-throttle.o
  CC      fsdev/qemu-fsdev-dummy.o
  CC      hw/9pfs/9p.o
  CC      hw/9pfs/9p-util.o
  CC      hw/9pfs/9p-local.o
  CC      hw/9pfs/9p-xattr.o
  CC      hw/9pfs/9p-xattr-user.o
  CC      hw/9pfs/9p-posix-acl.o
  CC      hw/9pfs/coth.o
  CC      hw/9pfs/cofs.o
  CC      hw/9pfs/codir.o
  CC      hw/9pfs/cofile.o
  CC      hw/9pfs/coxattr.o
  CC      hw/9pfs/9p-synth.o
  CC      hw/9pfs/9p-handle.o
  CC      hw/9pfs/9p-proxy.o
  CC      hw/acpi/core.o
  CC      hw/acpi/piix4.o
  CC      hw/acpi/pcihp.o
  CC      hw/acpi/ich9.o
  CC      hw/acpi/tco.o
  CC      hw/acpi/cpu_hotplug.o
  CC      hw/acpi/memory_hotplug.o
  CC      hw/acpi/cpu.o
  CC      hw/acpi/nvdimm.o
  CC      hw/acpi/vmgenid.o
  CC      hw/acpi/acpi_interface.o
  CC      hw/acpi/bios-linker-loader.o
  CC      hw/acpi/aml-build.o
  CC      hw/acpi/ipmi.o
  CC      hw/acpi/acpi-stub.o
  CC      hw/acpi/ipmi-stub.o
  CC      hw/audio/sb16.o
  CC      hw/audio/es1370.o
  CC      hw/audio/ac97.o
  CC      hw/audio/fmopl.o
  CC      hw/audio/adlib.o
  CC      hw/audio/gus.o
  CC      hw/audio/gusemu_hal.o
  CC      hw/audio/gusemu_mixer.o
  CC      hw/audio/cs4231a.o
  CC      hw/audio/intel-hda.o
  CC      hw/audio/hda-codec.o
  CC      hw/audio/pcspk.o
  CC      hw/audio/wm8750.o
  CC      hw/audio/pl041.o
  CC      hw/audio/lm4549.o
  CC      hw/audio/cs4231.o
  CC      hw/audio/marvell_88w8618.o
  CC      hw/audio/milkymist-ac97.o
  CC      hw/audio/soundhw.o
  CC      hw/block/block.o
  CC      hw/block/cdrom.o
  CC      hw/block/hd-geometry.o
  CC      hw/block/fdc.o
  CC      hw/block/m25p80.o
  CC      hw/block/nand.o
  CC      hw/block/pflash_cfi01.o
  CC      hw/block/pflash_cfi02.o
  CC      hw/block/ecc.o
  CC      hw/block/onenand.o
  CC      hw/block/nvme.o
  CC      hw/bt/core.o
  CC      hw/bt/l2cap.o
  CC      hw/bt/sdp.o
  CC      hw/bt/hci.o
  CC      hw/bt/hid.o
  CC      hw/bt/hci-csr.o
  CC      hw/char/ipoctal232.o
  CC      hw/char/escc.o
  CC      hw/char/parallel.o
  CC      hw/char/parallel-isa.o
  CC      hw/char/pl011.o
  CC      hw/char/serial.o
  CC      hw/char/serial-isa.o
  CC      hw/char/serial-pci.o
  CC      hw/char/virtio-console.o
  CC      hw/char/xilinx_uartlite.o
  CC      hw/char/cmsdk-apb-uart.o
  CC      hw/char/cadence_uart.o
  CC      hw/char/etraxfs_ser.o
  CC      hw/char/debugcon.o
  CC      hw/char/grlib_apbuart.o
  CC      hw/char/imx_serial.o
  CC      hw/char/lm32_juart.o
  CC      hw/char/lm32_uart.o
  CC      hw/char/milkymist-uart.o
  CC      hw/char/sclpconsole.o
  CC      hw/char/sclpconsole-lm.o
  CC      hw/core/qdev.o
  CC      hw/core/qdev-properties.o
  CC      hw/core/bus.o
  CC      hw/core/reset.o
  CC      hw/core/qdev-fw.o
  CC      hw/core/fw-path-provider.o
  CC      hw/core/irq.o
  CC      hw/core/hotplug.o
  CC      hw/core/nmi.o
  CC      hw/core/empty_slot.o
  CC      hw/core/stream.o
  CC      hw/core/ptimer.o
  CC      hw/core/sysbus.o
  CC      hw/core/machine.o
  CC      hw/core/loader.o
  CC      hw/core/loader-fit.o
  CC      hw/core/qdev-properties-system.o
  CC      hw/core/register.o
  CC      hw/core/or-irq.o
  CC      hw/core/split-irq.o
  CC      hw/core/platform-bus.o
  CC      hw/cpu/core.o
  CC      hw/display/ads7846.o
  CC      hw/display/cirrus_vga.o
  CC      hw/display/g364fb.o
  CC      hw/display/jazz_led.o
  CC      hw/display/pl110.o
  CC      hw/display/sii9022.o
  CC      hw/display/ssd0303.o
  CC      hw/display/ssd0323.o
  CC      hw/display/vga-pci.o
  CC      hw/display/bochs-display.o
  CC      hw/display/vga-isa.o
  CC      hw/display/vga-isa-mm.o
  CC      hw/display/vmware_vga.o
  CC      hw/display/blizzard.o
  CC      hw/display/exynos4210_fimd.o
  CC      hw/display/framebuffer.o
  CC      hw/display/milkymist-vgafb.o
  CC      hw/display/tc6393xb.o
  CC      hw/display/milkymist-tmu2.o
  CC      hw/dma/puv3_dma.o
  CC      hw/dma/rc4030.o
  CC      hw/dma/pl080.o
  CC      hw/dma/pl330.o
  CC      hw/dma/i82374.o
  CC      hw/dma/i8257.o
  CC      hw/dma/xilinx_axidma.o
  CC      hw/dma/xlnx-zynq-devcfg.o
  CC      hw/dma/etraxfs_dma.o
  CC      hw/dma/sparc32_dma.o
  CC      hw/dma/xlnx-zdma.o
  CC      hw/gpio/max7310.o
  CC      hw/gpio/pl061.o
  CC      hw/gpio/puv3_gpio.o
  CC      hw/gpio/zaurus.o
  CC      hw/gpio/gpio_key.o
  CC      hw/gpio/mpc8xxx.o
  CC      hw/i2c/core.o
  CC      hw/i2c/smbus.o
  CC      hw/i2c/smbus_eeprom.o
  CC      hw/i2c/i2c-ddc.o
  CC      hw/i2c/versatile_i2c.o
  CC      hw/i2c/smbus_ich9.o
  CC      hw/i2c/pm_smbus.o
  CC      hw/i2c/bitbang_i2c.o
  CC      hw/i2c/exynos4210_i2c.o
  CC      hw/i2c/imx_i2c.o
  CC      hw/i2c/aspeed_i2c.o
  CC      hw/ide/core.o
  CC      hw/ide/atapi.o
  CC      hw/ide/qdev.o
  CC      hw/ide/pci.o
  CC      hw/ide/isa.o
  CC      hw/ide/piix.o
  CC      hw/ide/cmd646.o
  CC      hw/ide/macio.o
  CC      hw/ide/mmio.o
  CC      hw/ide/via.o
  CC      hw/ide/microdrive.o
  CC      hw/ide/ahci.o
  CC      hw/ide/ich.o
  CC      hw/ide/ahci-allwinner.o
  CC      hw/ide/sii3112.o
  CC      hw/input/adb.o
  CC      hw/input/adb-mouse.o
  CC      hw/input/adb-kbd.o
  CC      hw/input/hid.o
  CC      hw/input/lm832x.o
  CC      hw/input/pckbd.o
  CC      hw/input/pl050.o
  CC      hw/input/ps2.o
  CC      hw/input/stellaris_input.o
  CC      hw/input/tsc2005.o
  CC      hw/input/virtio-input.o
  CC      hw/input/virtio-input-hid.o
  CC      hw/input/virtio-input-host.o
  CC      hw/intc/heathrow_pic.o
  CC      hw/intc/i8259_common.o
  CC      hw/intc/i8259.o
  CC      hw/intc/pl190.o
  CC      hw/intc/puv3_intc.o
  CC      hw/intc/xilinx_intc.o
  CC      hw/intc/xlnx-pmu-iomod-intc.o
  CC      hw/intc/xlnx-zynqmp-ipi.o
  CC      hw/intc/etraxfs_pic.o
  CC      hw/intc/imx_avic.o
  CC      hw/intc/imx_gpcv2.o
  CC      hw/intc/lm32_pic.o
  CC      hw/intc/realview_gic.o
  CC      hw/intc/slavio_intctl.o
  CC      hw/intc/ioapic_common.o
  CC      hw/intc/arm_gic_common.o
  CC      hw/intc/arm_gic.o
  CC      hw/intc/arm_gicv2m.o
  CC      hw/intc/arm_gicv3_common.o
  CC      hw/intc/arm_gicv3.o
  CC      hw/intc/arm_gicv3_dist.o
  CC      hw/intc/arm_gicv3_redist.o
  CC      hw/intc/arm_gicv3_its_common.o
  CC      hw/intc/openpic.o
  CC      hw/intc/intc.o
  CC      hw/ipack/ipack.o
  CC      hw/ipack/tpci200.o
  CC      hw/ipmi/ipmi.o
  CC      hw/ipmi/ipmi_bmc_sim.o
  CC      hw/ipmi/ipmi_bmc_extern.o
  CC      hw/ipmi/isa_ipmi_kcs.o
  CC      hw/ipmi/isa_ipmi_bt.o
  CC      hw/isa/isa-bus.o
  CC      hw/isa/isa-superio.o
  CC      hw/isa/smc37c669-superio.o
  CC      hw/isa/apm.o
  CC      hw/isa/i82378.o
  CC      hw/isa/pc87312.o
  CC      hw/isa/piix4.o
  CC      hw/isa/vt82c686.o
  CC      hw/mem/pc-dimm.o
  CC      hw/mem/memory-device.o
  CC      hw/mem/nvdimm.o
  CC      hw/misc/applesmc.o
  CC      hw/misc/max111x.o
  CC      hw/misc/tmp105.o
  CC      hw/misc/tmp421.o
  CC      hw/misc/debugexit.o
  CC      hw/misc/sga.o
  CC      hw/misc/pc-testdev.o
  CC      hw/misc/pci-testdev.o
  CC      hw/misc/edu.o
  CC      hw/misc/pca9552.o
  CC      hw/misc/unimp.o
  CC      hw/misc/vmcoreinfo.o
  CC      hw/misc/arm_l2x0.o
  CC      hw/misc/arm_integrator_debug.o
  CC      hw/misc/a9scu.o
  CC      hw/misc/arm11scu.o
  CC      hw/misc/mos6522.o
  CC      hw/misc/puv3_pm.o
  CC      hw/misc/macio/macio.o
  CC      hw/misc/macio/cuda.o
  CC      hw/misc/macio/mac_dbdma.o
  CC      hw/net/dp8393x.o
  CC      hw/net/ne2000.o
  CC      hw/net/eepro100.o
  CC      hw/net/pcnet-pci.o
  CC      hw/net/pcnet.o
  CC      hw/net/e1000.o
  CC      hw/net/e1000x_common.o
  CC      hw/net/net_tx_pkt.o
  CC      hw/net/net_rx_pkt.o
  CC      hw/net/e1000e.o
  CC      hw/net/e1000e_core.o
  CC      hw/net/rtl8139.o
  CC      hw/net/vmxnet3.o
  CC      hw/net/smc91c111.o
  CC      hw/net/lan9118.o
  CC      hw/net/ne2000-isa.o
  CC      hw/net/opencores_eth.o
  CC      hw/net/xgmac.o
  CC      hw/net/mipsnet.o
  CC      hw/net/xilinx_axienet.o
  CC      hw/net/allwinner_emac.o
  CC      hw/net/imx_fec.o
  CC      hw/net/cadence_gem.o
  CC      hw/net/stellaris_enet.o
  CC      hw/net/lance.o
  CC      hw/net/sunhme.o
  CC      hw/net/ftgmac100.o
  CC      hw/net/sungem.o
  CC      hw/net/rocker/rocker.o
  CC      hw/net/rocker/rocker_fp.o
  CC      hw/net/rocker/rocker_desc.o
  CC      hw/net/rocker/rocker_world.o
  CC      hw/net/rocker/rocker_of_dpa.o
  CC      hw/net/can/can_sja1000.o
  CC      hw/net/can/can_kvaser_pci.o
  CC      hw/net/can/can_pcm3680_pci.o
  CC      hw/net/can/can_mioe3680_pci.o
  CC      hw/nvram/ds1225y.o
  CC      hw/nvram/eeprom93xx.o
  CC      hw/nvram/eeprom_at24c.o
  CC      hw/nvram/fw_cfg.o
  CC      hw/nvram/chrp_nvram.o
  CC      hw/nvram/mac_nvram.o
  CC      hw/pci-bridge/pci_bridge_dev.o
  CC      hw/pci-bridge/pcie_root_port.o
  CC      hw/pci-bridge/gen_pcie_root_port.o
  CC      hw/pci-bridge/pcie_pci_bridge.o
  CC      hw/pci-bridge/pci_expander_bridge.o
  CC      hw/pci-bridge/xio3130_upstream.o
  CC      hw/pci-bridge/xio3130_downstream.o
  CC      hw/pci-bridge/ioh3420.o
  CC      hw/pci-bridge/i82801b11.o
  CC      hw/pci-bridge/dec.o
  CC      hw/pci-bridge/simba.o
  CC      hw/pci-host/pam.o
  CC      hw/pci-host/prep.o
  CC      hw/pci-host/grackle.o
  CC      hw/pci-host/uninorth.o
  CC      hw/pci-host/ppce500.o
  CC      hw/pci-host/versatile.o
  CC      hw/pci-host/sabre.o
  CC      hw/pci-host/bonito.o
  CC      hw/pci-host/piix.o
  CC      hw/pci-host/q35.o
  CC      hw/pci-host/gpex.o
  CC      hw/pci-host/xilinx-pcie.o
  CC      hw/pci-host/designware.o
  CC      hw/pci/pci.o
  CC      hw/pci/pci_bridge.o
  CC      hw/pci/msix.o
  CC      hw/pci/msi.o
  CC      hw/pci/shpc.o
  CC      hw/pci/slotid_cap.o
  CC      hw/pci/pci_host.o
  CC      hw/pci/pcie_host.o
  CC      hw/pci/pcie.o
  CC      hw/pci/pcie_aer.o
  CC      hw/pci/pcie_port.o
  CC      hw/pci/pci-stub.o
  CC      hw/pcmcia/pcmcia.o
  CC      hw/scsi/scsi-disk.o
  CC      hw/scsi/scsi-generic.o
  CC      hw/scsi/scsi-bus.o
  CC      hw/scsi/lsi53c895a.o
  CC      hw/scsi/mptsas.o
  CC      hw/scsi/mptconfig.o
  CC      hw/scsi/mptendian.o
  CC      hw/scsi/megasas.o
  CC      hw/scsi/vmw_pvscsi.o
  CC      hw/scsi/esp.o
  CC      hw/scsi/esp-pci.o
  CC      hw/sd/pl181.o
  CC      hw/sd/ssi-sd.o
  CC      hw/sd/sd.o
  CC      hw/sd/core.o
  CC      hw/sd/sdmmc-internal.o
  CC      hw/sd/sdhci.o
  CC      hw/smbios/smbios.o
  CC      hw/smbios/smbios_type_38.o
  CC      hw/smbios/smbios-stub.o
  CC      hw/smbios/smbios_type_38-stub.o
  CC      hw/ssi/pl022.o
  CC      hw/ssi/ssi.o
  CC      hw/ssi/xilinx_spi.o
  CC      hw/ssi/xilinx_spips.o
  CC      hw/ssi/aspeed_smc.o
  CC      hw/ssi/stm32f2xx_spi.o
  CC      hw/ssi/mss-spi.o
  CC      hw/timer/arm_timer.o
  CC      hw/timer/arm_mptimer.o
  CC      hw/timer/armv7m_systick.o
  CC      hw/timer/a9gtimer.o
  CC      hw/timer/cadence_ttc.o
  CC      hw/timer/ds1338.o
  CC      hw/timer/hpet.o
  CC      hw/timer/i8254_common.o
  CC      hw/timer/i8254.o
  CC      hw/timer/m48t59.o
  CC      hw/timer/m48t59-isa.o
  CC      hw/timer/pl031.o
  CC      hw/timer/puv3_ost.o
  CC      hw/timer/twl92230.o
  CC      hw/timer/xilinx_timer.o
  CC      hw/timer/slavio_timer.o
  CC      hw/timer/etraxfs_timer.o
  CC      hw/timer/grlib_gptimer.o
  CC      hw/timer/imx_epit.o
  CC      hw/timer/imx_gpt.o
  CC      hw/timer/lm32_timer.o
  CC      hw/timer/milkymist-sysctl.o
  CC      hw/timer/xlnx-zynqmp-rtc.o
  CC      hw/timer/stm32f2xx_timer.o
  CC      hw/timer/aspeed_timer.o
  CC      hw/timer/sun4v-rtc.o
  CC      hw/timer/cmsdk-apb-timer.o
  CC      hw/timer/mss-timer.o
  CC      hw/tpm/tpm_util.o
  CC      hw/tpm/tpm_tis.o
  CC      hw/tpm/tpm_crb.o
  CC      hw/tpm/tpm_emulator.o
  CC      hw/usb/core.o
  CC      hw/usb/combined-packet.o
  CC      hw/usb/bus.o
  CC      hw/usb/libhw.o
  CC      hw/usb/desc.o
  CC      hw/usb/desc-msos.o
  CC      hw/usb/hcd-uhci.o
  CC      hw/usb/hcd-ohci.o
  CC      hw/usb/hcd-ehci.o
  CC      hw/usb/hcd-ehci-pci.o
  CC      hw/usb/hcd-ehci-sysbus.o
  CC      hw/usb/hcd-xhci.o
  CC      hw/usb/hcd-xhci-nec.o
  CC      hw/usb/hcd-musb.o
  CC      hw/usb/dev-hub.o
  CC      hw/usb/dev-hid.o
  CC      hw/usb/dev-wacom.o
  CC      hw/usb/dev-storage.o
  CC      hw/usb/dev-uas.o
  CC      hw/usb/dev-audio.o
  CC      hw/usb/dev-serial.o
  CC      hw/usb/dev-network.o
  CC      hw/usb/dev-bluetooth.o
  CC      hw/usb/dev-smartcard-reader.o
  CC      hw/usb/ccid-card-passthru.o
  CC      hw/usb/ccid-card-emulated.o
  CC      hw/usb/dev-mtp.o
  CC      hw/usb/redirect.o
  CC      hw/usb/quirks.o
  CC      hw/usb/host-libusb.o
  CC      hw/usb/host-stub.o
  CC      hw/virtio/virtio-bus.o
  CC      hw/virtio/virtio-rng.o
  CC      hw/virtio/virtio-pci.o
  CC      hw/virtio/virtio-mmio.o
  CC      hw/virtio/vhost-stub.o
  CC      hw/watchdog/watchdog.o
  CC      hw/watchdog/wdt_i6300esb.o
  CC      hw/watchdog/wdt_ib700.o
  CC      hw/watchdog/wdt_diag288.o
  CC      hw/watchdog/wdt_aspeed.o
  CC      migration/migration.o
  CC      migration/socket.o
  CC      migration/fd.o
  CC      migration/exec.o
  CC      migration/tls.o
  CC      migration/channel.o
  CC      migration/savevm.o
  CC      migration/colo-comm.o
  CC      migration/colo.o
  CC      migration/colo-failover.o
  CC      migration/vmstate.o
  CC      migration/vmstate-types.o
  CC      migration/page_cache.o
  CC      migration/qemu-file.o
  CC      migration/global_state.o
  CC      migration/qemu-file-channel.o
  CC      migration/xbzrle.o
  CC      migration/postcopy-ram.o
  CC      migration/qjson.o
  CC      migration/block-dirty-bitmap.o
  CC      migration/block.o
  CC      net/net.o
  CC      net/queue.o
  CC      net/checksum.o
  CC      net/util.o
  CC      net/hub.o
  CC      net/socket.o
  CC      net/dump.o
  CC      net/eth.o
  CC      net/l2tpv3.o
  CC      net/vhost-user.o
  CC      net/slirp.o
  CC      net/filter.o
  CC      net/filter-buffer.o
  CC      net/filter-mirror.o
  CC      net/colo-compare.o
  CC      net/colo.o
  CC      net/filter-rewriter.o
  CC      net/filter-replay.o
  CC      net/tap.o
  CC      net/tap-linux.o
  CC      net/can/can_core.o
  CC      net/can/can_host.o
  CC      net/can/can_socketcan.o
  CC      qom/cpu.o
  CC      replay/replay.o
  CC      replay/replay-internal.o
  CC      replay/replay-events.o
  CC      replay/replay-time.o
  CC      replay/replay-input.o
  CC      replay/replay-char.o
  CC      replay/replay-snapshot.o
  CC      replay/replay-net.o
  CC      replay/replay-audio.o
  CC      slirp/cksum.o
  CC      slirp/if.o
  CC      slirp/ip_icmp.o
  CC      slirp/ip6_icmp.o
  CC      slirp/ip6_input.o
  CC      slirp/ip6_output.o
  CC      slirp/ip_input.o
  CC      slirp/ip_output.o
  CC      slirp/dnssearch.o
  CC      slirp/dhcpv6.o
  CC      slirp/slirp.o
  CC      slirp/mbuf.o
  CC      slirp/misc.o
  CC      slirp/sbuf.o
  CC      slirp/socket.o
  CC      slirp/tcp_input.o
  CC      slirp/tcp_output.o
  CC      slirp/tcp_subr.o
  CC      slirp/tcp_timer.o
  CC      slirp/udp.o
  CC      slirp/udp6.o
  CC      slirp/bootp.o
  CC      slirp/tftp.o
  CC      slirp/arp_table.o
  CC      slirp/ndp_table.o
  CC      slirp/ncsi.o
  CC      ui/keymaps.o
  CC      ui/console.o
  CC      ui/cursor.o
  CC      ui/qemu-pixman.o
  CC      ui/input.o
  CC      ui/input-legacy.o
  CC      ui/input-linux.o
  CC      ui/vnc.o
  CC      ui/vnc-enc-zlib.o
  CC      ui/vnc-enc-hextile.o
  CC      ui/vnc-enc-tight.o
  CC      ui/vnc-palette.o
  CC      ui/vnc-enc-zrle.o
  CC      ui/vnc-auth-vencrypt.o
  CC      ui/vnc-auth-sasl.o
  CC      ui/vnc-ws.o
  CC      ui/vnc-jobs.o
  VERT    ui/shader/texture-blit-vert.h
  VERT    ui/shader/texture-blit-flip-vert.h
  CC      ui/console-gl.o
  FRAG    ui/shader/texture-blit-frag.h
  CC      ui/egl-helpers.o
  CC      ui/egl-context.o
  CC      ui/egl-headless.o
  CC      audio/ossaudio.o
  CC      ui/sdl2.o
  CC      ui/sdl2-input.o
  CC      ui/sdl2-2d.o
  CC      ui/sdl2-gl.o
  CC      ui/x_keymap.o
  CC      ui/gtk.o
  CC      ui/gtk-egl.o
  CC      ui/gtk-gl-area.o
  CC      ui/curses.o
  CC      chardev/char.o
  CC      chardev/char-fd.o
  CC      chardev/char-fe.o
  CC      chardev/char-file.o
  CC      chardev/char-io.o
  CC      chardev/char-mux.o
  CC      chardev/char-null.o
  CC      chardev/char-parallel.o
  CC      chardev/char-pipe.o
  CC      chardev/char-pty.o
  CC      chardev/char-ringbuf.o
  CC      chardev/char-serial.o
  CC      chardev/char-socket.o
  CC      chardev/char-stdio.o
  CC      chardev/char-udp.o
  LINK    tests/qemu-iotests/socket_scm_helper
  GEN     qemu-doc.html
  CCAS    s390-ccw/start.o
  GEN     qemu-doc.txt
  GEN     qemu.1
  CC      s390-ccw/main.o
  CC      s390-ccw/bootmap.o
  GEN     docs/interop/qemu-qmp-ref.html
  CC      s390-ccw/jump2ipl.o
  CC      s390-ccw/sclp.o
  CC      s390-ccw/menu.o
  CC      s390-ccw/virtio.o
  CC      s390-ccw/virtio-scsi.o
  GEN     docs/interop/qemu-qmp-ref.txt
  GEN     docs/interop/qemu-qmp-ref.7
  CC      qga/commands.o
  CC      qga/guest-agent-command-state.o
  CC      qga/main.o
  CC      qga/commands-posix.o
  CC      qga/channel-posix.o
  CC      qga/qapi-generated/qga-qapi-types.o
  CC      qga/qapi-generated/qga-qapi-visit.o
  CC      qga/qapi-generated/qga-qapi-commands.o
  AR      libqemuutil.a
  CC      qemu-img.o
  CC      ui/shader.o
  GEN     docs/interop/qemu-ga-ref.html
  GEN     docs/interop/qemu-ga-ref.txt
  GEN     docs/interop/qemu-ga-ref.7
  CC      s390-ccw/virtio-blkdev.o
  LINK    qemu-ga
  CC      s390-ccw/libc.o
  LINK    qemu-keymap
s390-netboot.img not built since roms/SLOF/ is not available.
  BUILD   s390-ccw/s390-ccw.elf
  LINK    ivshmem-client
  STRIP   s390-ccw/s390-ccw.img
  LINK    ivshmem-server
  LINK    qemu-nbd
  LINK    qemu-img
  LINK    qemu-io
  LINK    fsdev/virtfs-proxy-helper
  LINK    scsi/qemu-pr-helper
  LINK    qemu-bridge-helper
  GEN     alpha-softmmu/hmp-commands.h
  GEN     aarch64-softmmu/hmp-commands.h
  GEN     alpha-softmmu/hmp-commands-info.h
  GEN     cris-softmmu/hmp-commands.h
  GEN     arm-softmmu/hmp-commands.h
  GEN     aarch64-softmmu/hmp-commands-info.h
  GEN     aarch64-softmmu/config-target.h
  GEN     alpha-softmmu/config-target.h
  GEN     cris-softmmu/hmp-commands-info.h
  GEN     arm-softmmu/hmp-commands-info.h
  CC      aarch64-softmmu/exec.o
  GEN     cris-softmmu/config-target.h
  CC      alpha-softmmu/exec.o
  GEN     arm-softmmu/config-target.h
  CC      cris-softmmu/exec.o
  CC      arm-softmmu/exec.o
  CC      cris-softmmu/tcg/tcg.o
  CC      aarch64-softmmu/tcg/tcg.o
  CC      arm-softmmu/tcg/tcg.o
  CC      alpha-softmmu/tcg/tcg.o
  CC      cris-softmmu/tcg/tcg-op.o
  CC      arm-softmmu/tcg/tcg-op.o
  CC      alpha-softmmu/tcg/tcg-op.o
  CC      aarch64-softmmu/tcg/tcg-op.o
  CC      arm-softmmu/tcg/tcg-op-vec.o
  CC      alpha-softmmu/tcg/tcg-op-vec.o
  CC      cris-softmmu/tcg/tcg-op-vec.o
  CC      alpha-softmmu/tcg/tcg-op-gvec.o
  CC      arm-softmmu/tcg/tcg-op-gvec.o
  CC      cris-softmmu/tcg/tcg-op-gvec.o
  CC      aarch64-softmmu/tcg/tcg-op-vec.o
  CC      alpha-softmmu/tcg/tcg-common.o
  CC      arm-softmmu/tcg/tcg-common.o
  CC      aarch64-softmmu/tcg/tcg-op-gvec.o
  CC      alpha-softmmu/tcg/optimize.o
  CC      cris-softmmu/tcg/tcg-common.o
  CC      arm-softmmu/tcg/optimize.o
  CC      cris-softmmu/tcg/optimize.o
  CC      alpha-softmmu/fpu/softfloat.o
  CC      cris-softmmu/fpu/softfloat.o
  CC      arm-softmmu/fpu/softfloat.o
  CC      aarch64-softmmu/tcg/tcg-common.o
  CC      aarch64-softmmu/tcg/optimize.o
  CC      aarch64-softmmu/fpu/softfloat.o
  CC      alpha-softmmu/disas.o
  CC      arm-softmmu/disas.o
  CC      alpha-softmmu/arch_init.o
  CC      cris-softmmu/disas.o
  GEN     arm-softmmu/gdbstub-xml.c
  CC      alpha-softmmu/cpus.o
  CC      arm-softmmu/arch_init.o
  CC      cris-softmmu/arch_init.o
  CC      arm-softmmu/cpus.o
  CC      cris-softmmu/cpus.o
  CC      alpha-softmmu/monitor.o
  CC      arm-softmmu/monitor.o
  CC      cris-softmmu/monitor.o
  CC      alpha-softmmu/gdbstub.o
  CC      aarch64-softmmu/disas.o
  CC      arm-softmmu/gdbstub.o
  GEN     aarch64-softmmu/gdbstub-xml.c
  CC      alpha-softmmu/balloon.o
  CC      cris-softmmu/gdbstub.o
  CC      alpha-softmmu/ioport.o
  CC      aarch64-softmmu/arch_init.o
  CC      arm-softmmu/balloon.o
  CC      alpha-softmmu/numa.o
  CC      cris-softmmu/balloon.o
  CC      aarch64-softmmu/cpus.o
  CC      cris-softmmu/ioport.o
  CC      arm-softmmu/ioport.o
  CC      alpha-softmmu/qtest.o
  CC      arm-softmmu/numa.o
  CC      cris-softmmu/numa.o
  CC      aarch64-softmmu/monitor.o
  CC      alpha-softmmu/memory.o
  CC      arm-softmmu/qtest.o
  CC      cris-softmmu/qtest.o
  CC      arm-softmmu/memory.o
  CC      cris-softmmu/memory.o
  CC      alpha-softmmu/memory_mapping.o
  CC      aarch64-softmmu/gdbstub.o
  CC      alpha-softmmu/dump.o
  CC      arm-softmmu/memory_mapping.o
  CC      cris-softmmu/memory_mapping.o
  CC      alpha-softmmu/migration/ram.o
  CC      arm-softmmu/dump.o
  CC      aarch64-softmmu/balloon.o
  CC      cris-softmmu/dump.o
  CC      aarch64-softmmu/ioport.o
  CC      arm-softmmu/migration/ram.o
  CC      cris-softmmu/migration/ram.o
  CC      alpha-softmmu/accel/accel.o
  CC      aarch64-softmmu/numa.o
  CC      alpha-softmmu/accel/stubs/hax-stub.o
  CC      aarch64-softmmu/qtest.o
  CC      alpha-softmmu/accel/stubs/hvf-stub.o
  CC      arm-softmmu/accel/accel.o
  CC      cris-softmmu/accel/accel.o
  CC      alpha-softmmu/accel/stubs/whpx-stub.o
  CC      aarch64-softmmu/memory.o
  CC      cris-softmmu/accel/stubs/hax-stub.o
  CC      arm-softmmu/accel/stubs/hax-stub.o
  CC      alpha-softmmu/accel/stubs/kvm-stub.o
  CC      cris-softmmu/accel/stubs/hvf-stub.o
  CC      alpha-softmmu/accel/tcg/tcg-all.o
  CC      cris-softmmu/accel/stubs/whpx-stub.o
  CC      arm-softmmu/accel/stubs/hvf-stub.o
  CC      cris-softmmu/accel/stubs/kvm-stub.o
  CC      alpha-softmmu/accel/tcg/cputlb.o
  CC      arm-softmmu/accel/stubs/whpx-stub.o
  CC      cris-softmmu/accel/tcg/tcg-all.o
  CC      arm-softmmu/accel/stubs/kvm-stub.o
  CC      aarch64-softmmu/memory_mapping.o
  CC      cris-softmmu/accel/tcg/cputlb.o
  CC      arm-softmmu/accel/tcg/tcg-all.o
  CC      aarch64-softmmu/dump.o
  CC      arm-softmmu/accel/tcg/cputlb.o
  CC      aarch64-softmmu/migration/ram.o
  CC      alpha-softmmu/accel/tcg/tcg-runtime.o
  CC      cris-softmmu/accel/tcg/tcg-runtime.o
  CC      alpha-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      aarch64-softmmu/accel/accel.o
  CC      cris-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      arm-softmmu/accel/tcg/tcg-runtime.o
  CC      aarch64-softmmu/accel/stubs/hax-stub.o
  CC      arm-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      alpha-softmmu/accel/tcg/cpu-exec.o
  CC      aarch64-softmmu/accel/stubs/hvf-stub.o
  CC      cris-softmmu/accel/tcg/cpu-exec.o
  CC      aarch64-softmmu/accel/stubs/whpx-stub.o
  CC      alpha-softmmu/accel/tcg/cpu-exec-common.o
  CC      cris-softmmu/accel/tcg/cpu-exec-common.o
  CC      alpha-softmmu/accel/tcg/translate-all.o
  CC      aarch64-softmmu/accel/stubs/kvm-stub.o
  CC      cris-softmmu/accel/tcg/translate-all.o
  CC      arm-softmmu/accel/tcg/cpu-exec.o
  CC      aarch64-softmmu/accel/tcg/tcg-all.o
  CC      alpha-softmmu/accel/tcg/translator.o
  CC      cris-softmmu/accel/tcg/translator.o
  CC      aarch64-softmmu/accel/tcg/cputlb.o
  CC      arm-softmmu/accel/tcg/cpu-exec-common.o
  CC      alpha-softmmu/hw/9pfs/virtio-9p-device.o
  CC      cris-softmmu/hw/core/generic-loader.o
  CC      arm-softmmu/accel/tcg/translate-all.o
  CC      alpha-softmmu/hw/block/virtio-blk.o
  CC      cris-softmmu/hw/core/null-machine.o
  CC      arm-softmmu/accel/tcg/translator.o
  CC      alpha-softmmu/hw/block/vhost-user-blk.o
  CC      cris-softmmu/hw/misc/mmio_interface.o
  CC      cris-softmmu/hw/net/etraxfs_eth.o
  CC      alpha-softmmu/hw/block/dataplane/virtio-blk.o
  CC      arm-softmmu/hw/9pfs/virtio-9p-device.o
  CC      cris-softmmu/hw/net/vhost_net.o
  CC      alpha-softmmu/hw/char/virtio-serial-bus.o
  CC      arm-softmmu/hw/adc/stm32f2xx_adc.o
  CC      cris-softmmu/hw/net/rocker/qmp-norocker.o
  CC      cris-softmmu/hw/vfio/common.o
  CC      arm-softmmu/hw/block/virtio-blk.o
  CC      aarch64-softmmu/accel/tcg/tcg-runtime.o
  CC      alpha-softmmu/hw/core/generic-loader.o
  CC      alpha-softmmu/hw/core/null-machine.o
  CC      arm-softmmu/hw/block/vhost-user-blk.o
  CC      aarch64-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      cris-softmmu/hw/vfio/platform.o
  CC      alpha-softmmu/hw/display/vga.o
  CC      arm-softmmu/hw/block/dataplane/virtio-blk.o
  CC      cris-softmmu/hw/vfio/spapr.o
  CC      arm-softmmu/hw/char/exynos4210_uart.o
  CC      arm-softmmu/hw/char/omap_uart.o
  CC      aarch64-softmmu/accel/tcg/cpu-exec.o
  CC      arm-softmmu/hw/char/digic-uart.o
  CC      cris-softmmu/hw/cris/boot.o
  CC      alpha-softmmu/hw/display/virtio-gpu.o
  CC      cris-softmmu/hw/cris/axis_dev88.o
  CC      arm-softmmu/hw/char/stm32f2xx_usart.o
  CC      cris-softmmu/target/cris/translate.o
  CC      arm-softmmu/hw/char/bcm2835_aux.o
  CC      aarch64-softmmu/accel/tcg/cpu-exec-common.o
  CC      aarch64-softmmu/accel/tcg/translate-all.o
  CC      arm-softmmu/hw/char/virtio-serial-bus.o
  CC      alpha-softmmu/hw/display/virtio-gpu-3d.o
  CC      arm-softmmu/hw/core/generic-loader.o
  CC      aarch64-softmmu/accel/tcg/translator.o
  CC      arm-softmmu/hw/core/null-machine.o
  CC      alpha-softmmu/hw/display/virtio-gpu-pci.o
  CC      arm-softmmu/hw/cpu/arm11mpcore.o
  CC      aarch64-softmmu/hw/9pfs/virtio-9p-device.o
  CC      cris-softmmu/target/cris/op_helper.o
  CC      alpha-softmmu/hw/misc/ivshmem.o
  CC      arm-softmmu/hw/cpu/realview_mpcore.o
  CC      arm-softmmu/hw/cpu/a9mpcore.o
  CC      aarch64-softmmu/hw/adc/stm32f2xx_adc.o
  CC      cris-softmmu/target/cris/helper.o
  CC      alpha-softmmu/hw/misc/mmio_interface.o
  CC      arm-softmmu/hw/cpu/a15mpcore.o
  CC      cris-softmmu/target/cris/cpu.o
  CC      aarch64-softmmu/hw/block/virtio-blk.o
  CC      alpha-softmmu/hw/net/virtio-net.o
  CC      arm-softmmu/hw/display/omap_dss.o
  CC      cris-softmmu/target/cris/gdbstub.o
  CC      arm-softmmu/hw/display/omap_lcdc.o
  CC      cris-softmmu/target/cris/mmu.o
  CC      aarch64-softmmu/hw/block/vhost-user-blk.o
  CC      alpha-softmmu/hw/net/vhost_net.o
  CC      cris-softmmu/target/cris/machine.o
  CC      arm-softmmu/hw/display/pxa2xx_lcd.o
  CC      aarch64-softmmu/hw/block/dataplane/virtio-blk.o
  CC      alpha-softmmu/hw/scsi/virtio-scsi.o
  GEN     trace/generated-helpers.c
  CC      aarch64-softmmu/hw/char/exynos4210_uart.o
  CC      cris-softmmu/trace/control-target.o
  CC      alpha-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      aarch64-softmmu/hw/char/omap_uart.o
  CC      alpha-softmmu/hw/scsi/vhost-scsi-common.o
  CC      cris-softmmu/trace/generated-helpers.o
  CC      aarch64-softmmu/hw/char/digic-uart.o
  CC      arm-softmmu/hw/display/bcm2835_fb.o
  CC      alpha-softmmu/hw/scsi/vhost-scsi.o
  CC      aarch64-softmmu/hw/char/stm32f2xx_usart.o
  LINK    cris-softmmu/qemu-system-cris
  CC      alpha-softmmu/hw/scsi/vhost-user-scsi.o
  CC      aarch64-softmmu/hw/char/bcm2835_aux.o
  CC      arm-softmmu/hw/display/vga.o
  CC      alpha-softmmu/hw/timer/mc146818rtc.o
  CC      aarch64-softmmu/hw/char/virtio-serial-bus.o
  CC      aarch64-softmmu/hw/core/generic-loader.o
  CC      aarch64-softmmu/hw/core/null-machine.o
  CC      alpha-softmmu/hw/vfio/common.o
  CC      arm-softmmu/hw/display/virtio-gpu.o
  CC      aarch64-softmmu/hw/cpu/arm11mpcore.o
  CC      alpha-softmmu/hw/vfio/pci.o
  CC      aarch64-softmmu/hw/cpu/realview_mpcore.o
  CC      aarch64-softmmu/hw/cpu/a9mpcore.o
  CC      arm-softmmu/hw/display/virtio-gpu-3d.o
  GEN     hppa-softmmu/hmp-commands.h
  GEN     hppa-softmmu/hmp-commands-info.h
  GEN     hppa-softmmu/config-target.h
  CC      hppa-softmmu/exec.o
  CC      arm-softmmu/hw/display/virtio-gpu-pci.o
  CC      alpha-softmmu/hw/vfio/pci-quirks.o
  CC      arm-softmmu/hw/dma/omap_dma.o
  CC      arm-softmmu/hw/dma/soc_dma.o
  CC      alpha-softmmu/hw/vfio/display.o
  CC      arm-softmmu/hw/dma/pxa2xx_dma.o
  CC      arm-softmmu/hw/dma/bcm2835_dma.o
  CC      alpha-softmmu/hw/vfio/platform.o
  CC      arm-softmmu/hw/gpio/omap_gpio.o
  CC      hppa-softmmu/tcg/tcg.o
  CC      alpha-softmmu/hw/vfio/spapr.o
  CC      arm-softmmu/hw/gpio/imx_gpio.o
  CC      arm-softmmu/hw/gpio/bcm2835_gpio.o
  CC      alpha-softmmu/hw/virtio/virtio.o
  CC      arm-softmmu/hw/i2c/omap_i2c.o
  CC      arm-softmmu/hw/input/pxa2xx_keypad.o
  CC      arm-softmmu/hw/input/tsc210x.o
  CC      alpha-softmmu/hw/virtio/virtio-balloon.o
  CC      arm-softmmu/hw/intc/armv7m_nvic.o
  CC      hppa-softmmu/tcg/tcg-op.o
  CC      alpha-softmmu/hw/virtio/virtio-crypto.o
  CC      alpha-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      arm-softmmu/hw/intc/exynos4210_gic.o
  CC      alpha-softmmu/hw/virtio/vhost.o
  CC      arm-softmmu/hw/intc/exynos4210_combiner.o
  CC      arm-softmmu/hw/intc/omap_intc.o
  CC      alpha-softmmu/hw/virtio/vhost-backend.o
  CC      arm-softmmu/hw/intc/bcm2835_ic.o
  CC      alpha-softmmu/hw/virtio/vhost-user.o
  CC      arm-softmmu/hw/intc/bcm2836_control.o
  CC      hppa-softmmu/tcg/tcg-op-vec.o
  CC      arm-softmmu/hw/intc/allwinner-a10-pic.o
  CC      arm-softmmu/hw/intc/aspeed_vic.o
  CC      alpha-softmmu/hw/virtio/vhost-vsock.o
  CC      hppa-softmmu/tcg/tcg-op-gvec.o
  CC      arm-softmmu/hw/intc/arm_gicv3_cpuif.o
  CC      alpha-softmmu/hw/alpha/dp264.o
  CC      alpha-softmmu/hw/alpha/pci.o
  CC      alpha-softmmu/hw/alpha/typhoon.o
  CC      alpha-softmmu/target/alpha/machine.o
  CC      arm-softmmu/hw/misc/ivshmem.o
  CC      alpha-softmmu/target/alpha/translate.o
  CC      hppa-softmmu/tcg/tcg-common.o
  CC      arm-softmmu/hw/misc/arm_sysctl.o
  CC      hppa-softmmu/tcg/optimize.o
  CC      arm-softmmu/hw/misc/cbus.o
  CC      arm-softmmu/hw/misc/exynos4210_pmu.o
  CC      arm-softmmu/hw/misc/exynos4210_clk.o
  CC      hppa-softmmu/fpu/softfloat.o
  CC      arm-softmmu/hw/misc/exynos4210_rng.o
  CC      arm-softmmu/hw/misc/imx_ccm.o
  CC      alpha-softmmu/target/alpha/helper.o
  CC      arm-softmmu/hw/misc/imx31_ccm.o
  CC      alpha-softmmu/target/alpha/cpu.o
  CC      arm-softmmu/hw/misc/imx25_ccm.o
  CC      alpha-softmmu/target/alpha/int_helper.o
  CC      arm-softmmu/hw/misc/imx6_ccm.o
  CC      alpha-softmmu/target/alpha/fpu_helper.o
  CC      arm-softmmu/hw/misc/imx6_src.o
  CC      arm-softmmu/hw/misc/imx7_ccm.o
  CC      alpha-softmmu/target/alpha/vax_helper.o
  CC      arm-softmmu/hw/misc/imx2_wdt.o
  CC      alpha-softmmu/target/alpha/sys_helper.o
  CC      arm-softmmu/hw/misc/imx7_snvs.o
  CC      arm-softmmu/hw/misc/imx7_gpr.o
  CC      alpha-softmmu/target/alpha/mem_helper.o
  CC      arm-softmmu/hw/misc/mst_fpga.o
  CC      alpha-softmmu/target/alpha/gdbstub.o
  CC      arm-softmmu/hw/misc/omap_clk.o
  GEN     trace/generated-helpers.c
  CC      alpha-softmmu/trace/control-target.o
  CC      arm-softmmu/hw/misc/omap_gpmc.o
  CC      alpha-softmmu/trace/generated-helpers.o
  CC      arm-softmmu/hw/misc/omap_l4.o
  LINK    alpha-softmmu/qemu-system-alpha
  CC      arm-softmmu/hw/misc/omap_sdrc.o
  CC      arm-softmmu/hw/misc/omap_tap.o
  CC      arm-softmmu/hw/misc/bcm2835_mbox.o
  CC      hppa-softmmu/disas.o
  CC      arm-softmmu/hw/misc/bcm2835_property.o
  CC      hppa-softmmu/arch_init.o
  CC      arm-softmmu/hw/misc/bcm2835_rng.o
  CC      hppa-softmmu/cpus.o
  CC      arm-softmmu/hw/misc/zynq_slcr.o
  CC      arm-softmmu/hw/misc/zynq-xadc.o
  CC      aarch64-softmmu/hw/cpu/a15mpcore.o
  CC      hppa-softmmu/monitor.o
  CC      aarch64-softmmu/hw/display/omap_dss.o
  CC      arm-softmmu/hw/misc/stm32f2xx_syscfg.o
  CC      hppa-softmmu/gdbstub.o
  CC      arm-softmmu/hw/misc/mps2-fpgaio.o
  CC      aarch64-softmmu/hw/display/omap_lcdc.o
  CC      arm-softmmu/hw/misc/mps2-scc.o
  CC      hppa-softmmu/balloon.o
  CC      arm-softmmu/hw/misc/tz-ppc.o
  CC      aarch64-softmmu/hw/display/pxa2xx_lcd.o
  CC      hppa-softmmu/ioport.o
  CC      arm-softmmu/hw/misc/iotkit-secctl.o
  CC      hppa-softmmu/numa.o
  CC      arm-softmmu/hw/misc/aspeed_scu.o
  GEN     i386-softmmu/hmp-commands.h
  CC      hppa-softmmu/qtest.o
  GEN     i386-softmmu/hmp-commands-info.h
  GEN     i386-softmmu/config-target.h
  CC      i386-softmmu/exec.o
  CC      arm-softmmu/hw/misc/aspeed_sdmc.o
  CC      arm-softmmu/hw/misc/mmio_interface.o
  CC      hppa-softmmu/memory.o
  CC      arm-softmmu/hw/misc/msf2-sysreg.o
  CC      arm-softmmu/hw/net/virtio-net.o
  CC      arm-softmmu/hw/net/vhost_net.o
  CC      hppa-softmmu/memory_mapping.o
  CC      arm-softmmu/hw/pcmcia/pxa2xx.o
  CC      hppa-softmmu/dump.o
  CC      arm-softmmu/hw/scsi/virtio-scsi.o
  CC      i386-softmmu/tcg/tcg.o
  CC      arm-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      hppa-softmmu/migration/ram.o
  CC      arm-softmmu/hw/scsi/vhost-scsi-common.o
  CC      arm-softmmu/hw/scsi/vhost-scsi.o
  CC      arm-softmmu/hw/scsi/vhost-user-scsi.o
  CC      arm-softmmu/hw/sd/omap_mmc.o
  CC      hppa-softmmu/accel/accel.o
  CC      hppa-softmmu/accel/stubs/hax-stub.o
  CC      arm-softmmu/hw/sd/pxa2xx_mmci.o
  CC      hppa-softmmu/accel/stubs/hvf-stub.o
  CC      arm-softmmu/hw/sd/bcm2835_sdhost.o
  CC      hppa-softmmu/accel/stubs/whpx-stub.o
  CC      i386-softmmu/tcg/tcg-op.o
  CC      hppa-softmmu/accel/stubs/kvm-stub.o
  CC      arm-softmmu/hw/ssi/omap_spi.o
  CC      hppa-softmmu/accel/tcg/tcg-all.o
  CC      arm-softmmu/hw/ssi/imx_spi.o
  CC      hppa-softmmu/accel/tcg/cputlb.o
  CC      arm-softmmu/hw/timer/exynos4210_mct.o
  CC      arm-softmmu/hw/timer/exynos4210_pwm.o
  CC      arm-softmmu/hw/timer/exynos4210_rtc.o
  CC      arm-softmmu/hw/timer/omap_gptimer.o
  CC      arm-softmmu/hw/timer/omap_synctimer.o
  CC      arm-softmmu/hw/timer/pxa2xx_timer.o
  CC      i386-softmmu/tcg/tcg-op-vec.o
  CC      arm-softmmu/hw/timer/digic-timer.o
  CC      arm-softmmu/hw/timer/allwinner-a10-pit.o
  CC      i386-softmmu/tcg/tcg-op-gvec.o
  CC      arm-softmmu/hw/usb/tusb6010.o
  CC      hppa-softmmu/accel/tcg/tcg-runtime.o
  CC      arm-softmmu/hw/usb/chipidea.o
  CC      hppa-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      arm-softmmu/hw/vfio/common.o
  CC      arm-softmmu/hw/vfio/pci.o
  CC      hppa-softmmu/accel/tcg/cpu-exec.o
  CC      i386-softmmu/tcg/tcg-common.o
  CC      hppa-softmmu/accel/tcg/cpu-exec-common.o
  CC      i386-softmmu/tcg/optimize.o
  CC      hppa-softmmu/accel/tcg/translate-all.o
  CC      hppa-softmmu/accel/tcg/translator.o
  CC      arm-softmmu/hw/vfio/pci-quirks.o
  CC      i386-softmmu/fpu/softfloat.o
  CC      hppa-softmmu/hw/9pfs/virtio-9p-device.o
  CC      hppa-softmmu/hw/block/virtio-blk.o
  CC      arm-softmmu/hw/vfio/display.o
  CC      hppa-softmmu/hw/block/vhost-user-blk.o
  CC      arm-softmmu/hw/vfio/platform.o
  CC      hppa-softmmu/hw/block/dataplane/virtio-blk.o
  CC      hppa-softmmu/hw/char/virtio-serial-bus.o
  CC      arm-softmmu/hw/vfio/calxeda-xgmac.o
  CC      arm-softmmu/hw/vfio/amd-xgbe.o
  CC      hppa-softmmu/hw/core/generic-loader.o
  CC      arm-softmmu/hw/vfio/spapr.o
  CC      hppa-softmmu/hw/core/null-machine.o
  CC      hppa-softmmu/hw/display/vga.o
  CC      arm-softmmu/hw/virtio/virtio.o
  CC      hppa-softmmu/hw/display/virtio-gpu.o
  CC      arm-softmmu/hw/virtio/virtio-balloon.o
  CC      i386-softmmu/disas.o
  CC      arm-softmmu/hw/virtio/virtio-crypto.o
  GEN     i386-softmmu/gdbstub-xml.c
  CC      hppa-softmmu/hw/display/virtio-gpu-3d.o
  CC      i386-softmmu/arch_init.o
  CC      arm-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      i386-softmmu/cpus.o
  CC      hppa-softmmu/hw/display/virtio-gpu-pci.o
  CC      arm-softmmu/hw/virtio/vhost.o
  CC      i386-softmmu/monitor.o
  CC      hppa-softmmu/hw/display/virtio-vga.o
  CC      arm-softmmu/hw/virtio/vhost-backend.o
  CC      hppa-softmmu/hw/misc/ivshmem.o
  CC      arm-softmmu/hw/virtio/vhost-user.o
  CC      hppa-softmmu/hw/misc/mmio_interface.o
  CC      hppa-softmmu/hw/net/virtio-net.o
  CC      arm-softmmu/hw/virtio/vhost-vsock.o
  CC      arm-softmmu/hw/arm/boot.o
  CC      i386-softmmu/gdbstub.o
  CC      hppa-softmmu/hw/net/vhost_net.o
  CC      arm-softmmu/hw/arm/virt.o
  CC      hppa-softmmu/hw/scsi/virtio-scsi.o
  CC      i386-softmmu/balloon.o
  CC      i386-softmmu/ioport.o
  CC      hppa-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      i386-softmmu/numa.o
  CC      arm-softmmu/hw/arm/sysbus-fdt.o
  CC      hppa-softmmu/hw/scsi/vhost-scsi-common.o
  CC      hppa-softmmu/hw/scsi/vhost-scsi.o
  CC      i386-softmmu/qtest.o
  CC      arm-softmmu/hw/arm/virt-acpi-build.o
  CC      hppa-softmmu/hw/scsi/vhost-user-scsi.o
  CC      i386-softmmu/memory.o
  CC      hppa-softmmu/hw/timer/mc146818rtc.o
  CC      arm-softmmu/hw/arm/digic_boards.o
  CC      arm-softmmu/hw/arm/exynos4_boards.o
  CC      hppa-softmmu/hw/vfio/common.o
  CC      arm-softmmu/hw/arm/highbank.o
  CC      arm-softmmu/hw/arm/integratorcp.o
  CC      i386-softmmu/memory_mapping.o
  CC      hppa-softmmu/hw/vfio/pci.o
  CC      arm-softmmu/hw/arm/mainstone.o
  CC      i386-softmmu/dump.o
  CC      arm-softmmu/hw/arm/musicpal.o
  CC      arm-softmmu/hw/arm/netduino2.o
  CC      i386-softmmu/migration/ram.o
  CC      hppa-softmmu/hw/vfio/pci-quirks.o
  CC      arm-softmmu/hw/arm/nseries.o
  CC      arm-softmmu/hw/arm/omap_sx1.o
  CC      hppa-softmmu/hw/vfio/display.o
  CC      i386-softmmu/accel/accel.o
  CC      arm-softmmu/hw/arm/palm.o
  CC      i386-softmmu/accel/stubs/hax-stub.o
  CC      hppa-softmmu/hw/vfio/platform.o
  CC      i386-softmmu/accel/stubs/hvf-stub.o
  CC      arm-softmmu/hw/arm/gumstix.o
  CC      i386-softmmu/accel/stubs/whpx-stub.o
  CC      arm-softmmu/hw/arm/spitz.o
  CC      hppa-softmmu/hw/vfio/spapr.o
  CC      i386-softmmu/accel/stubs/kvm-stub.o
  CC      i386-softmmu/accel/tcg/tcg-all.o
  CC      hppa-softmmu/hw/virtio/virtio.o
  CC      arm-softmmu/hw/arm/tosa.o
  CC      i386-softmmu/accel/tcg/cputlb.o
  CC      arm-softmmu/hw/arm/z2.o
  CC      arm-softmmu/hw/arm/realview.o
  CC      hppa-softmmu/hw/virtio/virtio-balloon.o
  CC      arm-softmmu/hw/arm/stellaris.o
  CC      hppa-softmmu/hw/virtio/virtio-crypto.o
  CC      arm-softmmu/hw/arm/collie.o
  CC      arm-softmmu/hw/arm/vexpress.o
  CC      hppa-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      arm-softmmu/hw/arm/versatilepb.o
  CC      hppa-softmmu/hw/virtio/vhost.o
  CC      arm-softmmu/hw/arm/xilinx_zynq.o
  CC      i386-softmmu/accel/tcg/tcg-runtime.o
  CC      arm-softmmu/hw/arm/armv7m.o
  CC      hppa-softmmu/hw/virtio/vhost-backend.o
  CC      i386-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      arm-softmmu/hw/arm/exynos4210.o
  CC      hppa-softmmu/hw/virtio/vhost-user.o
  CC      arm-softmmu/hw/arm/pxa2xx.o
  CC      hppa-softmmu/hw/virtio/vhost-vsock.o
  CC      i386-softmmu/accel/tcg/cpu-exec.o
  CC      hppa-softmmu/hw/hppa/machine.o
  CC      hppa-softmmu/hw/hppa/pci.o
  CC      arm-softmmu/hw/arm/pxa2xx_gpio.o
  CC      i386-softmmu/accel/tcg/cpu-exec-common.o
  CC      hppa-softmmu/hw/hppa/dino.o
  CC      i386-softmmu/accel/tcg/translate-all.o
  CC      arm-softmmu/hw/arm/pxa2xx_pic.o
  CC      hppa-softmmu/target/hppa/translate.o
  CC      arm-softmmu/hw/arm/digic.o
  CC      i386-softmmu/accel/tcg/translator.o
  CC      arm-softmmu/hw/arm/omap1.o
  CC      i386-softmmu/hw/9pfs/virtio-9p-device.o
  CC      i386-softmmu/hw/block/virtio-blk.o
  CC      arm-softmmu/hw/arm/omap2.o
  CC      i386-softmmu/hw/block/vhost-user-blk.o
  CC      i386-softmmu/hw/block/dataplane/virtio-blk.o
  CC      hppa-softmmu/target/hppa/helper.o
  CC      i386-softmmu/hw/char/virtio-serial-bus.o
  CC      arm-softmmu/hw/arm/strongarm.o
  CC      hppa-softmmu/target/hppa/cpu.o
  CC      hppa-softmmu/target/hppa/op_helper.o
  CC      arm-softmmu/hw/arm/allwinner-a10.o
  CC      i386-softmmu/hw/core/generic-loader.o
  CC      i386-softmmu/hw/core/null-machine.o
  CC      arm-softmmu/hw/arm/cubieboard.o
  CC      hppa-softmmu/target/hppa/gdbstub.o
  CC      i386-softmmu/hw/display/vga.o
  CC      arm-softmmu/hw/arm/bcm2835_peripherals.o
  CC      hppa-softmmu/target/hppa/mem_helper.o
  CC      hppa-softmmu/target/hppa/int_helper.o
  CC      arm-softmmu/hw/arm/bcm2836.o
  CC      hppa-softmmu/target/hppa/machine.o
  CC      arm-softmmu/hw/arm/raspi.o
  GEN     trace/generated-helpers.c
  CC      hppa-softmmu/trace/control-target.o
  CC      i386-softmmu/hw/display/virtio-gpu.o
  CC      hppa-softmmu/trace/generated-helpers.o
  CC      arm-softmmu/hw/arm/stm32f205_soc.o
  LINK    hppa-softmmu/qemu-system-hppa
  CC      arm-softmmu/hw/arm/fsl-imx25.o
  CC      i386-softmmu/hw/display/virtio-gpu-3d.o
  CC      arm-softmmu/hw/arm/imx25_pdk.o
  CC      arm-softmmu/hw/arm/fsl-imx31.o
  CC      i386-softmmu/hw/display/virtio-gpu-pci.o
  CC      arm-softmmu/hw/arm/kzm.o
  CC      arm-softmmu/hw/arm/fsl-imx6.o
  CC      i386-softmmu/hw/display/virtio-vga.o
  CC      arm-softmmu/hw/arm/sabrelite.o
  CC      i386-softmmu/hw/intc/apic.o
  CC      i386-softmmu/hw/intc/apic_common.o
  CC      arm-softmmu/hw/arm/aspeed_soc.o
  CC      i386-softmmu/hw/intc/ioapic.o
  CC      i386-softmmu/hw/isa/lpc_ich9.o
  CC      arm-softmmu/hw/arm/aspeed.o
  CC      i386-softmmu/hw/misc/ivshmem.o
  GEN     lm32-softmmu/hmp-commands.h
  GEN     lm32-softmmu/hmp-commands-info.h
  GEN     lm32-softmmu/config-target.h
  CC      lm32-softmmu/exec.o
  CC      i386-softmmu/hw/misc/pvpanic.o
  CC      i386-softmmu/hw/misc/mmio_interface.o
  CC      i386-softmmu/hw/net/virtio-net.o
  CC      i386-softmmu/hw/net/vhost_net.o
  CC      i386-softmmu/hw/scsi/virtio-scsi.o
  CC      lm32-softmmu/tcg/tcg.o
  CC      i386-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      i386-softmmu/hw/scsi/vhost-scsi-common.o
  CC      i386-softmmu/hw/scsi/vhost-scsi.o
  CC      i386-softmmu/hw/scsi/vhost-user-scsi.o
  CC      i386-softmmu/hw/timer/mc146818rtc.o
  CC      i386-softmmu/hw/vfio/common.o
  CC      lm32-softmmu/tcg/tcg-op.o
  CC      i386-softmmu/hw/vfio/pci.o
  CC      i386-softmmu/hw/vfio/pci-quirks.o
  CC      lm32-softmmu/tcg/tcg-op-vec.o
  CC      lm32-softmmu/tcg/tcg-op-gvec.o
  CC      i386-softmmu/hw/vfio/display.o
  CC      i386-softmmu/hw/vfio/platform.o
  CC      i386-softmmu/hw/vfio/spapr.o
  CC      i386-softmmu/hw/virtio/virtio.o
  CC      lm32-softmmu/tcg/tcg-common.o
  CC      lm32-softmmu/tcg/optimize.o
  CC      i386-softmmu/hw/virtio/virtio-balloon.o
  CC      lm32-softmmu/fpu/softfloat.o
  CC      i386-softmmu/hw/virtio/virtio-crypto.o
  CC      i386-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      i386-softmmu/hw/virtio/vhost.o
  CC      i386-softmmu/hw/virtio/vhost-backend.o
  CC      i386-softmmu/hw/virtio/vhost-user.o
  CC      i386-softmmu/hw/virtio/vhost-vsock.o
  CC      i386-softmmu/hw/i386/multiboot.o
  CC      i386-softmmu/hw/i386/pc.o
  CC      lm32-softmmu/disas.o
  CC      i386-softmmu/hw/i386/pc_piix.o
  CC      lm32-softmmu/arch_init.o
  CC      lm32-softmmu/cpus.o
  CC      i386-softmmu/hw/i386/pc_q35.o
  CC      lm32-softmmu/monitor.o
  CC      i386-softmmu/hw/i386/pc_sysfw.o
  CC      i386-softmmu/hw/i386/x86-iommu.o
  CC      i386-softmmu/hw/i386/intel_iommu.o
  CC      lm32-softmmu/gdbstub.o
  CC      i386-softmmu/hw/i386/amd_iommu.o
  CC      lm32-softmmu/balloon.o
  CC      i386-softmmu/hw/i386/vmport.o
  CC      lm32-softmmu/ioport.o
  CC      i386-softmmu/hw/i386/vmmouse.o
  CC      lm32-softmmu/numa.o
  CC      i386-softmmu/hw/i386/kvmvapic.o
  CC      lm32-softmmu/qtest.o
  CC      i386-softmmu/hw/i386/acpi-build.o
  CC      lm32-softmmu/memory.o
  CC      i386-softmmu/target/i386/helper.o
  CC      lm32-softmmu/memory_mapping.o
  CC      i386-softmmu/target/i386/cpu.o
  CC      lm32-softmmu/dump.o
  CC      i386-softmmu/target/i386/gdbstub.o
  CC      lm32-softmmu/migration/ram.o
  CC      i386-softmmu/target/i386/xsave_helper.o
  CC      i386-softmmu/target/i386/translate.o
  CC      lm32-softmmu/accel/accel.o
  CC      lm32-softmmu/accel/stubs/hax-stub.o
  CC      lm32-softmmu/accel/stubs/hvf-stub.o
  CC      lm32-softmmu/accel/stubs/whpx-stub.o
  CC      lm32-softmmu/accel/stubs/kvm-stub.o
  CC      lm32-softmmu/accel/tcg/tcg-all.o
  CC      lm32-softmmu/accel/tcg/cputlb.o
  CC      lm32-softmmu/accel/tcg/tcg-runtime.o
  CC      lm32-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      lm32-softmmu/accel/tcg/cpu-exec.o
  CC      lm32-softmmu/accel/tcg/cpu-exec-common.o
  CC      lm32-softmmu/accel/tcg/translate-all.o
  CC      i386-softmmu/target/i386/bpt_helper.o
  CC      lm32-softmmu/accel/tcg/translator.o
  CC      i386-softmmu/target/i386/cc_helper.o
  CC      lm32-softmmu/hw/core/generic-loader.o
  CC      i386-softmmu/target/i386/excp_helper.o
  CC      lm32-softmmu/hw/core/null-machine.o
  CC      i386-softmmu/target/i386/fpu_helper.o
  CC      lm32-softmmu/hw/input/milkymist-softusb.o
  CC      lm32-softmmu/hw/misc/milkymist-hpdmc.o
  CC      lm32-softmmu/hw/misc/milkymist-pfpu.o
  CC      lm32-softmmu/hw/misc/mmio_interface.o
  CC      lm32-softmmu/hw/net/milkymist-minimac2.o
  CC      lm32-softmmu/hw/net/vhost_net.o
  CC      lm32-softmmu/hw/net/rocker/qmp-norocker.o
  CC      lm32-softmmu/hw/sd/milkymist-memcard.o
  CC      lm32-softmmu/hw/vfio/common.o
  CC      i386-softmmu/target/i386/int_helper.o
  CC      lm32-softmmu/hw/vfio/platform.o
  CC      i386-softmmu/target/i386/mem_helper.o
  CC      i386-softmmu/target/i386/misc_helper.o
  CC      lm32-softmmu/hw/vfio/spapr.o
  CC      i386-softmmu/target/i386/mpx_helper.o
  CC      lm32-softmmu/hw/lm32/lm32_boards.o
  CC      lm32-softmmu/hw/lm32/milkymist.o
  CC      i386-softmmu/target/i386/seg_helper.o
  CC      lm32-softmmu/target/lm32/translate.o
  CC      lm32-softmmu/target/lm32/op_helper.o
  CC      lm32-softmmu/target/lm32/helper.o
  CC      lm32-softmmu/target/lm32/cpu.o
  CC      lm32-softmmu/target/lm32/gdbstub.o
  CC      lm32-softmmu/target/lm32/lm32-semi.o
  CC      i386-softmmu/target/i386/smm_helper.o
  CC      lm32-softmmu/target/lm32/machine.o
  CC      i386-softmmu/target/i386/svm_helper.o
  GEN     trace/generated-helpers.c
  CC      lm32-softmmu/trace/control-target.o
  CC      lm32-softmmu/trace/generated-helpers.o
  CC      i386-softmmu/target/i386/machine.o
  LINK    lm32-softmmu/qemu-system-lm32
  CC      i386-softmmu/target/i386/arch_memory_mapping.o
  CC      i386-softmmu/target/i386/arch_dump.o
  CC      i386-softmmu/target/i386/monitor.o
  CC      i386-softmmu/target/i386/kvm-stub.o
  CC      i386-softmmu/target/i386/sev-stub.o
  CC      arm-softmmu/hw/arm/mps2.o
  GEN     m68k-softmmu/hmp-commands.h
  CC      arm-softmmu/hw/arm/mps2-tz.o
  GEN     m68k-softmmu/hmp-commands-info.h
  GEN     m68k-softmmu/config-target.h
  CC      m68k-softmmu/exec.o
  CC      arm-softmmu/hw/arm/msf2-soc.o
  CC      arm-softmmu/hw/arm/msf2-som.o
  CC      arm-softmmu/hw/arm/iotkit.o
  CC      arm-softmmu/hw/arm/fsl-imx7.o
  CC      arm-softmmu/hw/arm/mcimx7d-sabre.o
  CC      arm-softmmu/target/arm/arm-semi.o
  CC      m68k-softmmu/tcg/tcg.o
  CC      arm-softmmu/target/arm/machine.o
  CC      arm-softmmu/target/arm/psci.o
  CC      arm-softmmu/target/arm/arch_dump.o
  CC      arm-softmmu/target/arm/monitor.o
  CC      arm-softmmu/target/arm/kvm-stub.o
  CC      arm-softmmu/target/arm/translate.o
  CC      m68k-softmmu/tcg/tcg-op.o
  CC      m68k-softmmu/tcg/tcg-op-vec.o
  CC      m68k-softmmu/tcg/tcg-op-gvec.o
  CC      m68k-softmmu/tcg/tcg-common.o
  CC      m68k-softmmu/tcg/optimize.o
  CC      m68k-softmmu/fpu/softfloat.o
  CC      arm-softmmu/target/arm/op_helper.o
  CC      arm-softmmu/target/arm/helper.o
  CC      m68k-softmmu/disas.o
  GEN     m68k-softmmu/gdbstub-xml.c
  CC      m68k-softmmu/arch_init.o
  CC      m68k-softmmu/cpus.o
  CC      m68k-softmmu/monitor.o
  CC      m68k-softmmu/gdbstub.o
  CC      arm-softmmu/target/arm/cpu.o
  CC      m68k-softmmu/balloon.o
  CC      arm-softmmu/target/arm/neon_helper.o
  CC      m68k-softmmu/ioport.o
  CC      m68k-softmmu/numa.o
  CC      m68k-softmmu/qtest.o
  CC      arm-softmmu/target/arm/iwmmxt_helper.o
  CC      m68k-softmmu/memory.o
  CC      arm-softmmu/target/arm/vec_helper.o
  CC      arm-softmmu/target/arm/gdbstub.o
  CC      m68k-softmmu/memory_mapping.o
  CC      arm-softmmu/target/arm/crypto_helper.o
  CC      m68k-softmmu/dump.o
  CC      arm-softmmu/target/arm/arm-powerctl.o
  GEN     trace/generated-helpers.c
  CC      arm-softmmu/trace/control-target.o
  CC      m68k-softmmu/migration/ram.o
  CC      arm-softmmu/gdbstub-xml.o
  CC      arm-softmmu/trace/generated-helpers.o
  LINK    arm-softmmu/qemu-system-arm
  CC      m68k-softmmu/accel/accel.o
  CC      m68k-softmmu/accel/stubs/hax-stub.o
  CC      m68k-softmmu/accel/stubs/hvf-stub.o
  CC      m68k-softmmu/accel/stubs/whpx-stub.o
  CC      m68k-softmmu/accel/stubs/kvm-stub.o
  CC      m68k-softmmu/accel/tcg/tcg-all.o
  CC      m68k-softmmu/accel/tcg/cputlb.o
  GEN     microblazeel-softmmu/hmp-commands.h
  GEN     microblazeel-softmmu/hmp-commands-info.h
  GEN     microblazeel-softmmu/config-target.h
  CC      microblazeel-softmmu/exec.o
  CC      microblazeel-softmmu/tcg/tcg.o
  CC      microblazeel-softmmu/tcg/tcg-op.o
  CC      microblazeel-softmmu/tcg/tcg-op-vec.o
  CC      microblazeel-softmmu/tcg/tcg-op-gvec.o
  CC      microblazeel-softmmu/tcg/tcg-common.o
  CC      microblazeel-softmmu/tcg/optimize.o
  CC      microblazeel-softmmu/fpu/softfloat.o
  CC      microblazeel-softmmu/disas.o
  CC      microblazeel-softmmu/arch_init.o
  CC      microblazeel-softmmu/cpus.o
  CC      microblazeel-softmmu/monitor.o
  CC      microblazeel-softmmu/gdbstub.o
  CC      microblazeel-softmmu/balloon.o
  CC      microblazeel-softmmu/ioport.o
  CC      microblazeel-softmmu/numa.o
  CC      microblazeel-softmmu/qtest.o
  CC      microblazeel-softmmu/memory.o
  CC      microblazeel-softmmu/memory_mapping.o
  CC      microblazeel-softmmu/dump.o
  CC      microblazeel-softmmu/migration/ram.o
  CC      microblazeel-softmmu/accel/accel.o
  CC      microblazeel-softmmu/accel/stubs/hax-stub.o
  CC      microblazeel-softmmu/accel/stubs/hvf-stub.o
  CC      microblazeel-softmmu/accel/stubs/whpx-stub.o
  CC      microblazeel-softmmu/accel/stubs/kvm-stub.o
  CC      microblazeel-softmmu/accel/tcg/tcg-all.o
  CC      microblazeel-softmmu/accel/tcg/cputlb.o
  CC      microblazeel-softmmu/accel/tcg/tcg-runtime.o
  CC      microblazeel-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      microblazeel-softmmu/accel/tcg/cpu-exec.o
  CC      microblazeel-softmmu/accel/tcg/cpu-exec-common.o
  CC      microblazeel-softmmu/accel/tcg/translate-all.o
  CC      microblazeel-softmmu/accel/tcg/translator.o
  CC      microblazeel-softmmu/hw/core/generic-loader.o
  CC      microblazeel-softmmu/hw/core/null-machine.o
  CC      microblazeel-softmmu/hw/dma/xlnx_dpdma.o
  CC      microblazeel-softmmu/hw/misc/mmio_interface.o
  CC      microblazeel-softmmu/hw/net/xilinx_ethlite.o
  CC      microblazeel-softmmu/hw/net/vhost_net.o
  CC      microblazeel-softmmu/hw/net/rocker/qmp-norocker.o
  CC      microblazeel-softmmu/hw/vfio/common.o
  CC      microblazeel-softmmu/hw/vfio/platform.o
  CC      microblazeel-softmmu/hw/vfio/spapr.o
  CC      microblazeel-softmmu/hw/microblaze/petalogix_s3adsp1800_mmu.o
  CC      microblazeel-softmmu/hw/microblaze/petalogix_ml605_mmu.o
  CC      microblazeel-softmmu/hw/microblaze/xlnx-zynqmp-pmu.o
  CC      microblazeel-softmmu/hw/microblaze/boot.o
  CC      microblazeel-softmmu/target/microblaze/translate.o
  CC      microblazeel-softmmu/target/microblaze/op_helper.o
  CC      microblazeel-softmmu/target/microblaze/helper.o
  CC      microblazeel-softmmu/target/microblaze/cpu.o
  CC      microblazeel-softmmu/target/microblaze/gdbstub.o
  CC      microblazeel-softmmu/target/microblaze/mmu.o
  GEN     trace/generated-helpers.c
  CC      microblazeel-softmmu/trace/control-target.o
  CC      microblazeel-softmmu/trace/generated-helpers.o
  LINK    microblazeel-softmmu/qemu-system-microblazeel
  GEN     microblaze-softmmu/hmp-commands.h
  GEN     microblaze-softmmu/hmp-commands-info.h
  GEN     microblaze-softmmu/config-target.h
  CC      microblaze-softmmu/exec.o
  CC      microblaze-softmmu/tcg/tcg.o
  CC      microblaze-softmmu/tcg/tcg-op.o
  CC      microblaze-softmmu/tcg/tcg-op-vec.o
  CC      microblaze-softmmu/tcg/tcg-op-gvec.o
  CC      microblaze-softmmu/tcg/tcg-common.o
  CC      microblaze-softmmu/tcg/optimize.o
  CC      microblaze-softmmu/fpu/softfloat.o
  CC      microblaze-softmmu/disas.o
  CC      microblaze-softmmu/arch_init.o
  CC      microblaze-softmmu/cpus.o
  CC      microblaze-softmmu/monitor.o
  CC      microblaze-softmmu/gdbstub.o
  CC      microblaze-softmmu/balloon.o
  CC      microblaze-softmmu/ioport.o
  CC      microblaze-softmmu/numa.o
  CC      microblaze-softmmu/qtest.o
  CC      microblaze-softmmu/memory.o
  CC      microblaze-softmmu/memory_mapping.o
  CC      microblaze-softmmu/dump.o
  CC      microblaze-softmmu/migration/ram.o
  CC      microblaze-softmmu/accel/accel.o
  CC      microblaze-softmmu/accel/stubs/hax-stub.o
  CC      microblaze-softmmu/accel/stubs/hvf-stub.o
  CC      microblaze-softmmu/accel/stubs/whpx-stub.o
  CC      microblaze-softmmu/accel/stubs/kvm-stub.o
  CC      microblaze-softmmu/accel/tcg/tcg-all.o
  CC      microblaze-softmmu/accel/tcg/cputlb.o
  CC      microblaze-softmmu/accel/tcg/tcg-runtime.o
  CC      microblaze-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      microblaze-softmmu/accel/tcg/cpu-exec.o
  CC      microblaze-softmmu/accel/tcg/cpu-exec-common.o
  CC      microblaze-softmmu/accel/tcg/translate-all.o
  CC      microblaze-softmmu/accel/tcg/translator.o
  CC      microblaze-softmmu/hw/core/generic-loader.o
  CC      microblaze-softmmu/hw/core/null-machine.o
  CC      microblaze-softmmu/hw/dma/xlnx_dpdma.o
  CC      microblaze-softmmu/hw/misc/mmio_interface.o
  CC      microblaze-softmmu/hw/net/xilinx_ethlite.o
  CC      microblaze-softmmu/hw/net/vhost_net.o
  CC      microblaze-softmmu/hw/net/rocker/qmp-norocker.o
  CC      microblaze-softmmu/hw/vfio/common.o
  CC      microblaze-softmmu/hw/vfio/platform.o
  CC      microblaze-softmmu/hw/vfio/spapr.o
  CC      microblaze-softmmu/hw/microblaze/petalogix_s3adsp1800_mmu.o
  CC      microblaze-softmmu/hw/microblaze/petalogix_ml605_mmu.o
  CC      microblaze-softmmu/hw/microblaze/xlnx-zynqmp-pmu.o
  CC      microblaze-softmmu/hw/microblaze/boot.o
  CC      microblaze-softmmu/target/microblaze/translate.o
  CC      microblaze-softmmu/target/microblaze/op_helper.o
  CC      microblaze-softmmu/target/microblaze/helper.o
  CC      microblaze-softmmu/target/microblaze/cpu.o
  CC      microblaze-softmmu/target/microblaze/gdbstub.o
  CC      microblaze-softmmu/target/microblaze/mmu.o
  GEN     trace/generated-helpers.c
  CC      microblaze-softmmu/trace/control-target.o
  CC      microblaze-softmmu/trace/generated-helpers.o
  LINK    microblaze-softmmu/qemu-system-microblaze
  CC      m68k-softmmu/accel/tcg/tcg-runtime.o
  CC      m68k-softmmu/accel/tcg/tcg-runtime-gvec.o
  GEN     mips64el-softmmu/hmp-commands.h
  GEN     mips64el-softmmu/hmp-commands-info.h
  GEN     mips64el-softmmu/config-target.h
  CC      mips64el-softmmu/exec.o
  CC      m68k-softmmu/accel/tcg/cpu-exec.o
  CC      m68k-softmmu/accel/tcg/cpu-exec-common.o
  CC      m68k-softmmu/accel/tcg/translate-all.o
  CC      m68k-softmmu/accel/tcg/translator.o
  CC      mips64el-softmmu/tcg/tcg.o
  CC      m68k-softmmu/hw/char/mcf_uart.o
  CC      m68k-softmmu/hw/core/generic-loader.o
  CC      m68k-softmmu/hw/core/null-machine.o
  CC      m68k-softmmu/hw/misc/mmio_interface.o
  CC      m68k-softmmu/hw/net/mcf_fec.o
  CC      m68k-softmmu/hw/net/vhost_net.o
  CC      m68k-softmmu/hw/net/rocker/qmp-norocker.o
  CC      m68k-softmmu/hw/vfio/common.o
  CC      mips64el-softmmu/tcg/tcg-op.o
  CC      m68k-softmmu/hw/vfio/platform.o
  CC      m68k-softmmu/hw/vfio/spapr.o
  CC      m68k-softmmu/hw/m68k/an5206.o
  CC      m68k-softmmu/hw/m68k/mcf5208.o
  CC      m68k-softmmu/hw/m68k/mcf5206.o
  CC      m68k-softmmu/hw/m68k/mcf_intc.o
  CC      m68k-softmmu/target/m68k/m68k-semi.o
  CC      mips64el-softmmu/tcg/tcg-op-vec.o
  CC      m68k-softmmu/target/m68k/translate.o
  CC      mips64el-softmmu/tcg/tcg-op-gvec.o
  CC      mips64el-softmmu/tcg/tcg-common.o
  CC      mips64el-softmmu/tcg/optimize.o
  CC      m68k-softmmu/target/m68k/op_helper.o
  CC      mips64el-softmmu/fpu/softfloat.o
  CC      m68k-softmmu/target/m68k/helper.o
  CC      m68k-softmmu/target/m68k/cpu.o
  CC      m68k-softmmu/target/m68k/fpu_helper.o
  CC      m68k-softmmu/target/m68k/softfloat.o
  CC      m68k-softmmu/target/m68k/gdbstub.o
  CC      m68k-softmmu/target/m68k/monitor.o
  GEN     trace/generated-helpers.c
  CC      m68k-softmmu/trace/control-target.o
  CC      m68k-softmmu/gdbstub-xml.o
  CC      m68k-softmmu/trace/generated-helpers.o
  LINK    m68k-softmmu/qemu-system-m68k
  CC      mips64el-softmmu/disas.o
  CC      mips64el-softmmu/arch_init.o
  CC      mips64el-softmmu/cpus.o
  GEN     trace/generated-helpers.c
  CC      i386-softmmu/trace/control-target.o
  CC      mips64el-softmmu/monitor.o
  CC      i386-softmmu/gdbstub-xml.o
  CC      i386-softmmu/trace/generated-helpers.o
  GEN     mips64-softmmu/hmp-commands.h
  GEN     mips64-softmmu/hmp-commands-info.h
  GEN     mips64-softmmu/config-target.h
  CC      mips64-softmmu/exec.o
  LINK    i386-softmmu/qemu-system-i386
  CC      mips64el-softmmu/gdbstub.o
  CC      mips64el-softmmu/balloon.o
  CC      mips64-softmmu/tcg/tcg.o
  CC      mips64el-softmmu/ioport.o
  GEN     mipsel-softmmu/hmp-commands.h
  GEN     mipsel-softmmu/hmp-commands-info.h
  GEN     mipsel-softmmu/config-target.h
  CC      mipsel-softmmu/exec.o
  CC      mips64-softmmu/tcg/tcg-op.o
  CC      mipsel-softmmu/tcg/tcg.o
  CC      mips64-softmmu/tcg/tcg-op-vec.o
  CC      mipsel-softmmu/tcg/tcg-op.o
  CC      mips64-softmmu/tcg/tcg-op-gvec.o
  CC      mipsel-softmmu/tcg/tcg-op-vec.o
  CC      mips64-softmmu/tcg/tcg-common.o
  CC      mips64-softmmu/tcg/optimize.o
  CC      mipsel-softmmu/tcg/tcg-op-gvec.o
  CC      mips64-softmmu/fpu/softfloat.o
  CC      mipsel-softmmu/tcg/tcg-common.o
  CC      mipsel-softmmu/tcg/optimize.o
  CC      mipsel-softmmu/fpu/softfloat.o
  CC      mips64-softmmu/disas.o
  CC      mips64-softmmu/arch_init.o
  CC      mips64-softmmu/cpus.o
  CC      mips64-softmmu/monitor.o
  CC      mipsel-softmmu/disas.o
  CC      mipsel-softmmu/arch_init.o
  CC      mips64-softmmu/gdbstub.o
  CC      mipsel-softmmu/cpus.o
  CC      mips64-softmmu/balloon.o
  CC      mipsel-softmmu/monitor.o
  CC      mips64-softmmu/ioport.o
  CC      mips64-softmmu/numa.o
  CC      mips64-softmmu/qtest.o
  CC      mips64-softmmu/memory.o
  CC      mipsel-softmmu/gdbstub.o
  CC      mipsel-softmmu/balloon.o
  CC      mipsel-softmmu/ioport.o
  CC      mips64-softmmu/memory_mapping.o
  CC      mips64-softmmu/dump.o
  CC      mipsel-softmmu/numa.o
  CC      mipsel-softmmu/qtest.o
  CC      mips64-softmmu/migration/ram.o
  CC      mipsel-softmmu/memory.o
  CC      mips64-softmmu/accel/accel.o
  CC      mips64-softmmu/accel/stubs/hax-stub.o
  CC      mipsel-softmmu/memory_mapping.o
  CC      mips64-softmmu/accel/stubs/hvf-stub.o
  CC      mips64-softmmu/accel/stubs/whpx-stub.o
  CC      mipsel-softmmu/dump.o
  CC      mips64-softmmu/accel/stubs/kvm-stub.o
  CC      mips64-softmmu/accel/tcg/tcg-all.o
  CC      mips64-softmmu/accel/tcg/cputlb.o
  CC      mipsel-softmmu/migration/ram.o
  CC      mipsel-softmmu/accel/accel.o
  CC      mipsel-softmmu/accel/stubs/hax-stub.o
  CC      mipsel-softmmu/accel/stubs/hvf-stub.o
  CC      mipsel-softmmu/accel/stubs/whpx-stub.o
  CC      mipsel-softmmu/accel/stubs/kvm-stub.o
  CC      mipsel-softmmu/accel/tcg/tcg-all.o
  CC      mipsel-softmmu/accel/tcg/cputlb.o
  CC      mips64-softmmu/accel/tcg/tcg-runtime.o
  CC      mips64-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      mips64-softmmu/accel/tcg/cpu-exec.o
  CC      mips64-softmmu/accel/tcg/cpu-exec-common.o
  CC      mips64-softmmu/accel/tcg/translate-all.o
  CC      mipsel-softmmu/accel/tcg/tcg-runtime.o
  CC      mips64-softmmu/accel/tcg/translator.o
  CC      mipsel-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      mips64-softmmu/hw/9pfs/virtio-9p-device.o
  CC      mips64-softmmu/hw/block/virtio-blk.o
  CC      mipsel-softmmu/accel/tcg/cpu-exec.o
  CC      mips64-softmmu/hw/block/vhost-user-blk.o
  CC      mipsel-softmmu/accel/tcg/cpu-exec-common.o
  CC      mipsel-softmmu/accel/tcg/translate-all.o
  CC      mips64-softmmu/hw/block/dataplane/virtio-blk.o
  CC      mips64-softmmu/hw/char/virtio-serial-bus.o
  CC      mipsel-softmmu/accel/tcg/translator.o
  CC      mips64-softmmu/hw/core/generic-loader.o
  CC      mips64-softmmu/hw/core/null-machine.o
  CC      mipsel-softmmu/hw/9pfs/virtio-9p-device.o
  CC      mips64-softmmu/hw/display/vga.o
  CC      mipsel-softmmu/hw/block/virtio-blk.o
  CC      mipsel-softmmu/hw/block/vhost-user-blk.o
  CC      mipsel-softmmu/hw/block/dataplane/virtio-blk.o
  CC      mips64-softmmu/hw/display/virtio-gpu.o
  CC      mipsel-softmmu/hw/char/virtio-serial-bus.o
  CC      mipsel-softmmu/hw/core/generic-loader.o
  CC      mips64-softmmu/hw/display/virtio-gpu-3d.o
  CC      mipsel-softmmu/hw/core/null-machine.o
  CC      mipsel-softmmu/hw/display/vga.o
  CC      mips64-softmmu/hw/display/virtio-gpu-pci.o
  CC      mips64-softmmu/hw/intc/mips_gic.o
  CC      mips64-softmmu/hw/misc/ivshmem.o
  CC      mipsel-softmmu/hw/display/virtio-gpu.o
  CC      mips64-softmmu/hw/misc/mips_cmgcr.o
  CC      mips64-softmmu/hw/misc/mips_cpc.o
  CC      mipsel-softmmu/hw/display/virtio-gpu-3d.o
  CC      mips64-softmmu/hw/misc/mips_itu.o
  CC      mips64-softmmu/hw/misc/mmio_interface.o
  CC      mips64-softmmu/hw/net/virtio-net.o
  CC      mipsel-softmmu/hw/display/virtio-gpu-pci.o
  CC      mipsel-softmmu/hw/intc/mips_gic.o
  CC      mips64-softmmu/hw/net/vhost_net.o
  CC      mipsel-softmmu/hw/misc/ivshmem.o
  CC      mips64-softmmu/hw/scsi/virtio-scsi.o
  CC      mipsel-softmmu/hw/misc/mips_cmgcr.o
  CC      mips64-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      mipsel-softmmu/hw/misc/mips_cpc.o
  CC      mipsel-softmmu/hw/misc/mips_itu.o
  CC      mips64-softmmu/hw/scsi/vhost-scsi-common.o
  CC      mipsel-softmmu/hw/misc/mmio_interface.o
  CC      mips64-softmmu/hw/scsi/vhost-scsi.o
  CC      mipsel-softmmu/hw/net/virtio-net.o
  CC      mips64-softmmu/hw/scsi/vhost-user-scsi.o
  CC      mips64-softmmu/hw/timer/mips_gictimer.o
  CC      mips64-softmmu/hw/timer/mc146818rtc.o
  CC      mipsel-softmmu/hw/net/vhost_net.o
  CC      mipsel-softmmu/hw/scsi/virtio-scsi.o
  CC      mips64-softmmu/hw/vfio/common.o
  CC      mipsel-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      mipsel-softmmu/hw/scsi/vhost-scsi-common.o
  CC      mips64-softmmu/hw/vfio/pci.o
  CC      mipsel-softmmu/hw/scsi/vhost-scsi.o
  CC      mipsel-softmmu/hw/scsi/vhost-user-scsi.o
  CC      mipsel-softmmu/hw/timer/mips_gictimer.o
  CC      mipsel-softmmu/hw/timer/mc146818rtc.o
  CC      mips64-softmmu/hw/vfio/pci-quirks.o
  CC      mipsel-softmmu/hw/vfio/common.o
  CC      mips64-softmmu/hw/vfio/display.o
  CC      mipsel-softmmu/hw/vfio/pci.o
  CC      mips64-softmmu/hw/vfio/platform.o
  CC      mips64-softmmu/hw/vfio/spapr.o
  CC      mips64-softmmu/hw/virtio/virtio.o
  CC      mipsel-softmmu/hw/vfio/pci-quirks.o
  CC      mipsel-softmmu/hw/vfio/display.o
  CC      mips64-softmmu/hw/virtio/virtio-balloon.o
  CC      mipsel-softmmu/hw/vfio/platform.o
  CC      mips64-softmmu/hw/virtio/virtio-crypto.o
  CC      mipsel-softmmu/hw/vfio/spapr.o
  CC      mips64-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      mipsel-softmmu/hw/virtio/virtio.o
  CC      mips64-softmmu/hw/virtio/vhost.o
  CC      mips64-softmmu/hw/virtio/vhost-backend.o
  CC      mipsel-softmmu/hw/virtio/virtio-balloon.o
  CC      mips64-softmmu/hw/virtio/vhost-user.o
  CC      mipsel-softmmu/hw/virtio/virtio-crypto.o
  CC      mipsel-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      mips64-softmmu/hw/virtio/vhost-vsock.o
  CC      mips64-softmmu/hw/mips/mips_r4k.o
  CC      mipsel-softmmu/hw/virtio/vhost.o
  CC      mips64-softmmu/hw/mips/mips_malta.o
  CC      mipsel-softmmu/hw/virtio/vhost-backend.o
  CC      mips64-softmmu/hw/mips/mips_mipssim.o
  CC      mips64-softmmu/hw/mips/addr.o
  CC      mipsel-softmmu/hw/virtio/vhost-user.o
  CC      mips64-softmmu/hw/mips/mips_int.o
  CC      mips64-softmmu/hw/mips/mips_jazz.o
  CC      mipsel-softmmu/hw/virtio/vhost-vsock.o
  CC      mips64-softmmu/hw/mips/gt64xxx_pci.o
  CC      mipsel-softmmu/hw/mips/mips_r4k.o
  CC      mips64-softmmu/hw/mips/cps.o
  CC      mipsel-softmmu/hw/mips/mips_malta.o
  CC      mips64-softmmu/target/mips/translate.o
  CC      mipsel-softmmu/hw/mips/mips_mipssim.o
  CC      mipsel-softmmu/hw/mips/addr.o
  CC      mipsel-softmmu/hw/mips/mips_int.o
  CC      mipsel-softmmu/hw/mips/gt64xxx_pci.o
  CC      mipsel-softmmu/hw/mips/cps.o
  CC      mipsel-softmmu/target/mips/translate.o
  CC      mipsel-softmmu/target/mips/dsp_helper.o
  CC      mips64-softmmu/target/mips/dsp_helper.o
  CC      mipsel-softmmu/target/mips/op_helper.o
  CC      mips64-softmmu/target/mips/op_helper.o
  CC      mipsel-softmmu/target/mips/lmi_helper.o
  CC      mipsel-softmmu/target/mips/helper.o
  CC      mipsel-softmmu/target/mips/cpu.o
  CC      mips64-softmmu/target/mips/lmi_helper.o
  CC      mipsel-softmmu/target/mips/gdbstub.o
  CC      mipsel-softmmu/target/mips/msa_helper.o
  CC      mips64-softmmu/target/mips/helper.o
  CC      mips64-softmmu/target/mips/cpu.o
  CC      mips64-softmmu/target/mips/gdbstub.o
  CC      mips64-softmmu/target/mips/msa_helper.o
  CC      mipsel-softmmu/target/mips/mips-semi.o
  CC      mipsel-softmmu/target/mips/machine.o
  CC      mipsel-softmmu/target/mips/cp0_timer.o
  GEN     trace/generated-helpers.c
  CC      mipsel-softmmu/trace/control-target.o
  CC      mips64-softmmu/target/mips/mips-semi.o
  CC      mipsel-softmmu/trace/generated-helpers.o
  CC      mips64-softmmu/target/mips/machine.o
  LINK    mipsel-softmmu/qemu-system-mipsel
  CC      mips64-softmmu/target/mips/cp0_timer.o
  GEN     trace/generated-helpers.c
  CC      mips64-softmmu/trace/control-target.o
  CC      mips64-softmmu/trace/generated-helpers.o
  LINK    mips64-softmmu/qemu-system-mips64
  CC      mips64el-softmmu/numa.o
  CC      aarch64-softmmu/hw/display/bcm2835_fb.o
  CC      aarch64-softmmu/hw/display/vga.o
  GEN     mips-softmmu/hmp-commands.h
  GEN     mips-softmmu/hmp-commands-info.h
  GEN     mips-softmmu/config-target.h
  CC      mips-softmmu/exec.o
  CC      mips64el-softmmu/qtest.o
  CC      aarch64-softmmu/hw/display/virtio-gpu.o
  CC      mips64el-softmmu/memory.o
  GEN     moxie-softmmu/hmp-commands.h
  GEN     moxie-softmmu/hmp-commands-info.h
  GEN     moxie-softmmu/config-target.h
  CC      moxie-softmmu/exec.o
  CC      aarch64-softmmu/hw/display/virtio-gpu-3d.o
  CC      mips64el-softmmu/memory_mapping.o
  CC      aarch64-softmmu/hw/display/virtio-gpu-pci.o
  CC      mips64el-softmmu/dump.o
  CC      aarch64-softmmu/hw/display/dpcd.o
  CC      aarch64-softmmu/hw/display/xlnx_dp.o
  CC      mips64el-softmmu/migration/ram.o
  CC      aarch64-softmmu/hw/dma/xlnx_dpdma.o
  CC      moxie-softmmu/tcg/tcg.o
  CC      aarch64-softmmu/hw/dma/omap_dma.o
  CC      mips64el-softmmu/accel/accel.o
  CC      mips64el-softmmu/accel/stubs/hax-stub.o
  CC      aarch64-softmmu/hw/dma/soc_dma.o
  CC      aarch64-softmmu/hw/dma/pxa2xx_dma.o
  CC      mips64el-softmmu/accel/stubs/hvf-stub.o
  CC      aarch64-softmmu/hw/dma/bcm2835_dma.o
  CC      mips64el-softmmu/accel/stubs/whpx-stub.o
  CC      mips64el-softmmu/accel/stubs/kvm-stub.o
  CC      aarch64-softmmu/hw/gpio/omap_gpio.o
  CC      mips64el-softmmu/accel/tcg/tcg-all.o
  CC      moxie-softmmu/tcg/tcg-op.o
  CC      aarch64-softmmu/hw/gpio/imx_gpio.o
  CC      mips64el-softmmu/accel/tcg/cputlb.o
  CC      aarch64-softmmu/hw/gpio/bcm2835_gpio.o
  CC      aarch64-softmmu/hw/i2c/omap_i2c.o
  CC      aarch64-softmmu/hw/input/pxa2xx_keypad.o
  CC      aarch64-softmmu/hw/input/tsc210x.o
  CC      aarch64-softmmu/hw/intc/armv7m_nvic.o
  CC      moxie-softmmu/tcg/tcg-op-vec.o
  CC      moxie-softmmu/tcg/tcg-op-gvec.o
  CC      aarch64-softmmu/hw/intc/exynos4210_gic.o
  CC      mips64el-softmmu/accel/tcg/tcg-runtime.o
  CC      aarch64-softmmu/hw/intc/exynos4210_combiner.o
  CC      mips64el-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      aarch64-softmmu/hw/intc/omap_intc.o
  CC      aarch64-softmmu/hw/intc/bcm2835_ic.o
  CC      aarch64-softmmu/hw/intc/bcm2836_control.o
  CC      moxie-softmmu/tcg/tcg-common.o
  CC      mips64el-softmmu/accel/tcg/cpu-exec.o
  CC      aarch64-softmmu/hw/intc/allwinner-a10-pic.o
  CC      moxie-softmmu/tcg/optimize.o
  CC      aarch64-softmmu/hw/intc/aspeed_vic.o
  CC      mips64el-softmmu/accel/tcg/cpu-exec-common.o
  CC      aarch64-softmmu/hw/intc/arm_gicv3_cpuif.o
  CC      mips64el-softmmu/accel/tcg/translate-all.o
  CC      moxie-softmmu/fpu/softfloat.o
  CC      mips64el-softmmu/accel/tcg/translator.o
  CC      aarch64-softmmu/hw/misc/ivshmem.o
  CC      mips64el-softmmu/hw/9pfs/virtio-9p-device.o
  CC      aarch64-softmmu/hw/misc/arm_sysctl.o
  CC      mips64el-softmmu/hw/block/virtio-blk.o
  CC      aarch64-softmmu/hw/misc/cbus.o
  CC      aarch64-softmmu/hw/misc/exynos4210_pmu.o
  CC      mips64el-softmmu/hw/block/vhost-user-blk.o
  CC      aarch64-softmmu/hw/misc/exynos4210_clk.o
  CC      mips64el-softmmu/hw/block/dataplane/virtio-blk.o
  CC      aarch64-softmmu/hw/misc/exynos4210_rng.o
  CC      mips64el-softmmu/hw/char/virtio-serial-bus.o
  CC      aarch64-softmmu/hw/misc/imx_ccm.o
  CC      aarch64-softmmu/hw/misc/imx31_ccm.o
  CC      aarch64-softmmu/hw/misc/imx25_ccm.o
  CC      mips64el-softmmu/hw/core/generic-loader.o
  CC      aarch64-softmmu/hw/misc/imx6_ccm.o
  CC      mips64el-softmmu/hw/core/null-machine.o
  CC      aarch64-softmmu/hw/misc/imx6_src.o
  CC      mips64el-softmmu/hw/display/vga.o
  CC      aarch64-softmmu/hw/misc/imx7_ccm.o
  CC      aarch64-softmmu/hw/misc/imx2_wdt.o
  CC      moxie-softmmu/disas.o
  CC      aarch64-softmmu/hw/misc/imx7_snvs.o
  CC      aarch64-softmmu/hw/misc/imx7_gpr.o
  CC      moxie-softmmu/arch_init.o
  CC      aarch64-softmmu/hw/misc/mst_fpga.o
  CC      moxie-softmmu/cpus.o
  CC      aarch64-softmmu/hw/misc/omap_clk.o
  CC      mips64el-softmmu/hw/display/virtio-gpu.o
  CC      aarch64-softmmu/hw/misc/omap_gpmc.o
  CC      moxie-softmmu/monitor.o
  CC      aarch64-softmmu/hw/misc/omap_l4.o
  CC      mips64el-softmmu/hw/display/virtio-gpu-3d.o
  CC      aarch64-softmmu/hw/misc/omap_sdrc.o
  CC      aarch64-softmmu/hw/misc/omap_tap.o
  CC      aarch64-softmmu/hw/misc/bcm2835_mbox.o
  CC      mips64el-softmmu/hw/display/virtio-gpu-pci.o
  CC      aarch64-softmmu/hw/misc/bcm2835_property.o
  CC      mips64el-softmmu/hw/intc/mips_gic.o
  CC      aarch64-softmmu/hw/misc/bcm2835_rng.o
  CC      mips64el-softmmu/hw/misc/ivshmem.o
  CC      aarch64-softmmu/hw/misc/zynq_slcr.o
  CC      moxie-softmmu/gdbstub.o
  CC      aarch64-softmmu/hw/misc/zynq-xadc.o
  CC      mips64el-softmmu/hw/misc/mips_cmgcr.o
  CC      aarch64-softmmu/hw/misc/stm32f2xx_syscfg.o
  CC      mips64el-softmmu/hw/misc/mips_cpc.o
  CC      aarch64-softmmu/hw/misc/mps2-fpgaio.o
  CC      moxie-softmmu/balloon.o
  CC      mips64el-softmmu/hw/misc/mips_itu.o
  CC      aarch64-softmmu/hw/misc/mps2-scc.o
  CC      moxie-softmmu/ioport.o
  CC      aarch64-softmmu/hw/misc/tz-ppc.o
  CC      mips64el-softmmu/hw/misc/mmio_interface.o
  CC      moxie-softmmu/numa.o
  CC      mips64el-softmmu/hw/net/virtio-net.o
  CC      aarch64-softmmu/hw/misc/iotkit-secctl.o
  CC      moxie-softmmu/qtest.o
  CC      aarch64-softmmu/hw/misc/auxbus.o
  CC      moxie-softmmu/memory.o
  CC      aarch64-softmmu/hw/misc/aspeed_scu.o
  CC      mips64el-softmmu/hw/net/vhost_net.o
  CC      mips64el-softmmu/hw/scsi/virtio-scsi.o
  CC      aarch64-softmmu/hw/misc/aspeed_sdmc.o
  CC      aarch64-softmmu/hw/misc/mmio_interface.o
  CC      mips64el-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      aarch64-softmmu/hw/misc/msf2-sysreg.o
  CC      aarch64-softmmu/hw/net/virtio-net.o
  CC      mips64el-softmmu/hw/scsi/vhost-scsi-common.o
  CC      moxie-softmmu/memory_mapping.o
  CC      mips64el-softmmu/hw/scsi/vhost-scsi.o
  CC      moxie-softmmu/dump.o
  CC      mips64el-softmmu/hw/scsi/vhost-user-scsi.o
  CC      aarch64-softmmu/hw/net/vhost_net.o
  CC      mips64el-softmmu/hw/timer/mips_gictimer.o
  CC      aarch64-softmmu/hw/pcmcia/pxa2xx.o
  CC      mips64el-softmmu/hw/timer/mc146818rtc.o
  CC      moxie-softmmu/migration/ram.o
  CC      aarch64-softmmu/hw/scsi/virtio-scsi.o
  CC      mips64el-softmmu/hw/vfio/common.o
  CC      aarch64-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      aarch64-softmmu/hw/scsi/vhost-scsi-common.o
  CC      moxie-softmmu/accel/accel.o
  CC      aarch64-softmmu/hw/scsi/vhost-scsi.o
  CC      mips64el-softmmu/hw/vfio/pci.o
  CC      moxie-softmmu/accel/stubs/hax-stub.o
  CC      aarch64-softmmu/hw/scsi/vhost-user-scsi.o
  CC      moxie-softmmu/accel/stubs/hvf-stub.o
  CC      moxie-softmmu/accel/stubs/whpx-stub.o
  CC      aarch64-softmmu/hw/sd/omap_mmc.o
  CC      moxie-softmmu/accel/stubs/kvm-stub.o
  CC      aarch64-softmmu/hw/sd/pxa2xx_mmci.o
  CC      moxie-softmmu/accel/tcg/tcg-all.o
  CC      moxie-softmmu/accel/tcg/cputlb.o
  CC      aarch64-softmmu/hw/sd/bcm2835_sdhost.o
  CC      mips64el-softmmu/hw/vfio/pci-quirks.o
  CC      aarch64-softmmu/hw/ssi/omap_spi.o
  CC      aarch64-softmmu/hw/ssi/imx_spi.o
  CC      aarch64-softmmu/hw/timer/exynos4210_mct.o
  CC      mips64el-softmmu/hw/vfio/display.o
  CC      aarch64-softmmu/hw/timer/exynos4210_pwm.o
  CC      mips64el-softmmu/hw/vfio/platform.o
  CC      aarch64-softmmu/hw/timer/exynos4210_rtc.o
  CC      mips64el-softmmu/hw/vfio/spapr.o
  CC      aarch64-softmmu/hw/timer/omap_gptimer.o
  CC      aarch64-softmmu/hw/timer/omap_synctimer.o
  CC      mips64el-softmmu/hw/virtio/virtio.o
  CC      aarch64-softmmu/hw/timer/pxa2xx_timer.o
  CC      moxie-softmmu/accel/tcg/tcg-runtime.o
  CC      aarch64-softmmu/hw/timer/digic-timer.o
  CC      moxie-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      aarch64-softmmu/hw/timer/allwinner-a10-pit.o
  CC      aarch64-softmmu/hw/usb/tusb6010.o
  CC      mips64el-softmmu/hw/virtio/virtio-balloon.o
  CC      aarch64-softmmu/hw/usb/chipidea.o
  CC      mips64el-softmmu/hw/virtio/virtio-crypto.o
  CC      aarch64-softmmu/hw/vfio/common.o
  CC      moxie-softmmu/accel/tcg/cpu-exec.o
  CC      mips64el-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      moxie-softmmu/accel/tcg/cpu-exec-common.o
  CC      moxie-softmmu/accel/tcg/translate-all.o
  CC      mips64el-softmmu/hw/virtio/vhost.o
  CC      aarch64-softmmu/hw/vfio/pci.o
  CC      moxie-softmmu/accel/tcg/translator.o
  CC      mips64el-softmmu/hw/virtio/vhost-backend.o
  CC      moxie-softmmu/hw/core/generic-loader.o
  CC      mips64el-softmmu/hw/virtio/vhost-user.o
  CC      moxie-softmmu/hw/core/null-machine.o
  CC      moxie-softmmu/hw/display/vga.o
  CC      aarch64-softmmu/hw/vfio/pci-quirks.o
  CC      mips64el-softmmu/hw/virtio/vhost-vsock.o
  CC      mips64el-softmmu/hw/mips/mips_r4k.o
  CC      mips64el-softmmu/hw/mips/mips_malta.o
  CC      aarch64-softmmu/hw/vfio/display.o
  CC      moxie-softmmu/hw/misc/mmio_interface.o
  CC      moxie-softmmu/hw/net/vhost_net.o
  CC      mips64el-softmmu/hw/mips/mips_mipssim.o
  CC      aarch64-softmmu/hw/vfio/platform.o
  CC      moxie-softmmu/hw/net/rocker/qmp-norocker.o
  CC      moxie-softmmu/hw/timer/mc146818rtc.o
  CC      mips64el-softmmu/hw/mips/addr.o
  CC      aarch64-softmmu/hw/vfio/calxeda-xgmac.o
  CC      mips64el-softmmu/hw/mips/mips_int.o
  CC      mips64el-softmmu/hw/mips/mips_jazz.o
  CC      moxie-softmmu/hw/vfio/common.o
  CC      aarch64-softmmu/hw/vfio/amd-xgbe.o
  CC      mips64el-softmmu/hw/mips/mips_fulong2e.o
  CC      aarch64-softmmu/hw/vfio/spapr.o
  CC      mips64el-softmmu/hw/mips/gt64xxx_pci.o
  CC      moxie-softmmu/hw/vfio/platform.o
  CC      aarch64-softmmu/hw/virtio/virtio.o
  CC      mips64el-softmmu/hw/mips/cps.o
  CC      mips64el-softmmu/hw/mips/boston.o
  CC      moxie-softmmu/hw/vfio/spapr.o
  CC      mips64el-softmmu/target/mips/translate.o
  CC      moxie-softmmu/hw/moxie/moxiesim.o
  CC      moxie-softmmu/target/moxie/translate.o
  CC      aarch64-softmmu/hw/virtio/virtio-balloon.o
  CC      aarch64-softmmu/hw/virtio/virtio-crypto.o
  CC      moxie-softmmu/target/moxie/helper.o
  CC      aarch64-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      moxie-softmmu/target/moxie/machine.o
  CC      moxie-softmmu/target/moxie/cpu.o
  CC      aarch64-softmmu/hw/virtio/vhost.o
  CC      moxie-softmmu/target/moxie/mmu.o
  GEN     trace/generated-helpers.c
  CC      moxie-softmmu/trace/control-target.o
  CC      moxie-softmmu/trace/generated-helpers.o
  CC      aarch64-softmmu/hw/virtio/vhost-backend.o
  LINK    moxie-softmmu/qemu-system-moxie
  CC      aarch64-softmmu/hw/virtio/vhost-user.o
  CC      aarch64-softmmu/hw/virtio/vhost-vsock.o
  CC      aarch64-softmmu/hw/arm/boot.o
  CC      aarch64-softmmu/hw/arm/virt.o
  CC      aarch64-softmmu/hw/arm/sysbus-fdt.o
  CC      mips-softmmu/tcg/tcg.o
  CC      aarch64-softmmu/hw/arm/virt-acpi-build.o
  CC      aarch64-softmmu/hw/arm/digic_boards.o
  CC      aarch64-softmmu/hw/arm/exynos4_boards.o
  CC      mips-softmmu/tcg/tcg-op.o
  CC      aarch64-softmmu/hw/arm/highbank.o
  CC      aarch64-softmmu/hw/arm/integratorcp.o
  CC      mips-softmmu/tcg/tcg-op-vec.o
  CC      aarch64-softmmu/hw/arm/mainstone.o
  CC      aarch64-softmmu/hw/arm/musicpal.o
  CC      mips-softmmu/tcg/tcg-op-gvec.o
  CC      aarch64-softmmu/hw/arm/netduino2.o
  CC      mips-softmmu/tcg/tcg-common.o
  CC      aarch64-softmmu/hw/arm/nseries.o
  CC      mips-softmmu/tcg/optimize.o
  CC      mips64el-softmmu/target/mips/dsp_helper.o
  CC      mips64el-softmmu/target/mips/op_helper.o
  CC      mips-softmmu/fpu/softfloat.o
  CC      mips-softmmu/disas.o
  CC      aarch64-softmmu/hw/arm/omap_sx1.o
  CC      mips-softmmu/arch_init.o
  CC      aarch64-softmmu/hw/arm/palm.o
  CC      mips-softmmu/cpus.o
  CC      aarch64-softmmu/hw/arm/gumstix.o
  CC      aarch64-softmmu/hw/arm/spitz.o
  CC      aarch64-softmmu/hw/arm/tosa.o
  CC      aarch64-softmmu/hw/arm/z2.o
  CC      mips64el-softmmu/target/mips/lmi_helper.o
  CC      aarch64-softmmu/hw/arm/realview.o
  CC      aarch64-softmmu/hw/arm/stellaris.o
  CC      mips64el-softmmu/target/mips/helper.o
  CC      aarch64-softmmu/hw/arm/collie.o
  CC      aarch64-softmmu/hw/arm/vexpress.o
  CC      aarch64-softmmu/hw/arm/versatilepb.o
  CC      mips64el-softmmu/target/mips/cpu.o
  CC      mips64el-softmmu/target/mips/gdbstub.o
  CC      aarch64-softmmu/hw/arm/xilinx_zynq.o
  CC      aarch64-softmmu/hw/arm/armv7m.o
  CC      mips64el-softmmu/target/mips/msa_helper.o
  CC      aarch64-softmmu/hw/arm/exynos4210.o
  CC      aarch64-softmmu/hw/arm/pxa2xx.o
  CC      aarch64-softmmu/hw/arm/pxa2xx_gpio.o
  CC      aarch64-softmmu/hw/arm/pxa2xx_pic.o
  CC      aarch64-softmmu/hw/arm/digic.o
  CC      aarch64-softmmu/hw/arm/omap1.o
  CC      aarch64-softmmu/hw/arm/omap2.o
  CC      mips-softmmu/monitor.o
  CC      aarch64-softmmu/hw/arm/strongarm.o
  CC      aarch64-softmmu/hw/arm/allwinner-a10.o
  CC      mips-softmmu/gdbstub.o
  CC      aarch64-softmmu/hw/arm/cubieboard.o
  CC      aarch64-softmmu/hw/arm/bcm2835_peripherals.o
  CC      mips-softmmu/balloon.o
  CC      mips-softmmu/ioport.o
  CC      aarch64-softmmu/hw/arm/bcm2836.o
  CC      mips-softmmu/numa.o
  CC      mips-softmmu/qtest.o
  CC      mips-softmmu/memory.o
  CC      mips-softmmu/memory_mapping.o
  CC      mips-softmmu/dump.o
  CC      mips-softmmu/migration/ram.o
  CC      mips-softmmu/accel/accel.o
  CC      mips-softmmu/accel/stubs/hax-stub.o
  CC      mips-softmmu/accel/stubs/hvf-stub.o
  CC      mips-softmmu/accel/stubs/whpx-stub.o
  CC      mips-softmmu/accel/stubs/kvm-stub.o
  CC      mips-softmmu/accel/tcg/tcg-all.o
  CC      mips-softmmu/accel/tcg/cputlb.o
  CC      mips-softmmu/accel/tcg/tcg-runtime.o
  CC      mips-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      mips-softmmu/accel/tcg/cpu-exec.o
  CC      mips-softmmu/accel/tcg/cpu-exec-common.o
  CC      mips-softmmu/accel/tcg/translate-all.o
  CC      mips-softmmu/accel/tcg/translator.o
  CC      mips-softmmu/hw/9pfs/virtio-9p-device.o
  CC      mips-softmmu/hw/block/virtio-blk.o
  CC      mips-softmmu/hw/block/vhost-user-blk.o
  CC      mips-softmmu/hw/block/dataplane/virtio-blk.o
  CC      mips-softmmu/hw/char/virtio-serial-bus.o
  CC      mips-softmmu/hw/core/generic-loader.o
  CC      mips-softmmu/hw/core/null-machine.o
  CC      mips-softmmu/hw/display/vga.o
  CC      mips-softmmu/hw/display/virtio-gpu.o
  CC      aarch64-softmmu/hw/arm/raspi.o
  CC      aarch64-softmmu/hw/arm/stm32f205_soc.o
  CC      aarch64-softmmu/hw/arm/xlnx-zynqmp.o
  CC      mips-softmmu/hw/display/virtio-gpu-3d.o
  CC      mips-softmmu/hw/display/virtio-gpu-pci.o
  CC      aarch64-softmmu/hw/arm/xlnx-zcu102.o
  CC      mips-softmmu/hw/intc/mips_gic.o
  CC      mips-softmmu/hw/misc/ivshmem.o
  CC      aarch64-softmmu/hw/arm/fsl-imx25.o
  CC      mips-softmmu/hw/misc/mips_cmgcr.o
  CC      mips-softmmu/hw/misc/mips_cpc.o
  CC      aarch64-softmmu/hw/arm/imx25_pdk.o
  CC      mips-softmmu/hw/misc/mips_itu.o
  CC      mips-softmmu/hw/misc/mmio_interface.o
  CC      aarch64-softmmu/hw/arm/fsl-imx31.o
  CC      mips-softmmu/hw/net/virtio-net.o
  CC      mips-softmmu/hw/net/vhost_net.o
  CC      aarch64-softmmu/hw/arm/kzm.o
  CC      mips-softmmu/hw/scsi/virtio-scsi.o
  CC      aarch64-softmmu/hw/arm/fsl-imx6.o
  CC      mips-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      mips-softmmu/hw/scsi/vhost-scsi-common.o
  CC      aarch64-softmmu/hw/arm/sabrelite.o
  CC      mips-softmmu/hw/scsi/vhost-scsi.o
  CC      aarch64-softmmu/hw/arm/aspeed_soc.o
  CC      mips-softmmu/hw/scsi/vhost-user-scsi.o
  GEN     nios2-softmmu/hmp-commands.h
  CC      aarch64-softmmu/hw/arm/aspeed.o
  GEN     nios2-softmmu/hmp-commands-info.h
  GEN     nios2-softmmu/config-target.h
  CC      nios2-softmmu/exec.o
  CC      mips-softmmu/hw/timer/mips_gictimer.o
  CC      aarch64-softmmu/hw/arm/mps2.o
  CC      mips-softmmu/hw/timer/mc146818rtc.o
  CC      aarch64-softmmu/hw/arm/mps2-tz.o
  CC      mips-softmmu/hw/vfio/common.o
  CC      aarch64-softmmu/hw/arm/msf2-soc.o
  CC      aarch64-softmmu/hw/arm/msf2-som.o
  CC      aarch64-softmmu/hw/arm/iotkit.o
  CC      mips-softmmu/hw/vfio/pci.o
  CC      aarch64-softmmu/hw/arm/fsl-imx7.o
  CC      nios2-softmmu/tcg/tcg.o
  CC      aarch64-softmmu/hw/arm/mcimx7d-sabre.o
  CC      aarch64-softmmu/hw/arm/smmu-common.o
  CC      mips-softmmu/hw/vfio/pci-quirks.o
  CC      aarch64-softmmu/hw/arm/smmuv3.o
  CC      aarch64-softmmu/target/arm/arm-semi.o
  CC      mips-softmmu/hw/vfio/display.o
  CC      aarch64-softmmu/target/arm/machine.o
  CC      nios2-softmmu/tcg/tcg-op.o
  CC      mips-softmmu/hw/vfio/platform.o
  CC      aarch64-softmmu/target/arm/psci.o
  CC      aarch64-softmmu/target/arm/arch_dump.o
  CC      mips-softmmu/hw/vfio/spapr.o
  CC      aarch64-softmmu/target/arm/monitor.o
  CC      aarch64-softmmu/target/arm/kvm-stub.o
  CC      mips-softmmu/hw/virtio/virtio.o
  CC      aarch64-softmmu/target/arm/translate.o
  CC      nios2-softmmu/tcg/tcg-op-vec.o
  CC      mips-softmmu/hw/virtio/virtio-balloon.o
  CC      nios2-softmmu/tcg/tcg-op-gvec.o
  CC      mips-softmmu/hw/virtio/virtio-crypto.o
  CC      mips-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      mips-softmmu/hw/virtio/vhost.o
  CC      nios2-softmmu/tcg/tcg-common.o
  CC      mips-softmmu/hw/virtio/vhost-backend.o
  CC      nios2-softmmu/tcg/optimize.o
  CC      mips-softmmu/hw/virtio/vhost-user.o
  CC      mips-softmmu/hw/virtio/vhost-vsock.o
  CC      nios2-softmmu/fpu/softfloat.o
  CC      mips-softmmu/hw/mips/mips_r4k.o
  CC      mips-softmmu/hw/mips/mips_malta.o
  CC      mips-softmmu/hw/mips/mips_mipssim.o
  CC      mips-softmmu/hw/mips/addr.o
  CC      mips-softmmu/hw/mips/mips_int.o
  CC      mips-softmmu/hw/mips/gt64xxx_pci.o
  CC      mips-softmmu/hw/mips/cps.o
  CC      mips-softmmu/target/mips/translate.o
  CC      aarch64-softmmu/target/arm/op_helper.o
  CC      nios2-softmmu/disas.o
  CC      nios2-softmmu/arch_init.o
  CC      nios2-softmmu/cpus.o
  CC      aarch64-softmmu/target/arm/helper.o
  CC      nios2-softmmu/monitor.o
  CC      nios2-softmmu/gdbstub.o
  CC      nios2-softmmu/balloon.o
  CC      nios2-softmmu/ioport.o
  CC      nios2-softmmu/numa.o
  CC      nios2-softmmu/qtest.o
  CC      aarch64-softmmu/target/arm/cpu.o
  CC      nios2-softmmu/memory.o
  CC      aarch64-softmmu/target/arm/neon_helper.o
  CC      nios2-softmmu/memory_mapping.o
  CC      nios2-softmmu/dump.o
  CC      aarch64-softmmu/target/arm/iwmmxt_helper.o
  CC      mips-softmmu/target/mips/dsp_helper.o
  CC      nios2-softmmu/migration/ram.o
  CC      aarch64-softmmu/target/arm/vec_helper.o
  CC      mips-softmmu/target/mips/op_helper.o
  CC      aarch64-softmmu/target/arm/gdbstub.o
  CC      nios2-softmmu/accel/accel.o
  CC      aarch64-softmmu/target/arm/cpu64.o
  CC      nios2-softmmu/accel/stubs/hax-stub.o
  CC      aarch64-softmmu/target/arm/translate-a64.o
  CC      nios2-softmmu/accel/stubs/hvf-stub.o
  CC      nios2-softmmu/accel/stubs/whpx-stub.o
  CC      nios2-softmmu/accel/stubs/kvm-stub.o
  CC      nios2-softmmu/accel/tcg/tcg-all.o
  CC      nios2-softmmu/accel/tcg/cputlb.o
  CC      mips-softmmu/target/mips/lmi_helper.o
  CC      mips-softmmu/target/mips/helper.o
  CC      mips-softmmu/target/mips/cpu.o
  CC      mips-softmmu/target/mips/gdbstub.o
  CC      mips-softmmu/target/mips/msa_helper.o
  CC      nios2-softmmu/accel/tcg/tcg-runtime.o
  CC      nios2-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      nios2-softmmu/accel/tcg/cpu-exec.o
  CC      nios2-softmmu/accel/tcg/cpu-exec-common.o
  CC      nios2-softmmu/accel/tcg/translate-all.o
  CC      nios2-softmmu/accel/tcg/translator.o
  CC      aarch64-softmmu/target/arm/helper-a64.o
  CC      nios2-softmmu/hw/core/generic-loader.o
  CC      nios2-softmmu/hw/core/null-machine.o
  CC      aarch64-softmmu/target/arm/gdbstub64.o
  CC      nios2-softmmu/hw/intc/nios2_iic.o
  CC      aarch64-softmmu/target/arm/crypto_helper.o
  CC      nios2-softmmu/hw/misc/mmio_interface.o
  CC      nios2-softmmu/hw/net/vhost_net.o
  CC      mips-softmmu/target/mips/mips-semi.o
  CC      aarch64-softmmu/target/arm/arm-powerctl.o
  CC      nios2-softmmu/hw/net/rocker/qmp-norocker.o
  CC      mips-softmmu/target/mips/machine.o
  CC      nios2-softmmu/hw/timer/altera_timer.o
  GEN     aarch64-softmmu/target/arm/decode-sve.inc.c
  CC      aarch64-softmmu/target/arm/sve_helper.o
  CC      nios2-softmmu/hw/vfio/common.o
  CC      mips-softmmu/target/mips/cp0_timer.o
  GEN     trace/generated-helpers.c
  CC      mips-softmmu/trace/control-target.o
  CC      mips-softmmu/trace/generated-helpers.o
  CC      nios2-softmmu/hw/vfio/platform.o
  LINK    mips-softmmu/qemu-system-mips
  CC      nios2-softmmu/hw/vfio/spapr.o
  CC      nios2-softmmu/hw/nios2/boot.o
  GEN     trace/generated-helpers.c
  CC      aarch64-softmmu/trace/control-target.o
  CC      nios2-softmmu/hw/nios2/cpu_pic.o
  CC      aarch64-softmmu/gdbstub-xml.o
  CC      nios2-softmmu/hw/nios2/10m50_devboard.o
  CC      aarch64-softmmu/target/arm/translate-sve.o
  CC      nios2-softmmu/target/nios2/translate.o
  GEN     or1k-softmmu/hmp-commands.h
  GEN     or1k-softmmu/hmp-commands-info.h
  GEN     or1k-softmmu/config-target.h
  CC      or1k-softmmu/exec.o
  CC      or1k-softmmu/tcg/tcg.o
  CC      or1k-softmmu/tcg/tcg-op.o
  CC      or1k-softmmu/tcg/tcg-op-vec.o
  CC      or1k-softmmu/tcg/tcg-op-gvec.o
  CC      or1k-softmmu/tcg/tcg-common.o
  CC      or1k-softmmu/tcg/optimize.o
  CC      or1k-softmmu/fpu/softfloat.o
  CC      or1k-softmmu/disas.o
  CC      or1k-softmmu/arch_init.o
  CC      or1k-softmmu/cpus.o
  CC      or1k-softmmu/monitor.o
  CC      or1k-softmmu/gdbstub.o
  CC      or1k-softmmu/balloon.o
  CC      or1k-softmmu/ioport.o
  CC      or1k-softmmu/numa.o
  CC      or1k-softmmu/qtest.o
  CC      or1k-softmmu/memory.o
  CC      or1k-softmmu/memory_mapping.o
  CC      or1k-softmmu/dump.o
  CC      or1k-softmmu/migration/ram.o
  CC      or1k-softmmu/accel/accel.o
  CC      or1k-softmmu/accel/stubs/hax-stub.o
  CC      or1k-softmmu/accel/stubs/hvf-stub.o
  CC      or1k-softmmu/accel/stubs/whpx-stub.o
  CC      or1k-softmmu/accel/stubs/kvm-stub.o
  CC      or1k-softmmu/accel/tcg/tcg-all.o
  CC      or1k-softmmu/accel/tcg/cputlb.o
  CC      or1k-softmmu/accel/tcg/tcg-runtime.o
  CC      or1k-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      or1k-softmmu/accel/tcg/cpu-exec.o
  CC      or1k-softmmu/accel/tcg/cpu-exec-common.o
  CC      or1k-softmmu/accel/tcg/translate-all.o
  CC      or1k-softmmu/accel/tcg/translator.o
  CC      or1k-softmmu/hw/core/generic-loader.o
  CC      or1k-softmmu/hw/core/null-machine.o
  CC      or1k-softmmu/hw/intc/ompic.o
  CC      or1k-softmmu/hw/misc/mmio_interface.o
  CC      or1k-softmmu/hw/net/vhost_net.o
  CC      or1k-softmmu/hw/net/rocker/qmp-norocker.o
  CC      or1k-softmmu/hw/vfio/common.o
  CC      or1k-softmmu/hw/vfio/platform.o
  CC      or1k-softmmu/hw/vfio/spapr.o
  CC      or1k-softmmu/hw/openrisc/pic_cpu.o
  CC      or1k-softmmu/hw/openrisc/cputimer.o
  CC      or1k-softmmu/hw/openrisc/openrisc_sim.o
  CC      or1k-softmmu/target/openrisc/machine.o
  CC      or1k-softmmu/target/openrisc/cpu.o
  CC      or1k-softmmu/target/openrisc/exception.o
  CC      or1k-softmmu/target/openrisc/interrupt.o
  CC      or1k-softmmu/target/openrisc/mmu.o
  GEN     or1k-softmmu/target/openrisc/decode.inc.c
  CC      or1k-softmmu/target/openrisc/exception_helper.o
  CC      or1k-softmmu/target/openrisc/fpu_helper.o
  CC      or1k-softmmu/target/openrisc/interrupt_helper.o
  CC      or1k-softmmu/target/openrisc/mmu_helper.o
  CC      or1k-softmmu/target/openrisc/sys_helper.o
  CC      or1k-softmmu/target/openrisc/gdbstub.o
  GEN     trace/generated-helpers.c
  CC      or1k-softmmu/trace/control-target.o
  CC      or1k-softmmu/target/openrisc/translate.o
  CC      or1k-softmmu/trace/generated-helpers.o
  LINK    or1k-softmmu/qemu-system-or1k
  CC      aarch64-softmmu/trace/generated-helpers.o
  LINK    aarch64-softmmu/qemu-system-aarch64
  GEN     ppc64-softmmu/hmp-commands.h
  GEN     ppc64-softmmu/hmp-commands-info.h
  GEN     ppc64-softmmu/config-target.h
  CC      ppc64-softmmu/exec.o
  CC      ppc64-softmmu/tcg/tcg.o
  GEN     ppcemb-softmmu/hmp-commands.h
  GEN     ppcemb-softmmu/hmp-commands-info.h
  GEN     ppcemb-softmmu/config-target.h
  CC      ppcemb-softmmu/exec.o
  CC      ppcemb-softmmu/tcg/tcg.o
  CC      ppcemb-softmmu/tcg/tcg-op.o
  CC      ppcemb-softmmu/tcg/tcg-op-vec.o
  CC      ppcemb-softmmu/tcg/tcg-op-gvec.o
  CC      ppcemb-softmmu/tcg/tcg-common.o
  CC      ppcemb-softmmu/tcg/optimize.o
  CC      ppcemb-softmmu/fpu/softfloat.o
  CC      ppcemb-softmmu/disas.o
  GEN     ppcemb-softmmu/gdbstub-xml.c
  CC      ppcemb-softmmu/arch_init.o
  CC      ppcemb-softmmu/cpus.o
  CC      ppcemb-softmmu/monitor.o
  CC      ppcemb-softmmu/gdbstub.o
  CC      ppcemb-softmmu/balloon.o
  CC      ppcemb-softmmu/ioport.o
  CC      ppcemb-softmmu/numa.o
  CC      ppcemb-softmmu/qtest.o
  CC      ppcemb-softmmu/memory.o
  CC      ppcemb-softmmu/memory_mapping.o
  CC      ppcemb-softmmu/dump.o
  CC      ppcemb-softmmu/migration/ram.o
  CC      ppcemb-softmmu/accel/accel.o
  CC      ppcemb-softmmu/accel/stubs/hax-stub.o
  CC      ppcemb-softmmu/accel/stubs/hvf-stub.o
  CC      ppcemb-softmmu/accel/stubs/whpx-stub.o
  CC      ppcemb-softmmu/accel/stubs/kvm-stub.o
  CC      ppcemb-softmmu/accel/tcg/tcg-all.o
  CC      ppcemb-softmmu/accel/tcg/cputlb.o
  CC      ppcemb-softmmu/accel/tcg/tcg-runtime.o
  CC      ppcemb-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      ppcemb-softmmu/accel/tcg/cpu-exec.o
  CC      ppcemb-softmmu/accel/tcg/cpu-exec-common.o
  CC      ppcemb-softmmu/accel/tcg/translate-all.o
  CC      ppcemb-softmmu/accel/tcg/translator.o
  CC      ppcemb-softmmu/hw/9pfs/virtio-9p-device.o
  CC      ppcemb-softmmu/hw/block/virtio-blk.o
  CC      ppcemb-softmmu/hw/block/vhost-user-blk.o
  CC      ppcemb-softmmu/hw/block/dataplane/virtio-blk.o
  CC      ppcemb-softmmu/hw/char/virtio-serial-bus.o
  CC      ppcemb-softmmu/hw/core/generic-loader.o
  CC      ppcemb-softmmu/hw/core/null-machine.o
  CC      ppcemb-softmmu/hw/display/sm501.o
  CC      ppcemb-softmmu/hw/display/vga.o
  CC      ppcemb-softmmu/hw/display/virtio-gpu.o
  CC      ppcemb-softmmu/hw/display/virtio-gpu-3d.o
  CC      ppcemb-softmmu/hw/display/virtio-gpu-pci.o
  CC      ppcemb-softmmu/hw/i2c/ppc4xx_i2c.o
  CC      ppcemb-softmmu/hw/misc/ivshmem.o
  CC      ppcemb-softmmu/hw/misc/mmio_interface.o
  CC      ppcemb-softmmu/hw/net/xilinx_ethlite.o
  CC      ppcemb-softmmu/hw/net/virtio-net.o
  CC      ppcemb-softmmu/hw/net/vhost_net.o
  CC      ppcemb-softmmu/hw/scsi/virtio-scsi.o
  CC      ppcemb-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      ppcemb-softmmu/hw/scsi/vhost-scsi-common.o
  CC      ppcemb-softmmu/hw/scsi/vhost-scsi.o
  CC      ppcemb-softmmu/hw/scsi/vhost-user-scsi.o
  CC      ppcemb-softmmu/hw/vfio/common.o
  CC      ppcemb-softmmu/hw/vfio/pci.o
  CC      ppcemb-softmmu/hw/vfio/pci-quirks.o
  CC      ppcemb-softmmu/hw/vfio/display.o
  CC      ppcemb-softmmu/hw/vfio/platform.o
  CC      ppcemb-softmmu/hw/vfio/spapr.o
  CC      ppcemb-softmmu/hw/virtio/virtio.o
  CC      ppcemb-softmmu/hw/virtio/virtio-balloon.o
  CC      ppcemb-softmmu/hw/virtio/virtio-crypto.o
  CC      ppcemb-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      ppcemb-softmmu/hw/virtio/vhost.o
  CC      ppcemb-softmmu/hw/virtio/vhost-backend.o
  CC      ppcemb-softmmu/hw/virtio/vhost-user.o
  CC      ppcemb-softmmu/hw/virtio/vhost-vsock.o
  CC      ppcemb-softmmu/hw/ppc/ppc.o
  CC      ppcemb-softmmu/hw/ppc/ppc_booke.o
  CC      ppcemb-softmmu/hw/ppc/fdt.o
  CC      ppcemb-softmmu/hw/ppc/ppc4xx_devs.o
  CC      ppcemb-softmmu/hw/ppc/ppc405_uc.o
  CC      ppcemb-softmmu/hw/ppc/ppc4xx_pci.o
  CC      ppcemb-softmmu/hw/ppc/ppc405_boards.o
  CC      ppcemb-softmmu/hw/ppc/ppc440_bamboo.o
  CC      ppcemb-softmmu/hw/ppc/ppc440_pcix.o
  CC      ppcemb-softmmu/hw/ppc/ppc440_uc.o
  CC      ppcemb-softmmu/hw/ppc/sam460ex.o
  CC      ppcemb-softmmu/hw/ppc/virtex_ml507.o
  CC      ppcemb-softmmu/target/ppc/cpu-models.o
  CC      ppcemb-softmmu/target/ppc/cpu.o
  CC      ppcemb-softmmu/target/ppc/translate.o
  CC      ppcemb-softmmu/target/ppc/machine.o
  CC      ppcemb-softmmu/target/ppc/mmu_helper.o
  CC      ppcemb-softmmu/target/ppc/mmu-hash32.o
  CC      ppcemb-softmmu/target/ppc/monitor.o
  CC      ppcemb-softmmu/target/ppc/arch_dump.o
  CC      ppcemb-softmmu/target/ppc/kvm-stub.o
  CC      ppcemb-softmmu/target/ppc/dfp_helper.o
  CC      ppcemb-softmmu/target/ppc/excp_helper.o
  CC      ppcemb-softmmu/target/ppc/fpu_helper.o
  CC      ppcemb-softmmu/target/ppc/int_helper.o
  CC      ppcemb-softmmu/target/ppc/timebase_helper.o
  CC      ppcemb-softmmu/target/ppc/misc_helper.o
  CC      ppcemb-softmmu/target/ppc/mem_helper.o
  CC      ppcemb-softmmu/target/ppc/gdbstub.o
  CC      ppcemb-softmmu/target/ppc/../../libdecnumber/decContext.o
  CC      ppcemb-softmmu/target/ppc/../../libdecnumber/decNumber.o
  CC      ppcemb-softmmu/target/ppc/../../libdecnumber/dpd/decimal32.o
  CC      ppcemb-softmmu/target/ppc/../../libdecnumber/dpd/decimal64.o
  CC      ppcemb-softmmu/target/ppc/../../libdecnumber/dpd/decimal128.o
  GEN     trace/generated-helpers.c
  CC      ppcemb-softmmu/trace/control-target.o
  CC      ppcemb-softmmu/gdbstub-xml.o
  CC      ppcemb-softmmu/trace/generated-helpers.o
  LINK    ppcemb-softmmu/qemu-system-ppcemb
  CC      nios2-softmmu/target/nios2/op_helper.o
  CC      ppc64-softmmu/tcg/tcg-op.o
  GEN     ppc-softmmu/hmp-commands.h
  GEN     ppc-softmmu/hmp-commands-info.h
  GEN     ppc-softmmu/config-target.h
  CC      ppc-softmmu/exec.o
  CC      ppc64-softmmu/tcg/tcg-op-vec.o
  CC      ppc-softmmu/tcg/tcg.o
  CC      ppc64-softmmu/tcg/tcg-op-gvec.o
  CC      ppc-softmmu/tcg/tcg-op.o
  CC      ppc64-softmmu/tcg/tcg-common.o
  CC      ppc64-softmmu/tcg/optimize.o
  CC      ppc64-softmmu/fpu/softfloat.o
  CC      ppc-softmmu/tcg/tcg-op-vec.o
  CC      ppc-softmmu/tcg/tcg-op-gvec.o
  CC      ppc-softmmu/tcg/tcg-common.o
  CC      ppc-softmmu/tcg/optimize.o
  CC      ppc64-softmmu/disas.o
  GEN     ppc64-softmmu/gdbstub-xml.c
  CC      ppc64-softmmu/arch_init.o
  CC      ppc64-softmmu/cpus.o
  CC      ppc-softmmu/fpu/softfloat.o
  CC      ppc64-softmmu/monitor.o
  CC      ppc64-softmmu/gdbstub.o
  CC      ppc64-softmmu/balloon.o
  CC      ppc64-softmmu/ioport.o
  CC      ppc64-softmmu/numa.o
  CC      ppc64-softmmu/qtest.o
  CC      ppc-softmmu/disas.o
  CC      ppc64-softmmu/memory.o
  GEN     ppc-softmmu/gdbstub-xml.c
  CC      ppc-softmmu/arch_init.o
  CC      ppc-softmmu/cpus.o
  CC      ppc-softmmu/monitor.o
  CC      ppc64-softmmu/memory_mapping.o
  CC      ppc64-softmmu/dump.o
  CC      ppc64-softmmu/migration/ram.o
  CC      ppc-softmmu/gdbstub.o
  CC      ppc64-softmmu/accel/accel.o
  CC      ppc-softmmu/balloon.o
  CC      ppc64-softmmu/accel/stubs/hax-stub.o
  CC      ppc-softmmu/ioport.o
  CC      ppc64-softmmu/accel/stubs/hvf-stub.o
  CC      ppc64-softmmu/accel/stubs/whpx-stub.o
  CC      ppc-softmmu/numa.o
  CC      ppc64-softmmu/accel/stubs/kvm-stub.o
  CC      ppc64-softmmu/accel/tcg/tcg-all.o
  CC      ppc-softmmu/qtest.o
  CC      ppc64-softmmu/accel/tcg/cputlb.o
  CC      ppc-softmmu/memory.o
  CC      ppc-softmmu/memory_mapping.o
  CC      ppc-softmmu/dump.o
  CC      ppc64-softmmu/accel/tcg/tcg-runtime.o
  CC      ppc-softmmu/migration/ram.o
  CC      ppc64-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      ppc-softmmu/accel/accel.o
  CC      ppc-softmmu/accel/stubs/hax-stub.o
  CC      ppc64-softmmu/accel/tcg/cpu-exec.o
  CC      ppc-softmmu/accel/stubs/hvf-stub.o
  CC      ppc-softmmu/accel/stubs/whpx-stub.o
  CC      ppc64-softmmu/accel/tcg/cpu-exec-common.o
  CC      ppc-softmmu/accel/stubs/kvm-stub.o
  CC      ppc64-softmmu/accel/tcg/translate-all.o
  CC      ppc-softmmu/accel/tcg/tcg-all.o
  CC      ppc-softmmu/accel/tcg/cputlb.o
  CC      ppc64-softmmu/accel/tcg/translator.o
  CC      ppc64-softmmu/hw/9pfs/virtio-9p-device.o
  CC      ppc64-softmmu/hw/block/virtio-blk.o
  CC      ppc64-softmmu/hw/block/vhost-user-blk.o
  CC      ppc64-softmmu/hw/block/dataplane/virtio-blk.o
  CC      ppc64-softmmu/hw/char/spapr_vty.o
  CC      ppc-softmmu/accel/tcg/tcg-runtime.o
  CC      ppc64-softmmu/hw/char/virtio-serial-bus.o
  CC      ppc-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      ppc64-softmmu/hw/core/generic-loader.o
  CC      ppc64-softmmu/hw/core/null-machine.o
  CC      ppc64-softmmu/hw/display/sm501.o
  CC      ppc-softmmu/accel/tcg/cpu-exec.o
  CC      ppc-softmmu/accel/tcg/cpu-exec-common.o
  CC      ppc64-softmmu/hw/display/vga.o
  CC      ppc-softmmu/accel/tcg/translate-all.o
  CC      ppc-softmmu/accel/tcg/translator.o
  CC      ppc64-softmmu/hw/display/virtio-gpu.o
  CC      ppc-softmmu/hw/9pfs/virtio-9p-device.o
  CC      ppc-softmmu/hw/block/virtio-blk.o
  CC      ppc64-softmmu/hw/display/virtio-gpu-3d.o
  CC      ppc-softmmu/hw/block/vhost-user-blk.o
  CC      ppc-softmmu/hw/block/dataplane/virtio-blk.o
  CC      ppc64-softmmu/hw/display/virtio-gpu-pci.o
  CC      ppc-softmmu/hw/char/virtio-serial-bus.o
  CC      ppc64-softmmu/hw/display/virtio-vga.o
  CC      ppc-softmmu/hw/core/generic-loader.o
  CC      ppc64-softmmu/hw/i2c/ppc4xx_i2c.o
  CC      ppc-softmmu/hw/core/null-machine.o
  CC      ppc64-softmmu/hw/intc/xics.o
  CC      ppc-softmmu/hw/display/sm501.o
  CC      ppc64-softmmu/hw/intc/xics_spapr.o
  CC      ppc64-softmmu/hw/intc/xics_pnv.o
  CC      ppc-softmmu/hw/display/vga.o
  CC      ppc64-softmmu/hw/misc/ivshmem.o
  CC      ppc64-softmmu/hw/misc/mmio_interface.o
  CC      ppc64-softmmu/hw/net/spapr_llan.o
  CC      ppc-softmmu/hw/display/virtio-gpu.o
  CC      ppc64-softmmu/hw/net/xilinx_ethlite.o
  CC      ppc64-softmmu/hw/net/virtio-net.o
  CC      ppc-softmmu/hw/display/virtio-gpu-3d.o
  CC      ppc64-softmmu/hw/net/vhost_net.o
  CC      ppc64-softmmu/hw/net/fsl_etsec/etsec.o
  CC      ppc-softmmu/hw/display/virtio-gpu-pci.o
  CC      ppc64-softmmu/hw/net/fsl_etsec/registers.o
  CC      ppc64-softmmu/hw/net/fsl_etsec/rings.o
  CC      ppc-softmmu/hw/i2c/ppc4xx_i2c.o
  CC      ppc-softmmu/hw/misc/ivshmem.o
  CC      ppc64-softmmu/hw/net/fsl_etsec/miim.o
  CC      ppc64-softmmu/hw/nvram/spapr_nvram.o
  CC      ppc-softmmu/hw/misc/mmio_interface.o
  CC      ppc64-softmmu/hw/scsi/spapr_vscsi.o
  CC      ppc-softmmu/hw/net/xilinx_ethlite.o
  CC      ppc-softmmu/hw/net/virtio-net.o
  CC      ppc64-softmmu/hw/scsi/virtio-scsi.o
  CC      ppc64-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      ppc-softmmu/hw/net/vhost_net.o
  CC      ppc-softmmu/hw/net/fsl_etsec/etsec.o
  CC      ppc64-softmmu/hw/scsi/vhost-scsi-common.o
  CC      ppc-softmmu/hw/net/fsl_etsec/registers.o
  CC      ppc64-softmmu/hw/scsi/vhost-scsi.o
  CC      ppc-softmmu/hw/net/fsl_etsec/rings.o
  CC      ppc64-softmmu/hw/scsi/vhost-user-scsi.o
  CC      ppc-softmmu/hw/net/fsl_etsec/miim.o
  CC      ppc64-softmmu/hw/timer/mc146818rtc.o
  CC      ppc-softmmu/hw/scsi/virtio-scsi.o
  CC      ppc64-softmmu/hw/vfio/common.o
  CC      ppc-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      ppc-softmmu/hw/scsi/vhost-scsi-common.o
  CC      ppc-softmmu/hw/scsi/vhost-scsi.o
  CC      ppc64-softmmu/hw/vfio/pci.o
  CC      ppc-softmmu/hw/scsi/vhost-user-scsi.o
  CC      ppc-softmmu/hw/timer/mc146818rtc.o
  CC      ppc-softmmu/hw/vfio/common.o
  CC      ppc64-softmmu/hw/vfio/pci-quirks.o
  CC      ppc-softmmu/hw/vfio/pci.o
  CC      ppc64-softmmu/hw/vfio/display.o
  CC      ppc64-softmmu/hw/vfio/platform.o
  CC      ppc-softmmu/hw/vfio/pci-quirks.o
  CC      ppc64-softmmu/hw/vfio/spapr.o
  CC      ppc64-softmmu/hw/virtio/virtio.o
  CC      ppc-softmmu/hw/vfio/display.o
  CC      ppc-softmmu/hw/vfio/platform.o
  CC      ppc64-softmmu/hw/virtio/virtio-balloon.o
  CC      ppc-softmmu/hw/vfio/spapr.o
  CC      ppc64-softmmu/hw/virtio/virtio-crypto.o
  CC      ppc-softmmu/hw/virtio/virtio.o
  CC      ppc64-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      ppc64-softmmu/hw/virtio/vhost.o
  CC      ppc-softmmu/hw/virtio/virtio-balloon.o
  CC      ppc64-softmmu/hw/virtio/vhost-backend.o
  CC      ppc-softmmu/hw/virtio/virtio-crypto.o
  CC      ppc64-softmmu/hw/virtio/vhost-user.o
  CC      ppc-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      ppc64-softmmu/hw/virtio/vhost-vsock.o
  CC      ppc-softmmu/hw/virtio/vhost.o
  CC      ppc64-softmmu/hw/ppc/ppc.o
  CC      ppc-softmmu/hw/virtio/vhost-backend.o
  CC      ppc64-softmmu/hw/ppc/ppc_booke.o
  CC      ppc-softmmu/hw/virtio/vhost-user.o
  CC      ppc64-softmmu/hw/ppc/fdt.o
  CC      ppc64-softmmu/hw/ppc/spapr.o
  CC      ppc-softmmu/hw/virtio/vhost-vsock.o
  CC      ppc-softmmu/hw/ppc/ppc.o
  CC      ppc-softmmu/hw/ppc/ppc_booke.o
  CC      ppc-softmmu/hw/ppc/fdt.o
  CC      ppc64-softmmu/hw/ppc/spapr_caps.o
  CC      ppc-softmmu/hw/ppc/ppc4xx_devs.o
  CC      ppc64-softmmu/hw/ppc/spapr_vio.o
  CC      ppc-softmmu/hw/ppc/ppc405_uc.o
  CC      ppc64-softmmu/hw/ppc/spapr_events.o
  CC      ppc-softmmu/hw/ppc/ppc4xx_pci.o
  CC      ppc64-softmmu/hw/ppc/spapr_hcall.o
  CC      ppc-softmmu/hw/ppc/ppc405_boards.o
  CC      ppc-softmmu/hw/ppc/ppc440_bamboo.o
  CC      ppc64-softmmu/hw/ppc/spapr_iommu.o
  CC      ppc-softmmu/hw/ppc/ppc440_pcix.o
  CC      ppc-softmmu/hw/ppc/ppc440_uc.o
  CC      ppc64-softmmu/hw/ppc/spapr_rtas.o
  CC      ppc-softmmu/hw/ppc/sam460ex.o
  CC      ppc64-softmmu/hw/ppc/spapr_pci.o
  CC      ppc-softmmu/hw/ppc/prep.o
  CC      ppc-softmmu/hw/ppc/prep_systemio.o
  CC      ppc64-softmmu/hw/ppc/spapr_rtc.o
  CC      ppc-softmmu/hw/ppc/rs6000_mc.o
  CC      ppc64-softmmu/hw/ppc/spapr_drc.o
  CC      ppc-softmmu/hw/ppc/mac_oldworld.o
  CC      ppc64-softmmu/hw/ppc/spapr_rng.o
  CC      ppc-softmmu/hw/ppc/mac_newworld.o
  CC      ppc64-softmmu/hw/ppc/spapr_cpu_core.o
  CC      ppc-softmmu/hw/ppc/e500.o
  CC      ppc64-softmmu/hw/ppc/spapr_ovec.o
  CC      ppc64-softmmu/hw/ppc/pnv.o
  CC      ppc-softmmu/hw/ppc/mpc8544ds.o
  CC      ppc-softmmu/hw/ppc/e500plat.o
  CC      ppc-softmmu/hw/ppc/mpc8544_guts.o
  CC      ppc64-softmmu/hw/ppc/pnv_xscom.o
  CC      ppc-softmmu/hw/ppc/ppce500_spin.o
  CC      ppc64-softmmu/hw/ppc/pnv_core.o
  CC      ppc-softmmu/hw/ppc/virtex_ml507.o
  CC      ppc64-softmmu/hw/ppc/pnv_lpc.o
  CC      ppc-softmmu/target/ppc/cpu-models.o
  CC      ppc64-softmmu/hw/ppc/pnv_psi.o
  CC      ppc64-softmmu/hw/ppc/pnv_occ.o
  CC      ppc64-softmmu/hw/ppc/pnv_bmc.o
  CC      ppc64-softmmu/hw/ppc/spapr_pci_vfio.o
  CC      ppc64-softmmu/hw/ppc/spapr_rtas_ddw.o
  CC      ppc-softmmu/target/ppc/cpu.o
  CC      ppc-softmmu/target/ppc/translate.o
  CC      ppc64-softmmu/hw/ppc/ppc4xx_devs.o
  CC      ppc64-softmmu/hw/ppc/ppc405_uc.o
  CC      ppc64-softmmu/hw/ppc/ppc4xx_pci.o
  CC      ppc64-softmmu/hw/ppc/ppc405_boards.o
  CC      ppc64-softmmu/hw/ppc/ppc440_bamboo.o
  CC      ppc64-softmmu/hw/ppc/ppc440_pcix.o
  CC      ppc64-softmmu/hw/ppc/ppc440_uc.o
  CC      ppc64-softmmu/hw/ppc/sam460ex.o
  CC      ppc64-softmmu/hw/ppc/prep.o
  CC      ppc64-softmmu/hw/ppc/prep_systemio.o
  CC      ppc64-softmmu/hw/ppc/rs6000_mc.o
  CC      ppc64-softmmu/hw/ppc/mac_oldworld.o
  CC      ppc64-softmmu/hw/ppc/mac_newworld.o
  CC      ppc64-softmmu/hw/ppc/e500.o
  CC      ppc64-softmmu/hw/ppc/mpc8544ds.o
  CC      ppc64-softmmu/hw/ppc/e500plat.o
  CC      ppc64-softmmu/hw/ppc/mpc8544_guts.o
  CC      ppc64-softmmu/hw/ppc/ppce500_spin.o
  CC      ppc64-softmmu/hw/ppc/virtex_ml507.o
  CC      ppc64-softmmu/target/ppc/cpu-models.o
  CC      ppc64-softmmu/target/ppc/cpu.o
  CC      ppc64-softmmu/target/ppc/translate.o
  CC      ppc-softmmu/target/ppc/machine.o
  CC      ppc-softmmu/target/ppc/mmu_helper.o
  CC      ppc-softmmu/target/ppc/mmu-hash32.o
  CC      ppc-softmmu/target/ppc/monitor.o
  CC      ppc-softmmu/target/ppc/arch_dump.o
  CC      ppc-softmmu/target/ppc/kvm-stub.o
  CC      ppc-softmmu/target/ppc/dfp_helper.o
  CC      ppc-softmmu/target/ppc/excp_helper.o
  CC      ppc-softmmu/target/ppc/fpu_helper.o
  CC      ppc-softmmu/target/ppc/int_helper.o
  CC      ppc-softmmu/target/ppc/timebase_helper.o
  CC      ppc64-softmmu/target/ppc/machine.o
  CC      ppc-softmmu/target/ppc/misc_helper.o
  CC      ppc64-softmmu/target/ppc/mmu_helper.o
  CC      ppc-softmmu/target/ppc/mem_helper.o
  CC      ppc-softmmu/target/ppc/gdbstub.o
  CC      ppc64-softmmu/target/ppc/mmu-hash32.o
  CC      ppc-softmmu/target/ppc/../../libdecnumber/decContext.o
  CC      ppc-softmmu/target/ppc/../../libdecnumber/decNumber.o
  CC      ppc64-softmmu/target/ppc/monitor.o
  CC      ppc64-softmmu/target/ppc/arch_dump.o
  CC      ppc64-softmmu/target/ppc/mmu-hash64.o
  CC      ppc64-softmmu/target/ppc/mmu-book3s-v3.o
  CC      ppc64-softmmu/target/ppc/compat.o
  CC      ppc64-softmmu/target/ppc/mmu-radix64.o
  CC      ppc64-softmmu/target/ppc/kvm-stub.o
  CC      ppc-softmmu/target/ppc/../../libdecnumber/dpd/decimal32.o
  CC      ppc64-softmmu/target/ppc/dfp_helper.o
  CC      ppc-softmmu/target/ppc/../../libdecnumber/dpd/decimal64.o
  CC      ppc-softmmu/target/ppc/../../libdecnumber/dpd/decimal128.o
  GEN     trace/generated-helpers.c
  CC      ppc-softmmu/trace/control-target.o
  CC      ppc64-softmmu/target/ppc/excp_helper.o
  CC      ppc-softmmu/gdbstub-xml.o
  CC      ppc-softmmu/trace/generated-helpers.o
  LINK    ppc-softmmu/qemu-system-ppc
  CC      ppc64-softmmu/target/ppc/fpu_helper.o
  GEN     riscv32-softmmu/hmp-commands.h
  GEN     riscv32-softmmu/hmp-commands-info.h
  GEN     riscv32-softmmu/config-target.h
  CC      riscv32-softmmu/exec.o
  CC      riscv32-softmmu/tcg/tcg.o
  CC      riscv32-softmmu/tcg/tcg-op.o
  CC      riscv32-softmmu/tcg/tcg-op-vec.o
  CC      riscv32-softmmu/tcg/tcg-op-gvec.o
  CC      riscv32-softmmu/tcg/tcg-common.o
  CC      riscv32-softmmu/tcg/optimize.o
  CC      riscv32-softmmu/fpu/softfloat.o
  CC      riscv32-softmmu/disas.o
  CC      riscv32-softmmu/arch_init.o
  CC      riscv32-softmmu/cpus.o
  CC      riscv32-softmmu/monitor.o
  CC      riscv32-softmmu/gdbstub.o
  CC      riscv32-softmmu/balloon.o
  CC      riscv32-softmmu/ioport.o
  CC      riscv32-softmmu/numa.o
  CC      riscv32-softmmu/qtest.o
  CC      riscv32-softmmu/memory.o
  CC      riscv32-softmmu/memory_mapping.o
  CC      riscv32-softmmu/dump.o
  CC      riscv32-softmmu/migration/ram.o
  CC      riscv32-softmmu/accel/accel.o
  CC      riscv32-softmmu/accel/stubs/hax-stub.o
  CC      riscv32-softmmu/accel/stubs/hvf-stub.o
  CC      riscv32-softmmu/accel/stubs/whpx-stub.o
  CC      riscv32-softmmu/accel/stubs/kvm-stub.o
  CC      riscv32-softmmu/accel/tcg/tcg-all.o
  CC      riscv32-softmmu/accel/tcg/cputlb.o
  CC      riscv32-softmmu/accel/tcg/tcg-runtime.o
  CC      riscv32-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      riscv32-softmmu/accel/tcg/cpu-exec.o
  CC      riscv32-softmmu/accel/tcg/cpu-exec-common.o
  CC      riscv32-softmmu/accel/tcg/translate-all.o
  CC      riscv32-softmmu/accel/tcg/translator.o
  CC      riscv32-softmmu/hw/9pfs/virtio-9p-device.o
  CC      riscv32-softmmu/hw/block/virtio-blk.o
  CC      riscv32-softmmu/hw/block/vhost-user-blk.o
  CC      riscv32-softmmu/hw/block/dataplane/virtio-blk.o
  CC      riscv32-softmmu/hw/char/virtio-serial-bus.o
  CC      riscv32-softmmu/hw/core/generic-loader.o
  CC      riscv32-softmmu/hw/core/null-machine.o
  CC      riscv32-softmmu/hw/display/virtio-gpu.o
  CC      riscv32-softmmu/hw/display/virtio-gpu-3d.o
  CC      riscv32-softmmu/hw/misc/mmio_interface.o
  CC      riscv32-softmmu/hw/net/virtio-net.o
  CC      riscv32-softmmu/hw/net/vhost_net.o
  CC      riscv32-softmmu/hw/net/rocker/qmp-norocker.o
  CC      riscv32-softmmu/hw/scsi/virtio-scsi.o
  CC      riscv32-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      riscv32-softmmu/hw/scsi/vhost-scsi-common.o
  CC      riscv32-softmmu/hw/scsi/vhost-scsi.o
  CC      riscv32-softmmu/hw/scsi/vhost-user-scsi.o
  CC      riscv32-softmmu/hw/vfio/common.o
  CC      riscv32-softmmu/hw/vfio/platform.o
  CC      riscv32-softmmu/hw/vfio/spapr.o
  CC      riscv32-softmmu/hw/virtio/virtio.o
  CC      riscv32-softmmu/hw/virtio/virtio-balloon.o
  CC      riscv32-softmmu/hw/virtio/virtio-crypto.o
  CC      riscv32-softmmu/hw/virtio/vhost.o
  CC      riscv32-softmmu/hw/virtio/vhost-backend.o
  CC      riscv32-softmmu/hw/virtio/vhost-user.o
  CC      riscv32-softmmu/hw/virtio/vhost-vsock.o
  CC      riscv32-softmmu/hw/riscv/riscv_htif.o
  CC      riscv32-softmmu/hw/riscv/riscv_hart.o
  CC      riscv32-softmmu/hw/riscv/sifive_e.o
  CC      riscv32-softmmu/hw/riscv/sifive_clint.o
  CC      riscv32-softmmu/hw/riscv/sifive_prci.o
  CC      riscv32-softmmu/hw/riscv/sifive_plic.o
  CC      riscv32-softmmu/hw/riscv/sifive_test.o
  CC      riscv32-softmmu/hw/riscv/sifive_u.o
  CC      riscv32-softmmu/hw/riscv/sifive_uart.o
  CC      riscv32-softmmu/hw/riscv/spike.o
  CC      riscv32-softmmu/hw/riscv/virt.o
  CC      riscv32-softmmu/target/riscv/translate.o
  CC      riscv32-softmmu/target/riscv/op_helper.o
  CC      riscv32-softmmu/target/riscv/helper.o
  CC      riscv32-softmmu/target/riscv/cpu.o
  CC      riscv32-softmmu/target/riscv/fpu_helper.o
  CC      riscv32-softmmu/target/riscv/gdbstub.o
  CC      riscv32-softmmu/target/riscv/pmp.o
  GEN     trace/generated-helpers.c
  CC      riscv32-softmmu/trace/control-target.o
  CC      riscv32-softmmu/trace/generated-helpers.o
  LINK    riscv32-softmmu/qemu-system-riscv32
  CC      mips64el-softmmu/target/mips/mips-semi.o
  GEN     riscv64-softmmu/hmp-commands.h
  CC      mips64el-softmmu/target/mips/machine.o
  GEN     riscv64-softmmu/hmp-commands-info.h
  GEN     riscv64-softmmu/config-target.h
  CC      riscv64-softmmu/exec.o
  CC      mips64el-softmmu/target/mips/cp0_timer.o
  GEN     trace/generated-helpers.c
  CC      mips64el-softmmu/trace/control-target.o
  CC      mips64el-softmmu/trace/generated-helpers.o
  LINK    mips64el-softmmu/qemu-system-mips64el
  CC      riscv64-softmmu/tcg/tcg.o
  CC      ppc64-softmmu/target/ppc/int_helper.o
  CC      nios2-softmmu/target/nios2/helper.o
  CC      ppc64-softmmu/target/ppc/timebase_helper.o
  CC      riscv64-softmmu/tcg/tcg-op.o
  CC      ppc64-softmmu/target/ppc/misc_helper.o
  CC      ppc64-softmmu/target/ppc/mem_helper.o
  CC      nios2-softmmu/target/nios2/cpu.o
  CC      ppc64-softmmu/target/ppc/gdbstub.o
  CC      ppc64-softmmu/target/ppc/../../libdecnumber/decContext.o
  CC      nios2-softmmu/target/nios2/mmu.o
  CC      nios2-softmmu/target/nios2/monitor.o
  CC      ppc64-softmmu/target/ppc/../../libdecnumber/decNumber.o
  GEN     trace/generated-helpers.c
  CC      nios2-softmmu/trace/control-target.o
  CC      ppc64-softmmu/target/ppc/../../libdecnumber/dpd/decimal32.o
  CC      nios2-softmmu/trace/generated-helpers.o
  CC      ppc64-softmmu/target/ppc/../../libdecnumber/dpd/decimal64.o
  LINK    nios2-softmmu/qemu-system-nios2
  CC      ppc64-softmmu/target/ppc/../../libdecnumber/dpd/decimal128.o
  GEN     trace/generated-helpers.c
  CC      ppc64-softmmu/trace/control-target.o
  CC      ppc64-softmmu/gdbstub-xml.o
  CC      ppc64-softmmu/trace/generated-helpers.o
  CC      riscv64-softmmu/tcg/tcg-op-vec.o
  CC      riscv64-softmmu/tcg/tcg-op-gvec.o
  LINK    ppc64-softmmu/qemu-system-ppc64
  CC      riscv64-softmmu/tcg/tcg-common.o
  CC      riscv64-softmmu/tcg/optimize.o
  CC      riscv64-softmmu/fpu/softfloat.o
  GEN     s390x-softmmu/hmp-commands.h
  GEN     s390x-softmmu/hmp-commands-info.h
  CC      s390x-softmmu/gen-features
  GEN     s390x-softmmu/config-target.h
  GEN     s390x-softmmu/gen-features.h
  CC      s390x-softmmu/exec.o
  GEN     sh4eb-softmmu/hmp-commands.h
  GEN     sh4eb-softmmu/hmp-commands-info.h
  GEN     sh4eb-softmmu/config-target.h
  CC      sh4eb-softmmu/exec.o
  GEN     sh4-softmmu/hmp-commands.h
  GEN     sh4-softmmu/hmp-commands-info.h
  GEN     sh4-softmmu/config-target.h
  CC      sh4-softmmu/exec.o
  CC      s390x-softmmu/tcg/tcg.o
  CC      sh4eb-softmmu/tcg/tcg.o
  CC      riscv64-softmmu/disas.o
  CC      s390x-softmmu/tcg/tcg-op.o
  CC      sh4-softmmu/tcg/tcg.o
  CC      riscv64-softmmu/arch_init.o
  CC      riscv64-softmmu/cpus.o
  CC      sh4eb-softmmu/tcg/tcg-op.o
  CC      riscv64-softmmu/monitor.o
  CC      sh4-softmmu/tcg/tcg-op.o
  CC      s390x-softmmu/tcg/tcg-op-vec.o
  CC      s390x-softmmu/tcg/tcg-op-gvec.o
  CC      sh4eb-softmmu/tcg/tcg-op-vec.o
  CC      riscv64-softmmu/gdbstub.o
  CC      sh4eb-softmmu/tcg/tcg-op-gvec.o
  CC      sh4-softmmu/tcg/tcg-op-vec.o
  CC      riscv64-softmmu/balloon.o
  CC      sh4-softmmu/tcg/tcg-op-gvec.o
  CC      riscv64-softmmu/ioport.o
  CC      s390x-softmmu/tcg/tcg-common.o
  CC      riscv64-softmmu/numa.o
  CC      sh4eb-softmmu/tcg/tcg-common.o
  CC      s390x-softmmu/tcg/optimize.o
  CC      sh4eb-softmmu/tcg/optimize.o
  CC      riscv64-softmmu/qtest.o
  CC      riscv64-softmmu/memory.o
  CC      sh4-softmmu/tcg/tcg-common.o
  CC      s390x-softmmu/fpu/softfloat.o
  CC      sh4eb-softmmu/fpu/softfloat.o
  CC      sh4-softmmu/tcg/optimize.o
  CC      riscv64-softmmu/memory_mapping.o
  CC      sh4-softmmu/fpu/softfloat.o
  CC      riscv64-softmmu/dump.o
  CC      riscv64-softmmu/migration/ram.o
  CC      s390x-softmmu/disas.o
  CC      riscv64-softmmu/accel/accel.o
  CC      sh4eb-softmmu/disas.o
  GEN     s390x-softmmu/gdbstub-xml.c
  CC      riscv64-softmmu/accel/stubs/hax-stub.o
  CC      sh4eb-softmmu/arch_init.o
  CC      riscv64-softmmu/accel/stubs/hvf-stub.o
  CC      sh4eb-softmmu/cpus.o
  CC      riscv64-softmmu/accel/stubs/whpx-stub.o
  CC      sh4-softmmu/disas.o
  CC      riscv64-softmmu/accel/stubs/kvm-stub.o
  CC      s390x-softmmu/arch_init.o
  CC      s390x-softmmu/cpus.o
  CC      riscv64-softmmu/accel/tcg/tcg-all.o
  CC      sh4-softmmu/arch_init.o
  CC      sh4eb-softmmu/monitor.o
  CC      riscv64-softmmu/accel/tcg/cputlb.o
  CC      sh4-softmmu/cpus.o
  CC      s390x-softmmu/monitor.o
  CC      sh4-softmmu/monitor.o
  CC      sh4eb-softmmu/gdbstub.o
  CC      s390x-softmmu/gdbstub.o
  CC      riscv64-softmmu/accel/tcg/tcg-runtime.o
  CC      sh4eb-softmmu/balloon.o
  CC      sh4-softmmu/gdbstub.o
  CC      riscv64-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      sh4eb-softmmu/ioport.o
  CC      s390x-softmmu/balloon.o
  CC      sh4eb-softmmu/numa.o
  CC      s390x-softmmu/ioport.o
  CC      sh4-softmmu/balloon.o
  CC      sh4eb-softmmu/qtest.o
  CC      riscv64-softmmu/accel/tcg/cpu-exec.o
  CC      s390x-softmmu/numa.o
  CC      sh4-softmmu/ioport.o
  CC      sh4eb-softmmu/memory.o
  CC      riscv64-softmmu/accel/tcg/cpu-exec-common.o
  CC      s390x-softmmu/qtest.o
  CC      riscv64-softmmu/accel/tcg/translate-all.o
  CC      sh4-softmmu/numa.o
  CC      s390x-softmmu/memory.o
  CC      riscv64-softmmu/accel/tcg/translator.o
  CC      sh4-softmmu/qtest.o
  CC      sh4eb-softmmu/memory_mapping.o
  CC      sh4-softmmu/memory.o
  CC      riscv64-softmmu/hw/9pfs/virtio-9p-device.o
  CC      sh4eb-softmmu/dump.o
  CC      riscv64-softmmu/hw/block/virtio-blk.o
  CC      s390x-softmmu/memory_mapping.o
  CC      sh4eb-softmmu/migration/ram.o
  CC      s390x-softmmu/dump.o
  CC      riscv64-softmmu/hw/block/vhost-user-blk.o
  CC      sh4-softmmu/memory_mapping.o
  CC      riscv64-softmmu/hw/block/dataplane/virtio-blk.o
  CC      sh4-softmmu/dump.o
  CC      sh4eb-softmmu/accel/accel.o
  CC      riscv64-softmmu/hw/char/virtio-serial-bus.o
  CC      s390x-softmmu/migration/ram.o
  CC      sh4eb-softmmu/accel/stubs/hax-stub.o
  CC      sh4-softmmu/migration/ram.o
  CC      sh4eb-softmmu/accel/stubs/hvf-stub.o
  CC      riscv64-softmmu/hw/core/generic-loader.o
  CC      riscv64-softmmu/hw/core/null-machine.o
  CC      sh4eb-softmmu/accel/stubs/whpx-stub.o
  CC      s390x-softmmu/accel/accel.o
  CC      riscv64-softmmu/hw/display/virtio-gpu.o
  CC      sh4eb-softmmu/accel/stubs/kvm-stub.o
  CC      s390x-softmmu/accel/kvm/kvm-all.o
  CC      sh4eb-softmmu/accel/tcg/tcg-all.o
  CC      sh4-softmmu/accel/accel.o
  CC      sh4-softmmu/accel/stubs/hax-stub.o
  CC      sh4eb-softmmu/accel/tcg/cputlb.o
  CC      riscv64-softmmu/hw/display/virtio-gpu-3d.o
  CC      sh4-softmmu/accel/stubs/hvf-stub.o
  CC      s390x-softmmu/accel/kvm/sev-stub.o
  CC      sh4-softmmu/accel/stubs/whpx-stub.o
  CC      riscv64-softmmu/hw/misc/mmio_interface.o
  CC      sh4-softmmu/accel/stubs/kvm-stub.o
  CC      s390x-softmmu/accel/stubs/hax-stub.o
  CC      s390x-softmmu/accel/stubs/hvf-stub.o
  CC      riscv64-softmmu/hw/net/virtio-net.o
  CC      s390x-softmmu/accel/stubs/whpx-stub.o
  CC      sh4-softmmu/accel/tcg/tcg-all.o
  CC      s390x-softmmu/accel/tcg/tcg-all.o
  CC      sh4-softmmu/accel/tcg/cputlb.o
  CC      riscv64-softmmu/hw/net/vhost_net.o
  CC      s390x-softmmu/accel/tcg/cputlb.o
  CC      riscv64-softmmu/hw/net/rocker/qmp-norocker.o
  CC      sh4eb-softmmu/accel/tcg/tcg-runtime.o
  CC      riscv64-softmmu/hw/scsi/virtio-scsi.o
  CC      sh4eb-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      riscv64-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      sh4-softmmu/accel/tcg/tcg-runtime.o
  CC      sh4eb-softmmu/accel/tcg/cpu-exec.o
  CC      riscv64-softmmu/hw/scsi/vhost-scsi-common.o
  CC      s390x-softmmu/accel/tcg/tcg-runtime.o
  CC      sh4-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      riscv64-softmmu/hw/scsi/vhost-scsi.o
  CC      sh4eb-softmmu/accel/tcg/cpu-exec-common.o
  CC      s390x-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      sh4eb-softmmu/accel/tcg/translate-all.o
  CC      riscv64-softmmu/hw/scsi/vhost-user-scsi.o
  CC      sh4eb-softmmu/accel/tcg/translator.o
  CC      riscv64-softmmu/hw/vfio/common.o
  CC      sh4-softmmu/accel/tcg/cpu-exec.o
  CC      s390x-softmmu/accel/tcg/cpu-exec.o
  CC      sh4eb-softmmu/hw/9pfs/virtio-9p-device.o
  CC      sh4-softmmu/accel/tcg/cpu-exec-common.o
  CC      sh4-softmmu/accel/tcg/translate-all.o
  CC      riscv64-softmmu/hw/vfio/platform.o
  CC      sh4eb-softmmu/hw/block/tc58128.o
  CC      s390x-softmmu/accel/tcg/cpu-exec-common.o
  CC      s390x-softmmu/accel/tcg/translate-all.o
  CC      sh4eb-softmmu/hw/block/virtio-blk.o
  CC      sh4-softmmu/accel/tcg/translator.o
  CC      riscv64-softmmu/hw/vfio/spapr.o
  CC      sh4-softmmu/hw/9pfs/virtio-9p-device.o
  CC      sh4eb-softmmu/hw/block/vhost-user-blk.o
  CC      s390x-softmmu/accel/tcg/translator.o
  CC      riscv64-softmmu/hw/virtio/virtio.o
  CC      sh4-softmmu/hw/block/tc58128.o
  CC      sh4eb-softmmu/hw/block/dataplane/virtio-blk.o
  CC      sh4-softmmu/hw/block/virtio-blk.o
  CC      s390x-softmmu/hw/9pfs/virtio-9p-device.o
  CC      sh4eb-softmmu/hw/char/sh_serial.o
  CC      s390x-softmmu/hw/block/virtio-blk.o
  CC      sh4-softmmu/hw/block/vhost-user-blk.o
  CC      sh4eb-softmmu/hw/char/virtio-serial-bus.o
  CC      riscv64-softmmu/hw/virtio/virtio-balloon.o
  CC      sh4-softmmu/hw/block/dataplane/virtio-blk.o
  CC      s390x-softmmu/hw/block/vhost-user-blk.o
  CC      riscv64-softmmu/hw/virtio/virtio-crypto.o
  CC      sh4-softmmu/hw/char/sh_serial.o
  CC      sh4eb-softmmu/hw/core/generic-loader.o
  CC      sh4-softmmu/hw/char/virtio-serial-bus.o
  CC      s390x-softmmu/hw/block/dataplane/virtio-blk.o
  CC      sh4eb-softmmu/hw/core/null-machine.o
  CC      riscv64-softmmu/hw/virtio/vhost.o
  CC      s390x-softmmu/hw/char/virtio-serial-bus.o
  CC      sh4eb-softmmu/hw/display/sm501.o
  CC      sh4-softmmu/hw/core/generic-loader.o
  CC      riscv64-softmmu/hw/virtio/vhost-backend.o
  CC      s390x-softmmu/hw/char/terminal3270.o
  CC      sh4-softmmu/hw/core/null-machine.o
  CC      sh4eb-softmmu/hw/display/vga.o
  CC      sh4-softmmu/hw/display/sm501.o
  CC      riscv64-softmmu/hw/virtio/vhost-user.o
  CC      s390x-softmmu/hw/core/generic-loader.o
  CC      s390x-softmmu/hw/core/null-machine.o
  CC      riscv64-softmmu/hw/virtio/vhost-vsock.o
  CC      s390x-softmmu/hw/display/virtio-gpu.o
  CC      sh4-softmmu/hw/display/vga.o
  CC      sh4eb-softmmu/hw/display/virtio-gpu.o
  CC      riscv64-softmmu/hw/riscv/riscv_htif.o
  CC      riscv64-softmmu/hw/riscv/riscv_hart.o
  CC      s390x-softmmu/hw/display/virtio-gpu-3d.o
  CC      riscv64-softmmu/hw/riscv/sifive_e.o
  CC      sh4eb-softmmu/hw/display/virtio-gpu-3d.o
  CC      riscv64-softmmu/hw/riscv/sifive_clint.o
  CC      sh4-softmmu/hw/display/virtio-gpu.o
  CC      riscv64-softmmu/hw/riscv/sifive_prci.o
  CC      s390x-softmmu/hw/display/virtio-gpu-pci.o
  CC      sh4eb-softmmu/hw/display/virtio-gpu-pci.o
  CC      riscv64-softmmu/hw/riscv/sifive_plic.o
  CC      s390x-softmmu/hw/intc/s390_flic.o
  CC      sh4eb-softmmu/hw/intc/sh_intc.o
  CC      sh4-softmmu/hw/display/virtio-gpu-3d.o
  CC      riscv64-softmmu/hw/riscv/sifive_test.o
  CC      s390x-softmmu/hw/intc/s390_flic_kvm.o
  CC      sh4eb-softmmu/hw/misc/ivshmem.o
  CC      riscv64-softmmu/hw/riscv/sifive_u.o
  CC      sh4-softmmu/hw/display/virtio-gpu-pci.o
  CC      s390x-softmmu/hw/misc/mmio_interface.o
  CC      riscv64-softmmu/hw/riscv/sifive_uart.o
  CC      sh4eb-softmmu/hw/misc/mmio_interface.o
  CC      sh4eb-softmmu/hw/net/virtio-net.o
  CC      riscv64-softmmu/hw/riscv/spike.o
  CC      s390x-softmmu/hw/net/virtio-net.o
  CC      sh4-softmmu/hw/intc/sh_intc.o
  CC      riscv64-softmmu/hw/riscv/virt.o
  CC      sh4-softmmu/hw/misc/ivshmem.o
  CC      sh4eb-softmmu/hw/net/vhost_net.o
  CC      riscv64-softmmu/target/riscv/translate.o
  CC      s390x-softmmu/hw/net/vhost_net.o
  CC      sh4eb-softmmu/hw/scsi/virtio-scsi.o
  CC      sh4-softmmu/hw/misc/mmio_interface.o
  CC      s390x-softmmu/hw/net/rocker/qmp-norocker.o
  CC      sh4eb-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      s390x-softmmu/hw/scsi/virtio-scsi.o
  CC      sh4-softmmu/hw/net/virtio-net.o
  CC      sh4eb-softmmu/hw/scsi/vhost-scsi-common.o
  CC      s390x-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      riscv64-softmmu/target/riscv/op_helper.o
  CC      sh4eb-softmmu/hw/scsi/vhost-scsi.o
  CC      riscv64-softmmu/target/riscv/helper.o
  CC      sh4-softmmu/hw/net/vhost_net.o
  CC      s390x-softmmu/hw/scsi/vhost-scsi-common.o
  CC      sh4eb-softmmu/hw/scsi/vhost-user-scsi.o
  CC      sh4-softmmu/hw/scsi/virtio-scsi.o
  CC      s390x-softmmu/hw/scsi/vhost-scsi.o
  CC      sh4eb-softmmu/hw/timer/sh_timer.o
  CC      riscv64-softmmu/target/riscv/cpu.o
  CC      s390x-softmmu/hw/scsi/vhost-user-scsi.o
  CC      riscv64-softmmu/target/riscv/fpu_helper.o
  CC      sh4eb-softmmu/hw/timer/mc146818rtc.o
  CC      sh4-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      s390x-softmmu/hw/vfio/common.o
  CC      riscv64-softmmu/target/riscv/gdbstub.o
  CC      sh4-softmmu/hw/scsi/vhost-scsi-common.o
  CC      sh4eb-softmmu/hw/vfio/common.o
  CC      riscv64-softmmu/target/riscv/pmp.o
  CC      sh4-softmmu/hw/scsi/vhost-scsi.o
  GEN     trace/generated-helpers.c
  CC      s390x-softmmu/hw/vfio/pci.o
  CC      riscv64-softmmu/trace/control-target.o
  CC      sh4-softmmu/hw/scsi/vhost-user-scsi.o
  CC      sh4eb-softmmu/hw/vfio/pci.o
  CC      riscv64-softmmu/trace/generated-helpers.o
  CC      sh4-softmmu/hw/timer/sh_timer.o
  LINK    riscv64-softmmu/qemu-system-riscv64
  CC      sh4-softmmu/hw/timer/mc146818rtc.o
  CC      s390x-softmmu/hw/vfio/pci-quirks.o
  CC      sh4-softmmu/hw/vfio/common.o
  CC      sh4eb-softmmu/hw/vfio/pci-quirks.o
  CC      s390x-softmmu/hw/vfio/display.o
  CC      sh4-softmmu/hw/vfio/pci.o
  GEN     sparc64-softmmu/hmp-commands.h
  GEN     sparc64-softmmu/hmp-commands-info.h
  GEN     sparc64-softmmu/config-target.h
  CC      sparc64-softmmu/exec.o
  CC      s390x-softmmu/hw/vfio/ccw.o
  CC      s390x-softmmu/hw/vfio/platform.o
  CC      sh4-softmmu/hw/vfio/pci-quirks.o
  CC      s390x-softmmu/hw/vfio/spapr.o
  CC      s390x-softmmu/hw/virtio/virtio.o
  CC      sh4-softmmu/hw/vfio/display.o
  CC      sparc64-softmmu/tcg/tcg.o
  CC      sh4-softmmu/hw/vfio/platform.o
  CC      s390x-softmmu/hw/virtio/virtio-balloon.o
  CC      sh4-softmmu/hw/vfio/spapr.o
  CC      s390x-softmmu/hw/virtio/virtio-crypto.o
  CC      sh4-softmmu/hw/virtio/virtio.o
  CC      s390x-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      s390x-softmmu/hw/virtio/vhost.o
  CC      sparc64-softmmu/tcg/tcg-op.o
  CC      sh4-softmmu/hw/virtio/virtio-balloon.o
  CC      s390x-softmmu/hw/virtio/vhost-backend.o
  CC      sh4-softmmu/hw/virtio/virtio-crypto.o
  CC      s390x-softmmu/hw/virtio/vhost-user.o
  CC      sh4-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      sh4-softmmu/hw/virtio/vhost.o
  CC      s390x-softmmu/hw/virtio/vhost-vsock.o
  CC      s390x-softmmu/hw/s390x/s390-virtio-hcall.o
  CC      s390x-softmmu/hw/s390x/sclp.o
  CC      sh4-softmmu/hw/virtio/vhost-backend.o
  CC      sparc64-softmmu/tcg/tcg-op-vec.o
  CC      s390x-softmmu/hw/s390x/event-facility.o
  CC      sh4-softmmu/hw/virtio/vhost-user.o
  CC      sparc64-softmmu/tcg/tcg-op-gvec.o
  CC      s390x-softmmu/hw/s390x/sclpquiesce.o
  CC      sh4-softmmu/hw/virtio/vhost-vsock.o
  CC      s390x-softmmu/hw/s390x/sclpcpu.o
  CC      s390x-softmmu/hw/s390x/ipl.o
  CC      sh4-softmmu/hw/sh4/shix.o
  CC      sh4-softmmu/hw/sh4/r2d.o
  CC      s390x-softmmu/hw/s390x/css.o
  CC      sh4-softmmu/hw/sh4/sh7750.o
  CC      sh4-softmmu/hw/sh4/sh7750_regnames.o
  CC      sh4-softmmu/hw/sh4/sh_pci.o
  CC      sparc64-softmmu/tcg/tcg-common.o
  CC      s390x-softmmu/hw/s390x/s390-virtio-ccw.o
  CC      sh4-softmmu/target/sh4/translate.o
  CC      sparc64-softmmu/tcg/optimize.o
  CC      s390x-softmmu/hw/s390x/3270-ccw.o
  CC      sparc64-softmmu/fpu/softfloat.o
  CC      s390x-softmmu/hw/s390x/virtio-ccw.o
  CC      sh4-softmmu/target/sh4/op_helper.o
  CC      s390x-softmmu/hw/s390x/css-bridge.o
  CC      sh4-softmmu/target/sh4/helper.o
  CC      s390x-softmmu/hw/s390x/ccw-device.o
  CC      s390x-softmmu/hw/s390x/s390-pci-bus.o
  CC      sh4-softmmu/target/sh4/cpu.o
  CC      sh4-softmmu/target/sh4/monitor.o
  CC      s390x-softmmu/hw/s390x/s390-pci-inst.o
  CC      sh4-softmmu/target/sh4/gdbstub.o
  GEN     trace/generated-helpers.c
  CC      sh4-softmmu/trace/control-target.o
  CC      s390x-softmmu/hw/s390x/s390-skeys.o
  CC      sh4-softmmu/trace/generated-helpers.o
  CC      s390x-softmmu/hw/s390x/s390-stattrib.o
  LINK    sh4-softmmu/qemu-system-sh4
  CC      s390x-softmmu/hw/s390x/s390-skeys-kvm.o
  CC      s390x-softmmu/hw/s390x/s390-stattrib-kvm.o
  CC      s390x-softmmu/hw/s390x/s390-ccw.o
  CC      s390x-softmmu/target/s390x/cpu.o
  CC      sparc64-softmmu/disas.o
  CC      s390x-softmmu/target/s390x/cpu_models.o
  CC      sparc64-softmmu/arch_init.o
  CC      sparc64-softmmu/cpus.o
  CC      sh4eb-softmmu/hw/vfio/display.o
  CC      s390x-softmmu/target/s390x/cpu_features.o
  CC      s390x-softmmu/target/s390x/gdbstub.o
  GEN     sparc-softmmu/hmp-commands.h
  CC      sh4eb-softmmu/hw/vfio/platform.o
  CC      sparc64-softmmu/monitor.o
  GEN     sparc-softmmu/hmp-commands-info.h
  GEN     sparc-softmmu/config-target.h
  CC      s390x-softmmu/target/s390x/interrupt.o
  CC      sparc-softmmu/exec.o
  CC      s390x-softmmu/target/s390x/helper.o
  CC      sh4eb-softmmu/hw/vfio/spapr.o
  CC      s390x-softmmu/target/s390x/translate.o
  CC      sh4eb-softmmu/hw/virtio/virtio.o
  CC      sparc64-softmmu/gdbstub.o
  CC      sh4eb-softmmu/hw/virtio/virtio-balloon.o
  CC      sparc-softmmu/tcg/tcg.o
  CC      sparc64-softmmu/balloon.o
  CC      sparc64-softmmu/ioport.o
  CC      sh4eb-softmmu/hw/virtio/virtio-crypto.o
  CC      sparc64-softmmu/numa.o
  CC      sh4eb-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      sparc64-softmmu/qtest.o
  CC      sh4eb-softmmu/hw/virtio/vhost.o
  CC      sparc64-softmmu/memory.o
  CC      sparc-softmmu/tcg/tcg-op.o
  CC      s390x-softmmu/target/s390x/cc_helper.o
  CC      sh4eb-softmmu/hw/virtio/vhost-backend.o
  CC      s390x-softmmu/target/s390x/excp_helper.o
  CC      sh4eb-softmmu/hw/virtio/vhost-user.o
  CC      sparc64-softmmu/memory_mapping.o
  CC      s390x-softmmu/target/s390x/fpu_helper.o
  CC      sparc64-softmmu/dump.o
  CC      sh4eb-softmmu/hw/virtio/vhost-vsock.o
  CC      sparc-softmmu/tcg/tcg-op-vec.o
  CC      s390x-softmmu/target/s390x/int_helper.o
  CC      sh4eb-softmmu/hw/sh4/shix.o
  CC      sh4eb-softmmu/hw/sh4/r2d.o
  CC      s390x-softmmu/target/s390x/mem_helper.o
  CC      sparc-softmmu/tcg/tcg-op-gvec.o
  CC      sparc64-softmmu/migration/ram.o
  CC      sh4eb-softmmu/hw/sh4/sh7750.o
  CC      sh4eb-softmmu/hw/sh4/sh7750_regnames.o
  CC      sparc64-softmmu/accel/accel.o
  CC      sh4eb-softmmu/hw/sh4/sh_pci.o
  CC      sparc64-softmmu/accel/stubs/hax-stub.o
  CC      sparc-softmmu/tcg/tcg-common.o
  CC      sh4eb-softmmu/target/sh4/translate.o
  CC      sparc64-softmmu/accel/stubs/hvf-stub.o
  CC      sparc-softmmu/tcg/optimize.o
  CC      s390x-softmmu/target/s390x/misc_helper.o
  CC      sparc64-softmmu/accel/stubs/whpx-stub.o
  CC      sparc64-softmmu/accel/stubs/kvm-stub.o
  CC      s390x-softmmu/target/s390x/crypto_helper.o
  CC      sparc-softmmu/fpu/softfloat.o
  CC      sparc64-softmmu/accel/tcg/tcg-all.o
  CC      s390x-softmmu/target/s390x/machine.o
  CC      sh4eb-softmmu/target/sh4/op_helper.o
  CC      sparc64-softmmu/accel/tcg/cputlb.o
  CC      s390x-softmmu/target/s390x/ioinst.o
  CC      sh4eb-softmmu/target/sh4/helper.o
  CC      sh4eb-softmmu/target/sh4/cpu.o
  CC      s390x-softmmu/target/s390x/arch_dump.o
  CC      sh4eb-softmmu/target/sh4/monitor.o
  CC      sh4eb-softmmu/target/sh4/gdbstub.o
  CC      s390x-softmmu/target/s390x/mmu_helper.o
  GEN     trace/generated-helpers.c
  CC      s390x-softmmu/target/s390x/diag.o
  CC      sh4eb-softmmu/trace/control-target.o
  CC      s390x-softmmu/target/s390x/sigp.o
  CC      sh4eb-softmmu/trace/generated-helpers.o
  CC      sparc64-softmmu/accel/tcg/tcg-runtime.o
  LINK    sh4eb-softmmu/qemu-system-sh4eb
  CC      s390x-softmmu/target/s390x/kvm.o
  CC      sparc64-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      sparc-softmmu/disas.o
  GEN     trace/generated-helpers.c
  CC      s390x-softmmu/trace/control-target.o
  CC      s390x-softmmu/gdbstub-xml.o
  CC      sparc-softmmu/arch_init.o
  CC      s390x-softmmu/trace/generated-helpers.o
  CC      sparc-softmmu/cpus.o
  LINK    s390x-softmmu/qemu-system-s390x
  GEN     tricore-softmmu/hmp-commands.h
  GEN     tricore-softmmu/hmp-commands-info.h
  GEN     tricore-softmmu/config-target.h
  CC      tricore-softmmu/exec.o
  CC      sparc-softmmu/monitor.o
  CC      sparc-softmmu/gdbstub.o
  GEN     unicore32-softmmu/hmp-commands.h
  GEN     unicore32-softmmu/hmp-commands-info.h
  GEN     unicore32-softmmu/config-target.h
  CC      unicore32-softmmu/exec.o
  CC      sparc-softmmu/balloon.o
  CC      sparc-softmmu/ioport.o
  CC      sparc-softmmu/numa.o
  CC      sparc-softmmu/qtest.o
  CC      sparc-softmmu/memory.o
  CC      unicore32-softmmu/tcg/tcg.o
  CC      sparc-softmmu/memory_mapping.o
  CC      sparc-softmmu/dump.o
  CC      unicore32-softmmu/tcg/tcg-op.o
  CC      sparc-softmmu/migration/ram.o
  CC      sparc-softmmu/accel/accel.o
  CC      sparc-softmmu/accel/stubs/hax-stub.o
  CC      sparc-softmmu/accel/stubs/hvf-stub.o
  CC      sparc-softmmu/accel/stubs/whpx-stub.o
  CC      unicore32-softmmu/tcg/tcg-op-vec.o
  CC      sparc-softmmu/accel/stubs/kvm-stub.o
  CC      sparc-softmmu/accel/tcg/tcg-all.o
  CC      unicore32-softmmu/tcg/tcg-op-gvec.o
  CC      sparc-softmmu/accel/tcg/cputlb.o
  CC      unicore32-softmmu/tcg/tcg-common.o
  CC      unicore32-softmmu/tcg/optimize.o
  CC      sparc-softmmu/accel/tcg/tcg-runtime.o
  CC      unicore32-softmmu/fpu/softfloat.o
  CC      sparc-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      sparc-softmmu/accel/tcg/cpu-exec.o
  CC      sparc-softmmu/accel/tcg/cpu-exec-common.o
  CC      sparc-softmmu/accel/tcg/translate-all.o
  CC      sparc-softmmu/accel/tcg/translator.o
  CC      sparc-softmmu/hw/core/generic-loader.o
  CC      sparc-softmmu/hw/core/null-machine.o
  CC      sparc-softmmu/hw/display/tcx.o
  CC      sparc-softmmu/hw/display/cg3.o
  CC      unicore32-softmmu/disas.o
  CC      unicore32-softmmu/arch_init.o
  CC      sparc-softmmu/hw/intc/grlib_irqmp.o
  CC      unicore32-softmmu/cpus.o
  CC      sparc-softmmu/hw/misc/eccmemctl.o
  CC      sparc-softmmu/hw/misc/slavio_misc.o
  CC      unicore32-softmmu/monitor.o
  CC      sparc-softmmu/hw/misc/mmio_interface.o
  CC      sparc-softmmu/hw/net/vhost_net.o
  CC      sparc-softmmu/hw/net/rocker/qmp-norocker.o
  CC      sparc-softmmu/hw/vfio/common.o
  CC      sparc-softmmu/hw/vfio/platform.o
  CC      unicore32-softmmu/gdbstub.o
  CC      sparc-softmmu/hw/vfio/spapr.o
  CC      unicore32-softmmu/balloon.o
  CC      sparc-softmmu/hw/sparc/sun4m_iommu.o
  CC      unicore32-softmmu/ioport.o
  CC      sparc-softmmu/hw/sparc/sun4m.o
  CC      unicore32-softmmu/numa.o
  CC      sparc-softmmu/hw/sparc/leon3.o
  CC      unicore32-softmmu/qtest.o
  CC      sparc-softmmu/target/sparc/machine.o
  CC      sparc-softmmu/target/sparc/monitor.o
  CC      unicore32-softmmu/memory.o
  CC      sparc-softmmu/target/sparc/translate.o
  CC      unicore32-softmmu/memory_mapping.o
  CC      unicore32-softmmu/dump.o
  CC      sparc-softmmu/target/sparc/helper.o
  CC      sparc-softmmu/target/sparc/cpu.o
  CC      unicore32-softmmu/migration/ram.o
  CC      sparc-softmmu/target/sparc/fop_helper.o
  CC      sparc-softmmu/target/sparc/cc_helper.o
  CC      sparc-softmmu/target/sparc/win_helper.o
  CC      sparc-softmmu/target/sparc/mmu_helper.o
  CC      unicore32-softmmu/accel/accel.o
  CC      sparc-softmmu/target/sparc/ldst_helper.o
  CC      unicore32-softmmu/accel/stubs/hax-stub.o
  CC      unicore32-softmmu/accel/stubs/hvf-stub.o
  CC      sparc-softmmu/target/sparc/int32_helper.o
  CC      unicore32-softmmu/accel/stubs/whpx-stub.o
  CC      sparc-softmmu/target/sparc/gdbstub.o
  CC      unicore32-softmmu/accel/stubs/kvm-stub.o
  GEN     trace/generated-helpers.c
  CC      sparc-softmmu/trace/control-target.o
  CC      unicore32-softmmu/accel/tcg/tcg-all.o
  CC      sparc-softmmu/trace/generated-helpers.o
  CC      unicore32-softmmu/accel/tcg/cputlb.o
  LINK    sparc-softmmu/qemu-system-sparc
  CC      sparc64-softmmu/accel/tcg/cpu-exec.o
  CC      sparc64-softmmu/accel/tcg/cpu-exec-common.o
  GEN     x86_64-softmmu/hmp-commands.h
  GEN     x86_64-softmmu/hmp-commands-info.h
  GEN     x86_64-softmmu/config-target.h
  CC      x86_64-softmmu/exec.o
  CC      sparc64-softmmu/accel/tcg/translate-all.o
  CC      unicore32-softmmu/accel/tcg/tcg-runtime.o
  CC      unicore32-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      sparc64-softmmu/accel/tcg/translator.o
  CC      sparc64-softmmu/hw/9pfs/virtio-9p-device.o
  CC      sparc64-softmmu/hw/block/virtio-blk.o
  CC      unicore32-softmmu/accel/tcg/cpu-exec.o
  CC      sparc64-softmmu/hw/block/vhost-user-blk.o
  CC      unicore32-softmmu/accel/tcg/cpu-exec-common.o
  CC      x86_64-softmmu/tcg/tcg.o
  CC      sparc64-softmmu/hw/block/dataplane/virtio-blk.o
  CC      unicore32-softmmu/accel/tcg/translate-all.o
  CC      sparc64-softmmu/hw/char/virtio-serial-bus.o
  CC      unicore32-softmmu/accel/tcg/translator.o
  CC      sparc64-softmmu/hw/core/generic-loader.o
  CC      unicore32-softmmu/hw/core/generic-loader.o
  CC      sparc64-softmmu/hw/core/null-machine.o
  CC      unicore32-softmmu/hw/core/null-machine.o
  CC      sparc64-softmmu/hw/display/vga.o
  CC      unicore32-softmmu/hw/misc/mmio_interface.o
  CC      unicore32-softmmu/hw/net/vhost_net.o
  CC      unicore32-softmmu/hw/net/rocker/qmp-norocker.o
  CC      unicore32-softmmu/hw/vfio/common.o
  CC      x86_64-softmmu/tcg/tcg-op.o
  CC      sparc64-softmmu/hw/display/virtio-gpu.o
  CC      unicore32-softmmu/hw/vfio/platform.o
  CC      unicore32-softmmu/hw/vfio/spapr.o
  CC      sparc64-softmmu/hw/display/virtio-gpu-3d.o
  CC      unicore32-softmmu/hw/unicore32/puv3.o
  CC      sparc64-softmmu/hw/display/virtio-gpu-pci.o
  CC      unicore32-softmmu/target/unicore32/translate.o
  CC      sparc64-softmmu/hw/misc/ivshmem.o
  CC      x86_64-softmmu/tcg/tcg-op-vec.o
  CC      sparc64-softmmu/hw/misc/mmio_interface.o
  CC      sparc64-softmmu/hw/net/virtio-net.o
  CC      x86_64-softmmu/tcg/tcg-op-gvec.o
  CC      sparc64-softmmu/hw/net/vhost_net.o
  CC      unicore32-softmmu/target/unicore32/op_helper.o
  CC      sparc64-softmmu/hw/scsi/virtio-scsi.o
  CC      unicore32-softmmu/target/unicore32/helper.o
  CC      unicore32-softmmu/target/unicore32/cpu.o
  CC      sparc64-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      unicore32-softmmu/target/unicore32/ucf64_helper.o
  CC      sparc64-softmmu/hw/scsi/vhost-scsi-common.o
  CC      x86_64-softmmu/tcg/tcg-common.o
  CC      unicore32-softmmu/target/unicore32/softmmu.o
  CC      x86_64-softmmu/tcg/optimize.o
  CC      sparc64-softmmu/hw/scsi/vhost-scsi.o
  GEN     trace/generated-helpers.c
  CC      unicore32-softmmu/trace/control-target.o
  CC      sparc64-softmmu/hw/scsi/vhost-user-scsi.o
  CC      unicore32-softmmu/trace/generated-helpers.o
  CC      sparc64-softmmu/hw/timer/mc146818rtc.o
  LINK    unicore32-softmmu/qemu-system-unicore32
  CC      x86_64-softmmu/fpu/softfloat.o
  CC      sparc64-softmmu/hw/vfio/common.o
  CC      sparc64-softmmu/hw/vfio/pci.o
  GEN     xtensaeb-softmmu/hmp-commands.h
  GEN     xtensaeb-softmmu/hmp-commands-info.h
  GEN     xtensaeb-softmmu/config-target.h
  CC      xtensaeb-softmmu/exec.o
  CC      sparc64-softmmu/hw/vfio/pci-quirks.o
  CC      sparc64-softmmu/hw/vfio/display.o
  CC      sparc64-softmmu/hw/vfio/platform.o
  CC      xtensaeb-softmmu/tcg/tcg.o
  CC      sparc64-softmmu/hw/vfio/spapr.o
  CC      sparc64-softmmu/hw/virtio/virtio.o
  CC      xtensaeb-softmmu/tcg/tcg-op.o
  CC      sparc64-softmmu/hw/virtio/virtio-balloon.o
  CC      sparc64-softmmu/hw/virtio/virtio-crypto.o
  CC      sparc64-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      sparc64-softmmu/hw/virtio/vhost.o
  CC      sparc64-softmmu/hw/virtio/vhost-backend.o
  CC      xtensaeb-softmmu/tcg/tcg-op-vec.o
  CC      sparc64-softmmu/hw/virtio/vhost-user.o
  CC      xtensaeb-softmmu/tcg/tcg-op-gvec.o
  CC      sparc64-softmmu/hw/virtio/vhost-vsock.o
  CC      sparc64-softmmu/hw/sparc64/sparc64.o
  CC      sparc64-softmmu/hw/sparc64/sun4u_iommu.o
  CC      sparc64-softmmu/hw/sparc64/sun4u.o
  CC      sparc64-softmmu/hw/sparc64/niagara.o
  CC      xtensaeb-softmmu/tcg/tcg-common.o
  CC      xtensaeb-softmmu/tcg/optimize.o
  CC      sparc64-softmmu/target/sparc/machine.o
  CC      sparc64-softmmu/target/sparc/monitor.o
  CC      sparc64-softmmu/target/sparc/translate.o
  CC      xtensaeb-softmmu/fpu/softfloat.o
  CC      sparc64-softmmu/target/sparc/helper.o
  CC      sparc64-softmmu/target/sparc/cpu.o
  CC      sparc64-softmmu/target/sparc/fop_helper.o
  CC      sparc64-softmmu/target/sparc/cc_helper.o
  CC      sparc64-softmmu/target/sparc/win_helper.o
  CC      xtensaeb-softmmu/disas.o
  CC      sparc64-softmmu/target/sparc/mmu_helper.o
  CC      xtensaeb-softmmu/arch_init.o
  CC      xtensaeb-softmmu/cpus.o
  CC      sparc64-softmmu/target/sparc/ldst_helper.o
  CC      sparc64-softmmu/target/sparc/int64_helper.o
  CC      xtensaeb-softmmu/monitor.o
  CC      sparc64-softmmu/target/sparc/vis_helper.o
  CC      sparc64-softmmu/target/sparc/gdbstub.o
  GEN     trace/generated-helpers.c
  CC      sparc64-softmmu/trace/control-target.o
  CC      sparc64-softmmu/trace/generated-helpers.o
  LINK    sparc64-softmmu/qemu-system-sparc64
  CC      xtensaeb-softmmu/gdbstub.o
  CC      xtensaeb-softmmu/balloon.o
  CC      xtensaeb-softmmu/ioport.o
  CC      xtensaeb-softmmu/numa.o
  CC      tricore-softmmu/tcg/tcg.o
  CC      x86_64-softmmu/disas.o
  CC      tricore-softmmu/tcg/tcg-op.o
  CC      xtensaeb-softmmu/qtest.o
  GEN     x86_64-softmmu/gdbstub-xml.c
  CC      xtensaeb-softmmu/memory.o
  CC      x86_64-softmmu/arch_init.o
  CC      x86_64-softmmu/cpus.o
  CC      tricore-softmmu/tcg/tcg-op-vec.o
  CC      tricore-softmmu/tcg/tcg-op-gvec.o
  CC      xtensaeb-softmmu/memory_mapping.o
  CC      xtensaeb-softmmu/dump.o
  GEN     xtensa-softmmu/hmp-commands.h
  GEN     xtensa-softmmu/hmp-commands-info.h
  GEN     xtensa-softmmu/config-target.h
  CC      xtensa-softmmu/exec.o
  CC      xtensaeb-softmmu/migration/ram.o
  CC      xtensaeb-softmmu/accel/accel.o
  CC      xtensaeb-softmmu/accel/stubs/hax-stub.o
  CC      xtensa-softmmu/tcg/tcg.o
  CC      xtensaeb-softmmu/accel/stubs/hvf-stub.o
  CC      xtensaeb-softmmu/accel/stubs/whpx-stub.o
  CC      xtensaeb-softmmu/accel/stubs/kvm-stub.o
  CC      xtensaeb-softmmu/accel/tcg/tcg-all.o
  CC      xtensaeb-softmmu/accel/tcg/cputlb.o
  CC      xtensa-softmmu/tcg/tcg-op.o
  CC      xtensaeb-softmmu/accel/tcg/tcg-runtime.o
  CC      xtensaeb-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      xtensa-softmmu/tcg/tcg-op-vec.o
  CC      xtensa-softmmu/tcg/tcg-op-gvec.o
  CC      xtensaeb-softmmu/accel/tcg/cpu-exec.o
  CC      xtensaeb-softmmu/accel/tcg/cpu-exec-common.o
  CC      xtensaeb-softmmu/accel/tcg/translate-all.o
  CC      xtensaeb-softmmu/accel/tcg/translator.o
  CC      xtensa-softmmu/tcg/tcg-common.o
  CC      xtensaeb-softmmu/hw/core/generic-loader.o
  CC      xtensa-softmmu/tcg/optimize.o
  CC      xtensaeb-softmmu/hw/core/null-machine.o
  CC      xtensaeb-softmmu/hw/misc/mmio_interface.o
  CC      xtensaeb-softmmu/hw/net/vhost_net.o
  CC      xtensa-softmmu/fpu/softfloat.o
  CC      xtensaeb-softmmu/hw/net/rocker/qmp-norocker.o
  CC      xtensaeb-softmmu/hw/vfio/common.o
  CC      xtensaeb-softmmu/hw/vfio/platform.o
  CC      xtensaeb-softmmu/hw/vfio/spapr.o
  CC      xtensaeb-softmmu/hw/xtensa/pic_cpu.o
  CC      xtensaeb-softmmu/hw/xtensa/sim.o
  CC      xtensaeb-softmmu/hw/xtensa/xtensa_memory.o
  CC      xtensaeb-softmmu/hw/xtensa/xtfpga.o
  CC      xtensaeb-softmmu/target/xtensa/core-dc232b.o
  CC      xtensa-softmmu/disas.o
  CC      xtensa-softmmu/arch_init.o
  CC      xtensaeb-softmmu/target/xtensa/core-dc233c.o
  CC      xtensa-softmmu/cpus.o
  CC      xtensa-softmmu/monitor.o
  CC      xtensaeb-softmmu/target/xtensa/core-de212.o
  CC      xtensaeb-softmmu/target/xtensa/core-fsf.o
  CC      xtensa-softmmu/gdbstub.o
  CC      xtensa-softmmu/balloon.o
  CC      xtensaeb-softmmu/target/xtensa/core-sample_controller.o
  CC      xtensa-softmmu/ioport.o
  CC      xtensa-softmmu/numa.o
  CC      xtensa-softmmu/qtest.o
  CC      xtensaeb-softmmu/target/xtensa/monitor.o
  CC      xtensaeb-softmmu/target/xtensa/xtensa-semi.o
  CC      xtensa-softmmu/memory.o
  CC      xtensaeb-softmmu/target/xtensa/xtensa-isa.o
  CC      xtensaeb-softmmu/target/xtensa/translate.o
  CC      xtensa-softmmu/memory_mapping.o
  CC      xtensa-softmmu/dump.o
  CC      xtensa-softmmu/migration/ram.o
  CC      xtensaeb-softmmu/target/xtensa/op_helper.o
  CC      xtensaeb-softmmu/target/xtensa/helper.o
  CC      xtensa-softmmu/accel/accel.o
  CC      xtensaeb-softmmu/target/xtensa/cpu.o
  CC      xtensa-softmmu/accel/stubs/hax-stub.o
  CC      xtensaeb-softmmu/target/xtensa/gdbstub.o
  CC      xtensa-softmmu/accel/stubs/hvf-stub.o
  CC      xtensa-softmmu/accel/stubs/whpx-stub.o
  GEN     trace/generated-helpers.c
  CC      xtensaeb-softmmu/trace/control-target.o
  CC      xtensa-softmmu/accel/stubs/kvm-stub.o
  CC      xtensaeb-softmmu/trace/generated-helpers.o
  CC      xtensa-softmmu/accel/tcg/tcg-all.o
  LINK    xtensaeb-softmmu/qemu-system-xtensaeb
  CC      xtensa-softmmu/accel/tcg/cputlb.o
  GEN     aarch64_be-linux-user/config-target.h
  CC      aarch64_be-linux-user/exec.o
  CC      aarch64_be-linux-user/tcg/tcg.o
  CC      aarch64_be-linux-user/tcg/tcg-op.o
  CC      aarch64_be-linux-user/tcg/tcg-op-vec.o
  CC      aarch64_be-linux-user/tcg/tcg-op-gvec.o
  CC      aarch64_be-linux-user/tcg/tcg-common.o
  CC      aarch64_be-linux-user/tcg/optimize.o
  CC      aarch64_be-linux-user/fpu/softfloat.o
  CC      aarch64_be-linux-user/disas.o
  GEN     aarch64_be-linux-user/gdbstub-xml.c
  CC      aarch64_be-linux-user/gdbstub.o
  CC      aarch64_be-linux-user/thunk.o
  CC      aarch64_be-linux-user/accel/stubs/hax-stub.o
  CC      aarch64_be-linux-user/accel/stubs/hvf-stub.o
  CC      aarch64_be-linux-user/accel/stubs/whpx-stub.o
  CC      aarch64_be-linux-user/accel/stubs/kvm-stub.o
  CC      aarch64_be-linux-user/accel/tcg/tcg-runtime.o
  CC      aarch64_be-linux-user/accel/tcg/tcg-runtime-gvec.o
  CC      aarch64_be-linux-user/accel/tcg/cpu-exec.o
  CC      aarch64_be-linux-user/accel/tcg/cpu-exec-common.o
  CC      aarch64_be-linux-user/accel/tcg/translate-all.o
  CC      aarch64_be-linux-user/accel/tcg/translator.o
  CC      aarch64_be-linux-user/accel/tcg/user-exec.o
  CC      aarch64_be-linux-user/accel/tcg/user-exec-stub.o
  CC      aarch64_be-linux-user/linux-user/main.o
  CC      aarch64_be-linux-user/linux-user/syscall.o
  CC      aarch64_be-linux-user/linux-user/strace.o
  CC      aarch64_be-linux-user/linux-user/mmap.o
  CC      aarch64_be-linux-user/linux-user/signal.o
  CC      aarch64_be-linux-user/linux-user/elfload.o
  CC      aarch64_be-linux-user/linux-user/linuxload.o
  CC      aarch64_be-linux-user/linux-user/uaccess.o
  CC      aarch64_be-linux-user/linux-user/uname.o
  CCAS    aarch64_be-linux-user/linux-user/safe-syscall.o
  CC      aarch64_be-linux-user/linux-user/aarch64/signal.o
  CC      aarch64_be-linux-user/linux-user/aarch64/cpu_loop.o
  CC      aarch64_be-linux-user/linux-user/flatload.o
  CC      aarch64_be-linux-user/target/arm/arm-semi.o
  CC      aarch64_be-linux-user/target/arm/kvm-stub.o
  CC      aarch64_be-linux-user/target/arm/translate.o
  CC      aarch64_be-linux-user/target/arm/op_helper.o
  CC      aarch64_be-linux-user/target/arm/helper.o
  CC      aarch64_be-linux-user/target/arm/cpu.o
  CC      aarch64_be-linux-user/target/arm/neon_helper.o
  CC      aarch64_be-linux-user/target/arm/iwmmxt_helper.o
  CC      aarch64_be-linux-user/target/arm/vec_helper.o
  CC      aarch64_be-linux-user/target/arm/gdbstub.o
  CC      aarch64_be-linux-user/target/arm/cpu64.o
  CC      aarch64_be-linux-user/target/arm/translate-a64.o
  CC      aarch64_be-linux-user/target/arm/helper-a64.o
  CC      aarch64_be-linux-user/target/arm/gdbstub64.o
  CC      aarch64_be-linux-user/target/arm/crypto_helper.o
  GEN     aarch64_be-linux-user/target/arm/decode-sve.inc.c
  CC      aarch64_be-linux-user/target/arm/sve_helper.o
  GEN     trace/generated-helpers.c
  CC      aarch64_be-linux-user/trace/control-target.o
  CC      aarch64_be-linux-user/gdbstub-xml.o
  CC      aarch64_be-linux-user/target/arm/translate-sve.o
  CC      aarch64_be-linux-user/trace/generated-helpers.o
  LINK    aarch64_be-linux-user/qemu-aarch64_be
  CC      xtensa-softmmu/accel/tcg/tcg-runtime.o
  GEN     aarch64-linux-user/config-target.h
  CC      aarch64-linux-user/exec.o
  CC      xtensa-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      aarch64-linux-user/tcg/tcg.o
  CC      xtensa-softmmu/accel/tcg/cpu-exec.o
  CC      xtensa-softmmu/accel/tcg/cpu-exec-common.o
  CC      xtensa-softmmu/accel/tcg/translate-all.o
  CC      xtensa-softmmu/accel/tcg/translator.o
  CC      aarch64-linux-user/tcg/tcg-op.o
  CC      xtensa-softmmu/hw/core/generic-loader.o
  CC      xtensa-softmmu/hw/core/null-machine.o
  CC      xtensa-softmmu/hw/misc/mmio_interface.o
  CC      xtensa-softmmu/hw/net/vhost_net.o
  CC      xtensa-softmmu/hw/net/rocker/qmp-norocker.o
  CC      xtensa-softmmu/hw/vfio/common.o
  CC      xtensa-softmmu/hw/vfio/platform.o
  CC      aarch64-linux-user/tcg/tcg-op-vec.o
  CC      xtensa-softmmu/hw/vfio/spapr.o
  CC      xtensa-softmmu/hw/xtensa/pic_cpu.o
  CC      aarch64-linux-user/tcg/tcg-op-gvec.o
  CC      xtensa-softmmu/hw/xtensa/sim.o
  CC      xtensa-softmmu/hw/xtensa/xtensa_memory.o
  CC      xtensa-softmmu/hw/xtensa/xtfpga.o
  CC      xtensa-softmmu/target/xtensa/core-dc232b.o
  CC      aarch64-linux-user/tcg/tcg-common.o
  CC      xtensa-softmmu/target/xtensa/core-dc233c.o
  CC      aarch64-linux-user/tcg/optimize.o
  CC      xtensa-softmmu/target/xtensa/core-de212.o
  CC      aarch64-linux-user/fpu/softfloat.o
  CC      xtensa-softmmu/target/xtensa/core-fsf.o
  CC      xtensa-softmmu/target/xtensa/core-sample_controller.o
  CC      xtensa-softmmu/target/xtensa/monitor.o
  CC      xtensa-softmmu/target/xtensa/xtensa-semi.o
  CC      xtensa-softmmu/target/xtensa/xtensa-isa.o
  CC      xtensa-softmmu/target/xtensa/translate.o
  CC      aarch64-linux-user/disas.o
  GEN     aarch64-linux-user/gdbstub-xml.c
  CC      aarch64-linux-user/gdbstub.o
  CC      aarch64-linux-user/thunk.o
  CC      aarch64-linux-user/accel/stubs/hax-stub.o
  CC      aarch64-linux-user/accel/stubs/hvf-stub.o
  CC      aarch64-linux-user/accel/stubs/whpx-stub.o
  CC      xtensa-softmmu/target/xtensa/op_helper.o
  CC      aarch64-linux-user/accel/stubs/kvm-stub.o
  CC      aarch64-linux-user/accel/tcg/tcg-runtime.o
  CC      aarch64-linux-user/accel/tcg/tcg-runtime-gvec.o
  CC      xtensa-softmmu/target/xtensa/helper.o
  CC      xtensa-softmmu/target/xtensa/cpu.o
  CC      xtensa-softmmu/target/xtensa/gdbstub.o
  GEN     trace/generated-helpers.c
  CC      xtensa-softmmu/trace/control-target.o
  CC      aarch64-linux-user/accel/tcg/cpu-exec.o
  CC      xtensa-softmmu/trace/generated-helpers.o
  LINK    xtensa-softmmu/qemu-system-xtensa
  CC      aarch64-linux-user/accel/tcg/cpu-exec-common.o
  CC      aarch64-linux-user/accel/tcg/translate-all.o
  CC      aarch64-linux-user/accel/tcg/translator.o
  CC      x86_64-softmmu/monitor.o
  CC      aarch64-linux-user/accel/tcg/user-exec.o
  GEN     alpha-linux-user/config-target.h
  CC      alpha-linux-user/exec.o
  CC      alpha-linux-user/tcg/tcg.o
  CC      aarch64-linux-user/accel/tcg/user-exec-stub.o
  CC      aarch64-linux-user/linux-user/main.o
  CC      x86_64-softmmu/gdbstub.o
  CC      aarch64-linux-user/linux-user/syscall.o
  CC      alpha-linux-user/tcg/tcg-op.o
  CC      x86_64-softmmu/balloon.o
  CC      x86_64-softmmu/ioport.o
  CC      x86_64-softmmu/numa.o
  CC      x86_64-softmmu/qtest.o
  CC      x86_64-softmmu/memory.o
  CC      alpha-linux-user/tcg/tcg-op-vec.o
  CC      alpha-linux-user/tcg/tcg-op-gvec.o
  CC      x86_64-softmmu/memory_mapping.o
  CC      x86_64-softmmu/dump.o
  CC      aarch64-linux-user/linux-user/strace.o
  CC      aarch64-linux-user/linux-user/mmap.o
  CC      x86_64-softmmu/migration/ram.o
  CC      aarch64-linux-user/linux-user/signal.o
  CC      alpha-linux-user/tcg/tcg-common.o
  CC      alpha-linux-user/tcg/optimize.o
  CC      aarch64-linux-user/linux-user/elfload.o
  CC      x86_64-softmmu/accel/accel.o
  CC      alpha-linux-user/fpu/softfloat.o
  CC      x86_64-softmmu/accel/stubs/hax-stub.o
  CC      aarch64-linux-user/linux-user/linuxload.o
  CC      x86_64-softmmu/accel/stubs/hvf-stub.o
  CC      x86_64-softmmu/accel/stubs/whpx-stub.o
  CC      aarch64-linux-user/linux-user/uaccess.o
  CC      x86_64-softmmu/accel/stubs/kvm-stub.o
  CC      aarch64-linux-user/linux-user/uname.o
  CC      x86_64-softmmu/accel/tcg/tcg-all.o
  CCAS    aarch64-linux-user/linux-user/safe-syscall.o
  CC      aarch64-linux-user/linux-user/aarch64/signal.o
  CC      x86_64-softmmu/accel/tcg/cputlb.o
  CC      aarch64-linux-user/linux-user/aarch64/cpu_loop.o
  CC      aarch64-linux-user/linux-user/flatload.o
  CC      aarch64-linux-user/target/arm/arm-semi.o
  CC      aarch64-linux-user/target/arm/kvm-stub.o
  CC      aarch64-linux-user/target/arm/translate.o
  CC      x86_64-softmmu/accel/tcg/tcg-runtime.o
  CC      x86_64-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      alpha-linux-user/disas.o
  CC      alpha-linux-user/gdbstub.o
  CC      alpha-linux-user/thunk.o
  CC      x86_64-softmmu/accel/tcg/cpu-exec.o
  CC      alpha-linux-user/accel/stubs/hax-stub.o
  CC      alpha-linux-user/accel/stubs/hvf-stub.o
  CC      x86_64-softmmu/accel/tcg/cpu-exec-common.o
  CC      alpha-linux-user/accel/stubs/whpx-stub.o
  CC      x86_64-softmmu/accel/tcg/translate-all.o
  CC      alpha-linux-user/accel/stubs/kvm-stub.o
  CC      alpha-linux-user/accel/tcg/tcg-runtime.o
  CC      alpha-linux-user/accel/tcg/tcg-runtime-gvec.o
  CC      x86_64-softmmu/accel/tcg/translator.o
  CC      x86_64-softmmu/hw/9pfs/virtio-9p-device.o
  CC      x86_64-softmmu/hw/block/virtio-blk.o
  CC      alpha-linux-user/accel/tcg/cpu-exec.o
  CC      alpha-linux-user/accel/tcg/cpu-exec-common.o
  CC      x86_64-softmmu/hw/block/vhost-user-blk.o
  CC      alpha-linux-user/accel/tcg/translate-all.o
  CC      x86_64-softmmu/hw/block/dataplane/virtio-blk.o
  CC      x86_64-softmmu/hw/char/virtio-serial-bus.o
  CC      alpha-linux-user/accel/tcg/translator.o
  CC      alpha-linux-user/accel/tcg/user-exec.o
  CC      x86_64-softmmu/hw/core/generic-loader.o
  CC      x86_64-softmmu/hw/core/null-machine.o
  CC      x86_64-softmmu/hw/display/vga.o
  CC      alpha-linux-user/accel/tcg/user-exec-stub.o
  CC      alpha-linux-user/linux-user/main.o
  CC      aarch64-linux-user/target/arm/op_helper.o
  CC      x86_64-softmmu/hw/display/virtio-gpu.o
  CC      alpha-linux-user/linux-user/syscall.o
  CC      aarch64-linux-user/target/arm/helper.o
/var/tmp/patchew-tester-tmp-u8athipi/src/linux-user/syscall.c: In function ‘syscall_table’:
/var/tmp/patchew-tester-tmp-u8athipi/src/linux-user/syscall.c:13224:36: error: ‘TARGET_NR_epoll_ctl’ undeclared (first use in this function); did you mean ‘TARGET_NR_sys_epoll_ctl’?
 #define SYSCALL_WITH(X, Y)    case TARGET_NR_##X: return impl_##Y
                                    ^
/var/tmp/patchew-tester-tmp-u8athipi/src/linux-user/syscall.c:13225:31: note: in expansion of macro ‘SYSCALL_WITH’
 #define SYSCALL(X)            SYSCALL_WITH(X, X)
                               ^~~~~~~~~~~~
/var/tmp/patchew-tester-tmp-u8athipi/src/linux-user/syscall.c:13312:9: note: in expansion of macro ‘SYSCALL’
         SYSCALL(epoll_ctl);
         ^~~~~~~
/var/tmp/patchew-tester-tmp-u8athipi/src/linux-user/syscall.c:13224:36: note: each undeclared identifier is reported only once for each function it appears in
 #define SYSCALL_WITH(X, Y)    case TARGET_NR_##X: return impl_##Y
                                    ^
/var/tmp/patchew-tester-tmp-u8athipi/src/linux-user/syscall.c:13225:31: note: in expansion of macro ‘SYSCALL_WITH’
 #define SYSCALL(X)            SYSCALL_WITH(X, X)
                               ^~~~~~~~~~~~
/var/tmp/patchew-tester-tmp-u8athipi/src/linux-user/syscall.c:13312:9: note: in expansion of macro ‘SYSCALL’
         SYSCALL(epoll_ctl);
         ^~~~~~~
make[1]: *** [/var/tmp/patchew-tester-tmp-u8athipi/src/rules.mak:69: linux-user/syscall.o] Error 1
make: *** [Makefile:482: subdir-alpha-linux-user] Error 2
make: *** Waiting for unfinished jobs....
  CC      aarch64-linux-user/target/arm/cpu.o
  CC      x86_64-softmmu/hw/display/virtio-gpu-3d.o
  CC      tricore-softmmu/tcg/tcg-common.o
  CC      aarch64-linux-user/target/arm/neon_helper.o
  CC      tricore-softmmu/tcg/optimize.o
  CC      x86_64-softmmu/hw/display/virtio-gpu-pci.o
  CC      aarch64-linux-user/target/arm/iwmmxt_helper.o
  CC      x86_64-softmmu/hw/display/virtio-vga.o
  CC      x86_64-softmmu/hw/intc/apic.o
  CC      aarch64-linux-user/target/arm/vec_helper.o
  CC      x86_64-softmmu/hw/intc/apic_common.o
  CC      tricore-softmmu/fpu/softfloat.o
  CC      x86_64-softmmu/hw/intc/ioapic.o
  CC      aarch64-linux-user/target/arm/gdbstub.o
  CC      x86_64-softmmu/hw/isa/lpc_ich9.o
  CC      x86_64-softmmu/hw/misc/ivshmem.o
  CC      x86_64-softmmu/hw/misc/pvpanic.o
  CC      tricore-softmmu/disas.o
  CC      x86_64-softmmu/hw/misc/mmio_interface.o
  CC      tricore-softmmu/arch_init.o
  CC      x86_64-softmmu/hw/net/virtio-net.o
  CC      tricore-softmmu/cpus.o
  CC      x86_64-softmmu/hw/net/vhost_net.o
  CC      x86_64-softmmu/hw/scsi/virtio-scsi.o
  CC      x86_64-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      x86_64-softmmu/hw/scsi/vhost-scsi-common.o
  CC      x86_64-softmmu/hw/scsi/vhost-scsi.o
  CC      tricore-softmmu/monitor.o
  CC      tricore-softmmu/gdbstub.o
  CC      aarch64-linux-user/target/arm/cpu64.o
  CC      aarch64-linux-user/target/arm/translate-a64.o
  CC      aarch64-linux-user/target/arm/helper-a64.o
  CC      tricore-softmmu/balloon.o
  CC      tricore-softmmu/ioport.o
  CC      tricore-softmmu/numa.o
  CC      x86_64-softmmu/hw/scsi/vhost-user-scsi.o
  CC      aarch64-linux-user/target/arm/gdbstub64.o
  CC      tricore-softmmu/qtest.o
  CC      x86_64-softmmu/hw/timer/mc146818rtc.o
  CC      aarch64-linux-user/target/arm/crypto_helper.o
  CC      x86_64-softmmu/hw/vfio/common.o
  CC      tricore-softmmu/memory.o
  GEN     aarch64-linux-user/target/arm/decode-sve.inc.c
  CC      aarch64-linux-user/target/arm/sve_helper.o
  CC      tricore-softmmu/memory_mapping.o
  CC      tricore-softmmu/dump.o
  CC      tricore-softmmu/migration/ram.o
  GEN     trace/generated-helpers.c
  CC      aarch64-linux-user/trace/control-target.o
  CC      tricore-softmmu/accel/accel.o
  CC      tricore-softmmu/accel/stubs/hax-stub.o
  CC      tricore-softmmu/accel/stubs/hvf-stub.o
  CC      tricore-softmmu/accel/stubs/whpx-stub.o
  CC      x86_64-softmmu/hw/vfio/pci.o
  CC      tricore-softmmu/accel/stubs/kvm-stub.o
  CC      aarch64-linux-user/gdbstub-xml.o
  CC      tricore-softmmu/accel/tcg/tcg-all.o
  CC      aarch64-linux-user/target/arm/translate-sve.o
  CC      x86_64-softmmu/hw/vfio/pci-quirks.o
  CC      x86_64-softmmu/hw/vfio/display.o
  CC      aarch64-linux-user/trace/generated-helpers.o
  CC      x86_64-softmmu/hw/vfio/platform.o
  CC      tricore-softmmu/accel/tcg/cputlb.o
  CC      x86_64-softmmu/hw/vfio/spapr.o
  CC      x86_64-softmmu/hw/virtio/virtio.o
  CC      tricore-softmmu/accel/tcg/tcg-runtime.o
  CC      tricore-softmmu/accel/tcg/tcg-runtime-gvec.o
  LINK    aarch64-linux-user/qemu-aarch64
  CC      x86_64-softmmu/hw/virtio/virtio-balloon.o
  CC      tricore-softmmu/accel/tcg/cpu-exec.o
  CC      tricore-softmmu/accel/tcg/cpu-exec-common.o
  CC      x86_64-softmmu/hw/virtio/virtio-crypto.o
  CC      x86_64-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      x86_64-softmmu/hw/virtio/vhost.o
  CC      x86_64-softmmu/hw/virtio/vhost-backend.o
  CC      x86_64-softmmu/hw/virtio/vhost-user.o
  CC      x86_64-softmmu/hw/virtio/vhost-vsock.o
  CC      tricore-softmmu/accel/tcg/translate-all.o
  CC      tricore-softmmu/accel/tcg/translator.o
  CC      x86_64-softmmu/hw/i386/multiboot.o
  CC      tricore-softmmu/hw/core/generic-loader.o
  CC      tricore-softmmu/hw/core/null-machine.o
  CC      tricore-softmmu/hw/misc/mmio_interface.o
  CC      tricore-softmmu/hw/net/vhost_net.o
  CC      x86_64-softmmu/hw/i386/pc.o
  CC      tricore-softmmu/hw/net/rocker/qmp-norocker.o
  CC      tricore-softmmu/hw/vfio/common.o
  CC      tricore-softmmu/hw/vfio/platform.o
  CC      tricore-softmmu/hw/vfio/spapr.o
  CC      tricore-softmmu/hw/tricore/tricore_testboard.o
  CC      x86_64-softmmu/hw/i386/pc_piix.o
  CC      tricore-softmmu/target/tricore/translate.o
  CC      tricore-softmmu/target/tricore/helper.o
  CC      tricore-softmmu/target/tricore/cpu.o
  CC      tricore-softmmu/target/tricore/op_helper.o
  CC      tricore-softmmu/target/tricore/fpu_helper.o
  CC      x86_64-softmmu/hw/i386/pc_q35.o
  GEN     trace/generated-helpers.c
  CC      tricore-softmmu/trace/control-target.o
  CC      x86_64-softmmu/hw/i386/pc_sysfw.o
  CC      tricore-softmmu/trace/generated-helpers.o
  CC      x86_64-softmmu/hw/i386/x86-iommu.o
  CC      x86_64-softmmu/hw/i386/intel_iommu.o
  CC      x86_64-softmmu/hw/i386/amd_iommu.o
  CC      x86_64-softmmu/hw/i386/vmport.o
  CC      x86_64-softmmu/hw/i386/vmmouse.o
  CC      x86_64-softmmu/hw/i386/kvmvapic.o
  CC      x86_64-softmmu/hw/i386/acpi-build.o
  CC      x86_64-softmmu/target/i386/helper.o
  CC      x86_64-softmmu/target/i386/cpu.o
  CC      x86_64-softmmu/target/i386/gdbstub.o
  CC      x86_64-softmmu/target/i386/xsave_helper.o
  CC      x86_64-softmmu/target/i386/translate.o
  CC      x86_64-softmmu/target/i386/bpt_helper.o
  LINK    tricore-softmmu/qemu-system-tricore
  CC      x86_64-softmmu/target/i386/cc_helper.o
  CC      x86_64-softmmu/target/i386/excp_helper.o
  CC      x86_64-softmmu/target/i386/fpu_helper.o
  CC      x86_64-softmmu/target/i386/int_helper.o
  CC      x86_64-softmmu/target/i386/mem_helper.o
  CC      x86_64-softmmu/target/i386/misc_helper.o
  CC      x86_64-softmmu/target/i386/mpx_helper.o
  CC      x86_64-softmmu/target/i386/seg_helper.o
  CC      x86_64-softmmu/target/i386/smm_helper.o
  CC      x86_64-softmmu/target/i386/svm_helper.o
  CC      x86_64-softmmu/target/i386/machine.o
  CC      x86_64-softmmu/target/i386/arch_memory_mapping.o
  CC      x86_64-softmmu/target/i386/arch_dump.o
  CC      x86_64-softmmu/target/i386/monitor.o
  CC      x86_64-softmmu/target/i386/kvm-stub.o
  CC      x86_64-softmmu/target/i386/sev-stub.o
  GEN     trace/generated-helpers.c
  CC      x86_64-softmmu/trace/control-target.o
  CC      x86_64-softmmu/gdbstub-xml.o
  CC      x86_64-softmmu/trace/generated-helpers.o
  LINK    x86_64-softmmu/qemu-system-x86_64
=== OUTPUT END ===

Test command exited with code: 2


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 119+ messages in thread

* Re: [Qemu-devel] [PATCH v2 001/108] linux-user: Remove DEBUG
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 001/108] linux-user: Remove DEBUG Richard Henderson
@ 2018-06-10 11:51   ` Laurent Vivier
  2018-06-10 16:43   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 119+ messages in thread
From: Laurent Vivier @ 2018-06-10 11:51 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel

Le 10/06/2018 à 05:00, Richard Henderson a écrit :
> This is redundant with both -strace and actual tracing.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  linux-user/syscall.c | 10 ----------
>  1 file changed, 10 deletions(-)

Reviewed-by: Laurent Vivier <laurent@vivier.eu>

^ permalink raw reply	[flat|nested] 119+ messages in thread

* Re: [Qemu-devel] [PATCH v2 009/108] linux-user: Set up infrastructure for table-izing syscalls
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 009/108] linux-user: Set up infrastructure for table-izing syscalls Richard Henderson
@ 2018-06-10 12:32   ` Peter Maydell
  2018-06-10 12:39     ` Peter Maydell
  0 siblings, 1 reply; 119+ messages in thread
From: Peter Maydell @ 2018-06-10 12:32 UTC (permalink / raw)
  To: Richard Henderson; +Cc: QEMU Developers, Laurent Vivier

On 10 June 2018 at 04:00, Richard Henderson
<richard.henderson@linaro.org> wrote:
> At the same time, split out set_robust_list and get_robust_list.
> Put them together, along with their block comment, at the top
> of syscall_table.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  linux-user/syscall.c | 87 +++++++++++++++++++++++++++++++++-----------
>  1 file changed, 66 insertions(+), 21 deletions(-)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 46f123ee13..8678e749ee 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -7947,6 +7947,17 @@ static int host_to_target_cpu_mask(const unsigned long *host_mask,
>      return 0;
>  }
>
> +typedef abi_long impl_fn(void *cpu_env, unsigned num, abi_long arg1,
> +                         abi_long arg2, abi_long arg3, abi_long arg4,
> +                         abi_long arg5, abi_long arg6, abi_long arg7,
> +                         abi_long arg8);
> +
> +#define IMPL(NAME) \
> +static abi_long impl_##NAME(void *cpu_env, unsigned num, abi_long arg1,   \
> +                            abi_long arg2, abi_long arg3, abi_long arg4,  \
> +                            abi_long arg5, abi_long arg6, abi_long arg7,  \
> +                            abi_long arg8)
> +
>  /* This is an internal helper for do_syscall so that it is easier
>   * to have a single return point, so that actions, such as logging
>   * of syscall results, can be performed.
> @@ -11740,23 +11751,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
>          return get_errno(safe_tgkill((int)arg1, (int)arg2,
>                           target_to_host_signal(arg3)));
>
> -#ifdef TARGET_NR_set_robust_list
> -    case TARGET_NR_set_robust_list:
> -    case TARGET_NR_get_robust_list:
> -        /* The ABI for supporting robust futexes has userspace pass
> -         * the kernel a pointer to a linked list which is updated by
> -         * userspace after the syscall; the list is walked by the kernel
> -         * when the thread exits. Since the linked list in QEMU guest
> -         * memory isn't a valid linked list for the host and we have
> -         * no way to reliably intercept the thread-death event, we can't
> -         * support these. Silently return ENOSYS so that guest userspace
> -         * falls back to a non-robust futex implementation (which should
> -         * be OK except in the corner case of the guest crashing while
> -         * holding a mutex that is shared with another process via
> -         * shared memory).
> -         */
> -        return -TARGET_ENOSYS;
> -#endif
>
>  #if defined(TARGET_NR_utimensat)
>      case TARGET_NR_utimensat:
> @@ -12412,6 +12406,54 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
>      return ret;
>  }
>
> +/* The default action for a syscall not listed in syscall_table is to
> + * log the missing syscall.  If a syscall is intentionally emulated as
> + * not present, then list it with impl_enosys as the implementation,
> + * which will avoid the logging.
> + */
> +IMPL(enosys)
> +{
> +    return -TARGET_ENOSYS;
> +}
> +
> +/* For a given syscall number, return a function implementing it.
> + * Do this via switch statement instead of table because some targets
> + * do not begin at 0 and others have a large split in the middle of
> + * the numbers.  The compiler should be able to produce a dense table.
> + */
> +static impl_fn *syscall_table(unsigned num)
> +{
> +#define SYSCALL_WITH(X, Y)    case TARGET_NR_##X: return impl_##Y
> +#define SYSCALL(X)            SYSCALL_WITH(X, X)
> +
> +    switch (num) {
> +        /* The ABI for supporting robust futexes has userspace pass
> +         * the kernel a pointer to a linked list which is updated by
> +         * userspace after the syscall; the list is walked by the kernel
> +         * when the thread exits. Since the linked list in QEMU guest
> +         * memory isn't a valid linked list for the host and we have
> +         * no way to reliably intercept the thread-death event, we can't
> +         * support these. Silently return ENOSYS so that guest userspace
> +         * falls back to a non-robust futex implementation (which should
> +         * be OK except in the corner case of the guest crashing while
> +         * holding a mutex that is shared with another process via
> +         * shared memory).
> +         */
> +        SYSCALL_WITH(get_robust_list, enosys);
> +        SYSCALL_WITH(set_robust_list, enosys);
> +
> +        /*
> +         * Other syscalls listed in collation order, with '_' ignored.
> +         */
> +    }

I was expecting this to be a table lookup, something like
   return syscalls[num].impl;

where the other entries in the syscalls[num] structs would be
for instance the strace data we currently have in strace.list.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 119+ messages in thread

* Re: [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (109 preceding siblings ...)
  2018-06-10  4:44 ` no-reply
@ 2018-06-10 12:34 ` Peter Maydell
  2018-06-10 18:51   ` Richard Henderson
  2018-06-10 19:08 ` Richard Henderson
  111 siblings, 1 reply; 119+ messages in thread
From: Peter Maydell @ 2018-06-10 12:34 UTC (permalink / raw)
  To: Richard Henderson; +Cc: QEMU Developers, Laurent Vivier

On 10 June 2018 at 04:00, Richard Henderson
<richard.henderson@linaro.org> wrote:
> * Changed the table into a switch, for the reason documented.
>   Use macros to actually enter the syscall into the switch.
> * Finish the split.
> * Fix some bugs along the way.
>
> I know it's a huge patch set, but I guess it was always going
> to be in order to finish -- it was a stupidly large function.

It's still a stupidly large source file -- is it worth taking
advantage of the split into multiple implementation functions
to break it up into multiple source files? (We could group
related syscalls together.)

thanks
-- PMM

^ permalink raw reply	[flat|nested] 119+ messages in thread

* Re: [Qemu-devel] [PATCH v2 009/108] linux-user: Set up infrastructure for table-izing syscalls
  2018-06-10 12:32   ` Peter Maydell
@ 2018-06-10 12:39     ` Peter Maydell
  2018-06-10 19:03       ` Richard Henderson
  0 siblings, 1 reply; 119+ messages in thread
From: Peter Maydell @ 2018-06-10 12:39 UTC (permalink / raw)
  To: Richard Henderson; +Cc: QEMU Developers, Laurent Vivier

On 10 June 2018 at 13:32, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 10 June 2018 at 04:00, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>> At the same time, split out set_robust_list and get_robust_list.
>> Put them together, along with their block comment, at the top
>> of syscall_table.
>>
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

>> +/* For a given syscall number, return a function implementing it.
>> + * Do this via switch statement instead of table because some targets
>> + * do not begin at 0 and others have a large split in the middle of
>> + * the numbers.  The compiler should be able to produce a dense table.
>> + */

> I was expecting this to be a table lookup, something like
>    return syscalls[num].impl;
>
> where the other entries in the syscalls[num] structs would be
> for instance the strace data we currently have in strace.list.

Ah, I see the comment covers this. I'd still rather we had all
the information related to a syscall in one place, though -- this
way we end up with the ifdefs and so on which determine whether
a syscall is implemented having to be duplicated:
 (a) in the implementation
 (b) in this switch code
 (c) in the handling of strace
It would be cleaner to have a single
#if something
static foo_impl(..) { ... }
static syscall_impl foo = {
    .name = "foo",
    .impl = foo_impl,
    .strace_stuff = ...,
};
register_syscall(foo);
#endif

Hash table?

thanks
-- PMM

^ permalink raw reply	[flat|nested] 119+ messages in thread

* Re: [Qemu-devel] [PATCH v2 001/108] linux-user: Remove DEBUG
  2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 001/108] linux-user: Remove DEBUG Richard Henderson
  2018-06-10 11:51   ` Laurent Vivier
@ 2018-06-10 16:43   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 119+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-06-10 16:43 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel; +Cc: laurent

On 06/10/2018 12:00 AM, Richard Henderson wrote:
> This is redundant with both -strace and actual tracing.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  linux-user/syscall.c | 10 ----------
>  1 file changed, 10 deletions(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 7b9ac3b408..c212149245 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -163,7 +163,6 @@
>   * (The one remaining unallocated bit is 0x1000 which used to be CLONE_PID.)
>   */
>  
> -//#define DEBUG
>  /* Define DEBUG_ERESTARTSYS to force every syscall to be restarted
>   * once. This exercises the codepaths for restart.
>   */
> @@ -5777,9 +5776,6 @@ static abi_long do_ioctl(int fd, int cmd, abi_long arg)
>          ie++;
>      }
>      arg_type = ie->arg_type;
> -#if defined(DEBUG)
> -    gemu_log("ioctl: cmd=0x%04lx (%s)\n", (long)cmd, ie->name);
> -#endif
>      if (ie->do_ioctl) {
>          return ie->do_ioctl(ie, buf_temp, fd, cmd, arg);
>      } else if (!ie->host_cmd) {
> @@ -7980,9 +7976,6 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
>      }
>  #endif
>  
> -#ifdef DEBUG
> -    gemu_log("syscall %d", num);
> -#endif
>      trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
>      if(do_strace)
>          print_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6);
> @@ -12772,9 +12765,6 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
>          break;
>      }
>  fail:
> -#ifdef DEBUG
> -    gemu_log(" = " TARGET_ABI_FMT_ld "\n", ret);
> -#endif
>      if(do_strace)
>          print_syscall_ret(num, ret);
>      trace_guest_user_syscall_ret(cpu, num, ret);
> 

^ permalink raw reply	[flat|nested] 119+ messages in thread

* Re: [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall
  2018-06-10 12:34 ` Peter Maydell
@ 2018-06-10 18:51   ` Richard Henderson
  0 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10 18:51 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers, Laurent Vivier

On 06/10/2018 02:34 AM, Peter Maydell wrote:
> It's still a stupidly large source file -- is it worth taking
> advantage of the split into multiple implementation functions
> to break it up into multiple source files? (We could group
> related syscalls together.)

It's possible.  Any suggestions for groupings?  I can think of files,
networking, memory (mmap &c), signals, session (getuid &c), ipc.

I've also wondered about cutting down on ifdef boilerplate.  There's nothing
more that I can do about it within the C preprocessor.

I'd have to wire up something else via the makefiles, but haven't thought about
what form that should take.  Likely it ought to be something that can be
massaged into both syscall dispatch and strace tables.


r~

^ permalink raw reply	[flat|nested] 119+ messages in thread

* Re: [Qemu-devel] [PATCH v2 009/108] linux-user: Set up infrastructure for table-izing syscalls
  2018-06-10 12:39     ` Peter Maydell
@ 2018-06-10 19:03       ` Richard Henderson
  0 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10 19:03 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers, Laurent Vivier

On 06/10/2018 02:39 AM, Peter Maydell wrote:
> It would be cleaner to have a single
> #if something
> static foo_impl(..) { ... }
> static syscall_impl foo = {
>     .name = "foo",
>     .impl = foo_impl,
>     .strace_stuff = ...,
> };
> register_syscall(foo);
> #endif
> 
> Hash table?

It would be cleaner to have everything in one place, yes.  I just replied along
those lines elsewhere in the thread.

Indeed, now that I'm thinking along the lines of strace, I'm thinking that
there should be a separate argument extraction step that would be shared by
both strace and syscall implementation.

I'm not a fan of register_syscall(foo) and the startup costs that implies.

The set of syscalls that we support is fixed at compile time.  We should have a
compile-time generation step that builds everything that is required.  Whether
this is C emitting C, or python emitting C, I do not yet have an opinion.


r~

^ permalink raw reply	[flat|nested] 119+ messages in thread

* Re: [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall
  2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
                   ` (110 preceding siblings ...)
  2018-06-10 12:34 ` Peter Maydell
@ 2018-06-10 19:08 ` Richard Henderson
  111 siblings, 0 replies; 119+ messages in thread
From: Richard Henderson @ 2018-06-10 19:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

On 06/09/2018 05:00 PM, Richard Henderson wrote:
> * Changed the table into a switch, for the reason documented.
>   Use macros to actually enter the syscall into the switch.
> * Finish the split.
> * Fix some bugs along the way.

I forgot to mention, this is based on

https://lists.gnu.org/archive/html/qemu-devel/2018-06/msg01764.html

and nothing else.  V1 already had the is_hostfd and openat patches folded in.
I think that it will be much clearer to do those the other way around.

For the record, the whole tree is available at

https://github.com/rth7680/qemu/tree/lu-split-2


r~

^ permalink raw reply	[flat|nested] 119+ messages in thread

end of thread, other threads:[~2018-06-10 19:09 UTC | newest]

Thread overview: 119+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-10  3:00 [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 001/108] linux-user: Remove DEBUG Richard Henderson
2018-06-10 11:51   ` Laurent Vivier
2018-06-10 16:43   ` Philippe Mathieu-Daudé
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 002/108] linux-user: Split out do_syscall1 Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 003/108] linux-user: Relax single exit from "break" Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 004/108] linux-user: Propagate goto efault to return Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 005/108] linux-user: Propagate goto unimplemented_nowarn " Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 006/108] linux-user: Propagate goto unimplemented to default Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 007/108] linux-user: Propagate goto fail to return Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 008/108] linux-user: Make syscall number unsigned Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 009/108] linux-user: Set up infrastructure for table-izing syscalls Richard Henderson
2018-06-10 12:32   ` Peter Maydell
2018-06-10 12:39     ` Peter Maydell
2018-06-10 19:03       ` Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 010/108] linux-user: Split out brk, close, exit, read, write Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 011/108] linux-user: Split out execve Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 012/108] linux-user: Split out open, openat Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 013/108] linux-user: Split out name_to_handle_at Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 014/108] linux-user: Split out open_to_handle_at Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 015/108] linux-user: Split out creat, fork, waitid, waitpid Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 016/108] linux-user: Split out link, linkat Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 017/108] linux-user: Split out unlink, unlinkat Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 018/108] linux-user: Split out chdir, mknod, mknodat, time, chmod Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 019/108] linux-user: Split out getpid, getxpid, lseek Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 020/108] linux-user: Split out mount, umount Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 021/108] linux-user: Split out alarm, pause, stime, utime, utimes Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 022/108] linux-user: Split out access, faccessat, futimesat, kill, nice, sync, syncfs Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 023/108] linux-user: Split out rename, renameat, renameat2 Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 024/108] linux-user: Split out dup, mkdir, mkdirat, rmdir Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 025/108] linux-user: Split out acct, pipe, pipe2, times, umount2 Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 026/108] linux-user: Split out ioctl Richard Henderson
2018-06-10  3:00 ` [Qemu-devel] [PATCH v2 027/108] linux-user: Split out chroot, dup2, dup3, fcntl, setpgid, umask Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 028/108] linux-user: Split out getpgrp, getppid, setsid Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 029/108] linux-user: Split out rt_sigaction, sigaction Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 030/108] linux-user: Split out rt_sigprocmask, sgetmask, sigprocmask, ssetmask Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 031/108] linux-user: Split out rt_sigpending, rt_sigsuspend, sigpending, sigsuspend Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 032/108] linux-user: Split out rt_sigqueueinfo, rt_sigtimedwait, rt_tgsigqueueinfo Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 033/108] linux-user: Split out rt_sigreturn, sethostname, setrlimit, sigreturn Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 034/108] linux-user: Split out getrlimit, getrusage, gettimeofday, settimeofday Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 035/108] linux-user: Split out select, pselect6, newselect Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 036/108] linux-user: Split out symlink, symlinkat Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 037/108] linux-user: Split out readlink, readlinkat Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 038/108] linux-user: Split out mmap, mmap2, reboot, swapon Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 039/108] linux-user: Split out mprotect, mremap, msync, munmap Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 040/108] linux-user: Split out mlock, mlockall, munlock, munlockall Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 041/108] linux-user: Split out fchmod, fchmodat, ftruncate, truncate Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 042/108] linux-user: Split out fstatfs, fstatfs64, statfs, statfs64 Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 043/108] linux-user: Split out getpriority, setpriority Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 044/108] linux-user: Split out socketcall Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 045/108] linux-user: Split out accept, accept4, bind, connect Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 046/108] linux-user: Split out 7 syscalls Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 047/108] linux-user: Split out recvmmsg, send, sendmmsg, sendmsg, sendto Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 048/108] linux-user: Split out getrandom, shutdown, setsockopt, socket, socketpair Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 049/108] linux-user: Fix stub gettid Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 050/108] linux-user: Split out getitimer, setitimer, syslog Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 051/108] linux-user: Split out fstat, lstat, stat Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 052/108] linux-user: Unwrap TARGET_NR_syscall early Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 053/108] linux-user: Split out swapoff, sysinfo, vhangup, wait4 Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 054/108] linux-user: Split out ipc Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 055/108] linux-user: Split out ipc syscalls Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 056/108] linux-user: Split out clone, exit_group, fsync Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 057/108] linux-user: Split out modify_ldt, setdomainname, uname Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 058/108] linux-user: Split out adjtimex, clock_adjtime, vm86 Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 059/108] linux-user: Split out fchdir, getpgid, llseek, personality Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 060/108] linux-user: Split out getdents, getdents64 Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 061/108] linux-user: Split out poll, ppoll Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 062/108] linux-user: Split out flock, preadv, pwritev, readv, writev Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 063/108] linux-user: Split out fdatasync, getsid, _sysctl Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 064/108] linux-user: Split out sched syscalls Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 065/108] linux-user: Split out getcpu, nanosleep, prctl Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 066/108] linux-user: Split out arch_prctl Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 067/108] linux-user: Split out getcwd, pread64, pwrite64, sigaltstack Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 068/108] linux-user: Split out capget, capset Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 069/108] linux-user: Split out sendfile, sendfile64 Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 070/108] linux-user: Split out ftruncate64, truncate64, ugetrlimit, vfork Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 071/108] linux-user: Split out fstat64, fstatat64, newfstatat, lstat64, stat64 Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 072/108] linux-user: Split out getegid, geteuid, getgid, getuid, lchown Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 073/108] linux-user: Split out getgroups, setgroups, setregid, setreuid Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 074/108] linux-user: Split out fchown, fchownat, setresgid, setresuid Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 075/108] linux-user: Split out chown, getresgid, getresuid Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 076/108] linux-user: Split out setfsgid, setfsuid, setgid, setuid Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 077/108] linux-user: Split out getuid32, getxgid, getxuid, lchown32 Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 078/108] linux-user: Split out osf_getsysinfo, osf_setsysinfo, osf_sigprocmask Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 079/108] linux-user: Split out getegid32, geteuid32, getgid32, setregid32, setreuid32 Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 080/108] linux-user: Split out fchown32, getgroups32, setgroups32 Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 081/108] linux-user: Split out getresgid32, getresuid32, setresgid32, setresuid32 Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 082/108] linux-user: Split out chown32, setfsgid32, setfsuid32, setgid32, setuid32 Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 083/108] linux-user: Split out mincore Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 084/108] linux-user: Split out fadvise64, fadvise64_64 Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 085/108] linux-user: Split out cacheflush, fcntl64, getpagesize, madvise Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 086/108] linux-user: Split out gettid, readahead Richard Henderson
2018-06-10  3:01 ` [Qemu-devel] [PATCH v2 087/108] linux-user: Split out xattr syscalls Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 088/108] linux-user: Split out getdomainname, get_thread_area, set_thread_area Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 089/108] linux-user: Split out clock syscalls Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 090/108] linux-user: Fix clock_nanosleep Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 091/108] linux-user: Split out set_tid_address, tgkill, tkill Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 092/108] linux-user: Split out futex, utimensat Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 093/108] linux-user: Remove sys_futex Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 094/108] linux-user: Split out inotify syscalls Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 095/108] linux-user: Split out mq syscalls Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 096/108] linux-user: Split out splice, tee, vmsplice Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 097/108] linux-user: Split out eventfd, eventfd2 Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 098/108] linux-user: Split out fallocate, sync_file_range/2 Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 099/108] linux-user: Split out signalfd, signalfd4 Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 100/108] linux-user: Split out epoll syscalls Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 101/108] linux-user: Split out prlimit64 Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 102/108] linux-user: Split out atomic_barrier, gethostname Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 103/108] linux-user: Split out atomic_cmpxchg_32 Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 104/108] linux-user: Split out timer syscalls Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 105/108] linux-user: Split out timerfd syscalls Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 106/108] linux-user: Split out ioprio_get, ioprio_set, kcmp Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 107/108] linux-user: Split out setns, unshare Richard Henderson
2018-06-10  3:02 ` [Qemu-devel] [PATCH v2 108/108] linux-user: Fold away do_syscall1 Richard Henderson
2018-06-10  4:30 ` [Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall no-reply
2018-06-10  4:44 ` no-reply
2018-06-10 12:34 ` Peter Maydell
2018-06-10 18:51   ` Richard Henderson
2018-06-10 19:08 ` Richard Henderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.