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 <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
This commit is contained in:
Richard Henderson committed 2021-12-20 10:12:24 -08:00
1 parent 2ac16d01e3
commit bbf15aaf7c
19 files changed
+42 -15

No files matched your search

+2
View File
@@ -3079,6 +3079,8 @@ M: Riku Voipio <[email protected]>
S: Maintained
F: thunk.c
F: accel/tcg/user-exec*.c
F: include/user/
F: common-user/
BSD user
M: Warner Losh <[email protected]>
+2
View File
@@ -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',
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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
View File
@@ -0,0 +1,6 @@
common_user_inc += include_directories('host/' / host_arch)
common_user_ss.add(files(
'safe-syscall.S',
'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
File renamed without changes.
File renamed without changes.
+3 -2
View File
@@ -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',
+1 -1
View File
@@ -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];
+1 -1
View File
@@ -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"
+17 -1
View File
@@ -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')