From: Richard Henderson <richard.henderson@linaro.org>
To: Warner Losh <imp@bsdimp.com>, qemu-devel@nongnu.org
Cc: Philippe Mathieu-Daude <f4bug@amsat.org>,
Laurent Vivier <laurent@vivier.eu>
Subject: Re: [RFC v2 6/6] *-user: move safe-syscall.* to common-user
Date: Wed, 10 Nov 2021 18:04:11 +0100 [thread overview]
Message-ID: <b0c5d701-5187-58ab-7b34-aead73ebae68@linaro.org> (raw)
In-Reply-To: <20211110163133.76357-7-imp@bsdimp.com>
On 11/10/21 5:31 PM, Warner Losh wrote:
> Move linux-user/safe-syscall.S to common-user/common-safe-syscall.S and
> replace it with a #include "common-safe-syscall.S" so that bsd-user can
> also use it. Also move safe-syscall.h so that it can define a few more
> externs.
>
> Signed-off-by: Warner Losh <imp@bsdimp.com>
> ---
> common-user/common-safe-syscall.S | 30 +++++++++++++++++++++
> {linux-user => common-user}/safe-syscall.h | 0
> linux-user/safe-syscall.S | 31 +---------------------
> linux-user/signal.c | 1 +
> meson.build | 1 +
> 5 files changed, 33 insertions(+), 30 deletions(-)
> create mode 100644 common-user/common-safe-syscall.S
> rename {linux-user => common-user}/safe-syscall.h (100%)
>
> diff --git a/common-user/common-safe-syscall.S b/common-user/common-safe-syscall.S
> new file mode 100644
> index 0000000000..42ea7c40ba
> --- /dev/null
> +++ b/common-user/common-safe-syscall.S
> @@ -0,0 +1,30 @@
> +/*
> + * safe-syscall.S : include the host-specific assembly fragment
> + * to handle signals occurring at the same time as system calls.
> + *
> + * Written by Peter Maydell <peter.maydell@linaro.org>
> + *
> + * Copyright (C) 2016 Linaro Limited
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +
> +#include "hostdep.h"
> +#include "target_errno_defs.h"
> +
> +/* We have the correct host directory on our include path
> + * so that this will pull in the right fragment for the architecture.
> + */
> +#ifdef HAVE_SAFE_SYSCALL
> +#include "safe-syscall.inc.S"
> +#endif
> +
> +/* We must specifically say that we're happy for the stack to not be
> + * executable, otherwise the toolchain will default to assuming our
> + * assembly needs an executable stack and the whole QEMU binary will
> + * needlessly end up with one. This should be the last thing in this file.
> + */
> +#if defined(__linux__) && defined(__ELF__)
> +.section .note.GNU-stack, "", %progbits
> +#endif
Hmm. If we're going to split this file into safe-syscall.S and common-safe-syscall.S, we
shouldn't do the ifdef thing here. (Why it was present at all for linux-user is a mystery.)
What do you have planned for bsd-user that would be more than
> +#include "common-safe-syscall.S"
this?
r~
next prev parent reply other threads:[~2021-11-10 17:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-10 16:31 [RFC v2 0/6] linux-user: simplify safe signal handling Warner Losh
2021-11-10 16:31 ` [RFC v2 1/6] linux-user: Add host_signal_set_pc to set pc in mcontext Warner Losh
2021-11-10 16:42 ` Richard Henderson
2021-11-10 22:46 ` Warner Losh
2021-11-10 16:31 ` [RFC v2 2/6] linux-user/signal.c: Create a common rewind_if_in_safe_syscall Warner Losh
2021-11-10 16:31 ` [RFC v2 3/6] linux-user/safe-syscall.inc.S: Move to common-user Warner Losh
2021-11-10 16:43 ` Richard Henderson
2021-11-10 16:31 ` [RFC v2 4/6] common-user: Adjust system call return on FreeBSD Warner Losh
2021-11-10 16:59 ` Richard Henderson
2021-11-10 22:53 ` Warner Losh
2021-11-10 16:31 ` [RFC v2 5/6] common-user/host/mips: create, though mips hosts likely don't work reliably Warner Losh
2021-11-10 17:00 ` Richard Henderson
2021-11-10 22:58 ` Warner Losh
2021-11-10 16:31 ` [RFC v2 6/6] *-user: move safe-syscall.* to common-user Warner Losh
2021-11-10 17:04 ` Richard Henderson [this message]
2021-11-10 23:02 ` 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=b0c5d701-5187-58ab-7b34-aead73ebae68@linaro.org \
--to=richard.henderson@linaro.org \
--cc=f4bug@amsat.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).