qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: laurent@vivier.eu, imp@bsdimp.com
Subject: [PATCH v4 9/9] common-user: Move safe-syscall.* from *-user
Date: Tue, 16 Nov 2021 12:02:56 +0100	[thread overview]
Message-ID: <20211116110256.365484-10-richard.henderson@linaro.org> (raw)
In-Reply-To: <20211116110256.365484-1-richard.henderson@linaro.org>

From: Warner Losh <imp@bsdimp.com>

Move linux-user/safe-syscall.S to common-user so that bsd-user
can also use it.  Also move safe-syscall.h to include/user/.

Signed-off-by: Warner Losh <imp@bsdimp.com>
[rth: Adjust build rules to eliminate common-save-syscall.S.]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 meson.build                                 | 8 ++++++--
 {linux-user => include/user}/safe-syscall.h | 0
 linux-user/signal.c                         | 2 +-
 linux-user/syscall.c                        | 2 +-
 common-user/meson.build                     | 2 ++
 {linux-user => common-user}/safe-syscall.S  | 0
 linux-user/meson.build                      | 1 -
 7 files changed, 10 insertions(+), 5 deletions(-)
 rename {linux-user => include/user}/safe-syscall.h (100%)
 create mode 100644 common-user/meson.build
 rename {linux-user => common-user}/safe-syscall.S (100%)

diff --git a/meson.build b/meson.build
index ec22cf05c1..c5b0b2b247 100644
--- a/meson.build
+++ b/meson.build
@@ -2359,6 +2359,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()
@@ -2605,12 +2606,15 @@ subdir('accel')
 subdir('plugins')
 subdir('bsd-user')
 subdir('linux-user')
+subdir('common-user')
 subdir('ebpf')
 
-specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss)
+specific_ss.add_all(when: 'CONFIG_BSD_USER',
+                    if_true: [bsd_user_ss, common_user_ss])
 
 linux_user_ss.add(files('thunk.c'))
-specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)
+specific_ss.add_all(when: 'CONFIG_LINUX_USER',
+                    if_true: [linux_user_ss, common_user_ss])
 
 # needed for fuzzing binaries
 subdir('tests/qtest/libqos')
diff --git a/linux-user/safe-syscall.h b/include/user/safe-syscall.h
similarity index 100%
rename from linux-user/safe-syscall.h
rename to include/user/safe-syscall.h
diff --git a/linux-user/signal.c b/linux-user/signal.c
index ca8f24b9ec..0744c6bf20 100644
--- a/linux-user/signal.c
+++ b/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];
 
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 544f5b662f..0c5f63d08c 100644
--- a/linux-user/syscall.c
+++ b/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"
diff --git a/common-user/meson.build b/common-user/meson.build
new file mode 100644
index 0000000000..233b69199c
--- /dev/null
+++ b/common-user/meson.build
@@ -0,0 +1,2 @@
+# TODO: reorg the *-user headers so that this can be built once.
+common_user_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('safe-syscall.S'))
diff --git a/linux-user/safe-syscall.S b/common-user/safe-syscall.S
similarity index 100%
rename from linux-user/safe-syscall.S
rename to common-user/safe-syscall.S
diff --git a/linux-user/meson.build b/linux-user/meson.build
index bf62c13e37..af8d39aecc 100644
--- a/linux-user/meson.build
+++ b/linux-user/meson.build
@@ -9,7 +9,6 @@ linux_user_ss.add(files(
   'linuxload.c',
   'main.c',
   'mmap.c',
-  'safe-syscall.S',
   'signal.c',
   'strace.c',
   'syscall.c',
-- 
2.25.1



  parent reply	other threads:[~2021-11-16 11:08 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16 11:02 [PATCH v4 0/9] linux-user: simplify safe signal handling Richard Henderson
2021-11-16 11:02 ` [PATCH v4 1/9] linux-user: Add host_signal_set_pc to set pc in mcontext Richard Henderson
2021-11-16 11:02 ` [PATCH v4 2/9] linux-user/signal.c: Create a common rewind_if_in_safe_syscall Richard Henderson
2021-11-16 11:02 ` [PATCH v4 3/9] linux-user/safe-syscall.inc.S: Move to common-user Richard Henderson
2021-11-16 21:03   ` Warner Losh
2021-11-17  8:11     ` Philippe Mathieu-Daudé
2021-11-17 12:49     ` Richard Henderson
2021-11-17 16:09       ` Warner Losh
2021-11-17 16:20       ` Philippe Mathieu-Daudé
2021-11-16 11:02 ` [PATCH v4 4/9] common-user: Move syscall error detection into safe_syscall_base Richard Henderson
2021-11-16 11:02 ` [PATCH v4 5/9] common-user/host/mips: Add safe-syscall.inc.S Richard Henderson
2021-11-16 11:02 ` [PATCH v4 6/9] common-user/host/sparc64: " Richard Henderson
2021-11-16 11:02 ` [PATCH v4 7/9] linux-user: Remove HAVE_SAFE_SYSCALL and hostdep.h Richard Henderson
2021-11-17  8:22   ` Philippe Mathieu-Daudé
2021-11-17 15:58   ` Warner Losh
2021-11-16 11:02 ` [PATCH v4 8/9] common-user: Adjust system call return on FreeBSD Richard Henderson
2021-11-16 20:58   ` Warner Losh
2021-11-16 21:43     ` Richard Henderson
2021-11-17  8:23   ` Philippe Mathieu-Daudé
2021-11-17  8:32     ` Richard Henderson
2021-11-17  8:38       ` Philippe Mathieu-Daudé
2021-11-16 11:02 ` Richard Henderson [this message]
2021-11-16 21:10 ` [PATCH v4 0/9] linux-user: simplify safe signal handling Warner Losh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211116110256.365484-10-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=imp@bsdimp.com \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).