Browse Source

common-user: Move safe-syscall.* from linux-user

Move linux-user safe-syscall.S and safe-syscall-error.c to common-user
so that bsd-user can also use it.  Also move safe-syscall.h to
include/user/.  Since there is nothing here that is related to the guest,
as opposed to the host, build it once.

Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
pull/202/head
Richard Henderson 5 years ago
parent
commit
bbf15aaf7c
  1. 2
      MAINTAINERS
  2. 2
      bsd-user/meson.build
  3. 2
      common-user/host/aarch64/safe-syscall.inc.S
  4. 2
      common-user/host/arm/safe-syscall.inc.S
  5. 2
      common-user/host/i386/safe-syscall.inc.S
  6. 2
      common-user/host/mips/safe-syscall.inc.S
  7. 2
      common-user/host/ppc64/safe-syscall.inc.S
  8. 2
      common-user/host/riscv/safe-syscall.inc.S
  9. 2
      common-user/host/s390x/safe-syscall.inc.S
  10. 2
      common-user/host/sparc64/safe-syscall.inc.S
  11. 2
      common-user/host/x86_64/safe-syscall.inc.S
  12. 6
      common-user/meson.build
  13. 2
      common-user/safe-syscall-error.c
  14. 0
      common-user/safe-syscall.S
  15. 0
      include/user/safe-syscall.h
  16. 5
      linux-user/meson.build
  17. 2
      linux-user/signal.c
  18. 2
      linux-user/syscall.c
  19. 18
      meson.build

2
MAINTAINERS

@ -3079,6 +3079,8 @@ M: Riku Voipio <riku.voipio@iki.fi>
S: Maintained
F: thunk.c
F: accel/tcg/user-exec*.c
F: include/user/
F: common-user/
BSD user
M: Warner Losh <imp@bsdimp.com>

2
bsd-user/meson.build

@ -2,6 +2,8 @@ if not have_bsd_user
subdir_done()
endif
common_user_inc += include_directories('.')
bsd_user_ss.add(files(
'bsdload.c',
'elfload.c',

2
linux-user/host/aarch64/safe-syscall.inc.S → common-user/host/aarch64/safe-syscall.inc.S

@ -1,7 +1,7 @@
/*
* safe-syscall.inc.S : host-specific assembly fragment
* to handle signals occurring at the same time as system calls.
* This is intended to be included by linux-user/safe-syscall.S
* This is intended to be included by common-user/safe-syscall.S
*
* Written by Richard Henderson <rth@twiddle.net>
* Copyright (C) 2016 Red Hat, Inc.

2
linux-user/host/arm/safe-syscall.inc.S → common-user/host/arm/safe-syscall.inc.S

@ -1,7 +1,7 @@
/*
* safe-syscall.inc.S : host-specific assembly fragment
* to handle signals occurring at the same time as system calls.
* This is intended to be included by linux-user/safe-syscall.S
* This is intended to be included by common-user/safe-syscall.S
*
* Written by Richard Henderson <rth@twiddle.net>
* Copyright (C) 2016 Red Hat, Inc.

2
linux-user/host/i386/safe-syscall.inc.S → common-user/host/i386/safe-syscall.inc.S

@ -1,7 +1,7 @@
/*
* safe-syscall.inc.S : host-specific assembly fragment
* to handle signals occurring at the same time as system calls.
* This is intended to be included by linux-user/safe-syscall.S
* This is intended to be included by common-user/safe-syscall.S
*
* Written by Richard Henderson <rth@twiddle.net>
* Copyright (C) 2016 Red Hat, Inc.

2
linux-user/host/mips/safe-syscall.inc.S → common-user/host/mips/safe-syscall.inc.S

@ -1,7 +1,7 @@
/*
* safe-syscall.inc.S : host-specific assembly fragment
* to handle signals occurring at the same time as system calls.
* This is intended to be included by linux-user/safe-syscall.S
* This is intended to be included by common-user/safe-syscall.S
*
* Written by Richard Henderson <richard.henderson@linaro.org>
* Copyright (C) 2021 Linaro, Inc.

2
linux-user/host/ppc64/safe-syscall.inc.S → common-user/host/ppc64/safe-syscall.inc.S

@ -1,7 +1,7 @@
/*
* safe-syscall.inc.S : host-specific assembly fragment
* to handle signals occurring at the same time as system calls.
* This is intended to be included by linux-user/safe-syscall.S
* This is intended to be included by common-user/safe-syscall.S
*
* Written by Richard Henderson <rth@twiddle.net>
* Copyright (C) 2016 Red Hat, Inc.

2
linux-user/host/riscv/safe-syscall.inc.S → common-user/host/riscv/safe-syscall.inc.S

@ -1,7 +1,7 @@
/*
* safe-syscall.inc.S : host-specific assembly fragment
* to handle signals occurring at the same time as system calls.
* This is intended to be included by linux-user/safe-syscall.S
* This is intended to be included by common-user/safe-syscall.S
*
* Written by Richard Henderson <rth@twiddle.net>
* Copyright (C) 2018 Linaro, Inc.

2
linux-user/host/s390x/safe-syscall.inc.S → common-user/host/s390x/safe-syscall.inc.S

@ -1,7 +1,7 @@
/*
* safe-syscall.inc.S : host-specific assembly fragment
* to handle signals occurring at the same time as system calls.
* This is intended to be included by linux-user/safe-syscall.S
* This is intended to be included by common-user/safe-syscall.S
*
* Written by Richard Henderson <rth@twiddle.net>
* Copyright (C) 2016 Red Hat, Inc.

2
linux-user/host/sparc64/safe-syscall.inc.S → common-user/host/sparc64/safe-syscall.inc.S

@ -1,7 +1,7 @@
/*
* safe-syscall.inc.S : host-specific assembly fragment
* to handle signals occurring at the same time as system calls.
* This is intended to be included by linux-user/safe-syscall.S
* This is intended to be included by common-user/safe-syscall.S
*
* Written by Richard Henderson <richard.henderson@linaro.org>
* Copyright (C) 2021 Linaro, Inc.

2
linux-user/host/x86_64/safe-syscall.inc.S → common-user/host/x86_64/safe-syscall.inc.S

@ -1,7 +1,7 @@
/*
* safe-syscall.inc.S : host-specific assembly fragment
* to handle signals occurring at the same time as system calls.
* This is intended to be included by linux-user/safe-syscall.S
* This is intended to be included by common-user/safe-syscall.S
*
* Copyright (C) 2015 Timothy Edward Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
*

6
common-user/meson.build

@ -0,0 +1,6 @@
common_user_inc += include_directories('host/' / host_arch)
common_user_ss.add(files(
'safe-syscall.S',
'safe-syscall-error.c',
))

2
linux-user/safe-syscall-error.c → common-user/safe-syscall-error.c

@ -10,7 +10,7 @@
*/
#include "qemu/osdep.h"
#include "safe-syscall.h"
#include "user/safe-syscall.h"
/*
* This is intended to be invoked via tail-call on the error path

0
linux-user/safe-syscall.S → common-user/safe-syscall.S

0
linux-user/safe-syscall.h → include/user/safe-syscall.h

5
linux-user/meson.build

@ -2,6 +2,9 @@ if not have_linux_user
subdir_done()
endif
common_user_inc += include_directories('host/' / host_arch)
common_user_inc += include_directories('.')
linux_user_ss.add(files(
'elfload.c',
'exit.c',
@ -9,8 +12,6 @@ linux_user_ss.add(files(
'linuxload.c',
'main.c',
'mmap.c',
'safe-syscall.S',
'safe-syscall-error.c',
'signal.c',
'strace.c',
'syscall.c',

2
linux-user/signal.c

@ -31,7 +31,7 @@
#include "trace.h"
#include "signal-common.h"
#include "host-signal.h"
#include "safe-syscall.h"
#include "user/safe-syscall.h"
static struct target_sigaction sigact_table[TARGET_NSIG];

2
linux-user/syscall.c

@ -132,7 +132,7 @@
#include "signal-common.h"
#include "loader.h"
#include "user-mmap.h"
#include "safe-syscall.h"
#include "user/safe-syscall.h"
#include "qemu/guest-random.h"
#include "qemu/selfmap.h"
#include "user/syscall-trace.h"

18
meson.build

@ -2378,6 +2378,7 @@ block_ss = ss.source_set()
bsd_user_ss = ss.source_set()
chardev_ss = ss.source_set()
common_ss = ss.source_set()
common_user_ss = ss.source_set()
crypto_ss = ss.source_set()
hwcore_ss = ss.source_set()
io_ss = ss.source_set()
@ -2622,15 +2623,30 @@ subdir('tcg')
subdir('fpu')
subdir('accel')
subdir('plugins')
subdir('ebpf')
common_user_inc = []
subdir('common-user')
subdir('bsd-user')
subdir('linux-user')
subdir('ebpf')
specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss)
linux_user_ss.add(files('thunk.c'))
specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)
common_user_ss = common_user_ss.apply(config_all, strict: false)
common_user = static_library('common-user',
sources: common_user_ss.sources(),
dependencies: common_user_ss.dependencies(),
include_directories: common_user_inc,
name_suffix: 'fa',
build_by_default: false)
common_user = declare_dependency(link_with: common_user)
user_ss.add(common_user)
# needed for fuzzing binaries
subdir('tests/qtest/libqos')
subdir('tests/qtest/fuzz')

Loading…
Cancel
Save