From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: laurent@vivier.eu, imp@bsdimp.com,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [PATCH v6 06/16] linux-user: Remove HAVE_SAFE_SYSCALL and hostdep.h
Date: Tue, 23 Nov 2021 18:37:49 +0100 [thread overview]
Message-ID: <20211123173759.1383510-7-richard.henderson@linaro.org> (raw)
In-Reply-To: <20211123173759.1383510-1-richard.henderson@linaro.org>
All supported hosts now define HAVE_SAFE_SYSCALL, so remove
the ifdefs. This leaves hostdep.h empty, so remove it.
Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/host/aarch64/hostdep.h | 18 ------------------
linux-user/host/arm/hostdep.h | 18 ------------------
linux-user/host/i386/hostdep.h | 18 ------------------
linux-user/host/ia64/hostdep.h | 15 ---------------
linux-user/host/mips/hostdep.h | 18 ------------------
linux-user/host/ppc/hostdep.h | 15 ---------------
linux-user/host/ppc64/hostdep.h | 18 ------------------
linux-user/host/riscv/hostdep.h | 14 --------------
linux-user/host/s390/hostdep.h | 15 ---------------
linux-user/host/s390x/hostdep.h | 18 ------------------
linux-user/host/sparc/hostdep.h | 15 ---------------
linux-user/host/sparc64/hostdep.h | 18 ------------------
linux-user/host/x32/hostdep.h | 15 ---------------
linux-user/host/x86_64/hostdep.h | 18 ------------------
linux-user/safe-syscall.h | 13 +------------
linux-user/user-internals.h | 1 -
linux-user/safe-syscall-error.c | 3 ---
linux-user/signal.c | 2 --
linux-user/safe-syscall.S | 3 ---
19 files changed, 1 insertion(+), 254 deletions(-)
delete mode 100644 linux-user/host/aarch64/hostdep.h
delete mode 100644 linux-user/host/arm/hostdep.h
delete mode 100644 linux-user/host/i386/hostdep.h
delete mode 100644 linux-user/host/ia64/hostdep.h
delete mode 100644 linux-user/host/mips/hostdep.h
delete mode 100644 linux-user/host/ppc/hostdep.h
delete mode 100644 linux-user/host/ppc64/hostdep.h
delete mode 100644 linux-user/host/riscv/hostdep.h
delete mode 100644 linux-user/host/s390/hostdep.h
delete mode 100644 linux-user/host/s390x/hostdep.h
delete mode 100644 linux-user/host/sparc/hostdep.h
delete mode 100644 linux-user/host/sparc64/hostdep.h
delete mode 100644 linux-user/host/x32/hostdep.h
delete mode 100644 linux-user/host/x86_64/hostdep.h
diff --git a/linux-user/host/aarch64/hostdep.h b/linux-user/host/aarch64/hostdep.h
deleted file mode 100644
index 39299d798a..0000000000
--- a/linux-user/host/aarch64/hostdep.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * hostdep.h : things which are dependent on the host architecture
- *
- * * 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.
- */
-
-#ifndef AARCH64_HOSTDEP_H
-#define AARCH64_HOSTDEP_H
-
-/* We have a safe-syscall.inc.S */
-#define HAVE_SAFE_SYSCALL
-
-#endif
diff --git a/linux-user/host/arm/hostdep.h b/linux-user/host/arm/hostdep.h
deleted file mode 100644
index 86b137875a..0000000000
--- a/linux-user/host/arm/hostdep.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * hostdep.h : things which are dependent on the host architecture
- *
- * * 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.
- */
-
-#ifndef ARM_HOSTDEP_H
-#define ARM_HOSTDEP_H
-
-/* We have a safe-syscall.inc.S */
-#define HAVE_SAFE_SYSCALL
-
-#endif
diff --git a/linux-user/host/i386/hostdep.h b/linux-user/host/i386/hostdep.h
deleted file mode 100644
index ce7136501f..0000000000
--- a/linux-user/host/i386/hostdep.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * hostdep.h : things which are dependent on the host architecture
- *
- * * 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.
- */
-
-#ifndef I386_HOSTDEP_H
-#define I386_HOSTDEP_H
-
-/* We have a safe-syscall.inc.S */
-#define HAVE_SAFE_SYSCALL
-
-#endif
diff --git a/linux-user/host/ia64/hostdep.h b/linux-user/host/ia64/hostdep.h
deleted file mode 100644
index 263bf7658e..0000000000
--- a/linux-user/host/ia64/hostdep.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * hostdep.h : things which are dependent on the host architecture
- *
- * * 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.
- */
-
-#ifndef IA64_HOSTDEP_H
-#define IA64_HOSTDEP_H
-
-#endif
diff --git a/linux-user/host/mips/hostdep.h b/linux-user/host/mips/hostdep.h
deleted file mode 100644
index d9e90a096b..0000000000
--- a/linux-user/host/mips/hostdep.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * hostdep.h : things which are dependent on the host architecture
- *
- * * 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.
- */
-
-#ifndef MIPS_HOSTDEP_H
-#define MIPS_HOSTDEP_H
-
-/* We have a safe-syscall.inc.S */
-#define HAVE_SAFE_SYSCALL
-
-#endif
diff --git a/linux-user/host/ppc/hostdep.h b/linux-user/host/ppc/hostdep.h
deleted file mode 100644
index 23d8bd9d47..0000000000
--- a/linux-user/host/ppc/hostdep.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * hostdep.h : things which are dependent on the host architecture
- *
- * * 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.
- */
-
-#ifndef PPC_HOSTDEP_H
-#define PPC_HOSTDEP_H
-
-#endif
diff --git a/linux-user/host/ppc64/hostdep.h b/linux-user/host/ppc64/hostdep.h
deleted file mode 100644
index 0c290dd904..0000000000
--- a/linux-user/host/ppc64/hostdep.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * hostdep.h : things which are dependent on the host architecture
- *
- * * 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.
- */
-
-#ifndef PPC64_HOSTDEP_H
-#define PPC64_HOSTDEP_H
-
-/* We have a safe-syscall.inc.S */
-#define HAVE_SAFE_SYSCALL
-
-#endif
diff --git a/linux-user/host/riscv/hostdep.h b/linux-user/host/riscv/hostdep.h
deleted file mode 100644
index 7f67c22868..0000000000
--- a/linux-user/host/riscv/hostdep.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * hostdep.h : things which are dependent on the host architecture
- *
- * This work is licensed under the terms of the GNU GPL, version 2 or later.
- * See the COPYING file in the top-level directory.
- */
-
-#ifndef RISCV_HOSTDEP_H
-#define RISCV_HOSTDEP_H
-
-/* We have a safe-syscall.inc.S */
-#define HAVE_SAFE_SYSCALL
-
-#endif
diff --git a/linux-user/host/s390/hostdep.h b/linux-user/host/s390/hostdep.h
deleted file mode 100644
index afcba5a16a..0000000000
--- a/linux-user/host/s390/hostdep.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * hostdep.h : things which are dependent on the host architecture
- *
- * * 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.
- */
-
-#ifndef S390_HOSTDEP_H
-#define S390_HOSTDEP_H
-
-#endif
diff --git a/linux-user/host/s390x/hostdep.h b/linux-user/host/s390x/hostdep.h
deleted file mode 100644
index d801145854..0000000000
--- a/linux-user/host/s390x/hostdep.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * hostdep.h : things which are dependent on the host architecture
- *
- * * 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.
- */
-
-#ifndef S390X_HOSTDEP_H
-#define S390X_HOSTDEP_H
-
-/* We have a safe-syscall.inc.S */
-#define HAVE_SAFE_SYSCALL
-
-#endif
diff --git a/linux-user/host/sparc/hostdep.h b/linux-user/host/sparc/hostdep.h
deleted file mode 100644
index 391ad923cf..0000000000
--- a/linux-user/host/sparc/hostdep.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * hostdep.h : things which are dependent on the host architecture
- *
- * * 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.
- */
-
-#ifndef SPARC_HOSTDEP_H
-#define SPARC_HOSTDEP_H
-
-#endif
diff --git a/linux-user/host/sparc64/hostdep.h b/linux-user/host/sparc64/hostdep.h
deleted file mode 100644
index d832868cb1..0000000000
--- a/linux-user/host/sparc64/hostdep.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * hostdep.h : things which are dependent on the host architecture
- *
- * * 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.
- */
-
-#ifndef SPARC64_HOSTDEP_H
-#define SPARC64_HOSTDEP_H
-
-/* We have a safe-syscall.inc.S */
-#define HAVE_SAFE_SYSCALL
-
-#endif
diff --git a/linux-user/host/x32/hostdep.h b/linux-user/host/x32/hostdep.h
deleted file mode 100644
index 2c2d6d37da..0000000000
--- a/linux-user/host/x32/hostdep.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * hostdep.h : things which are dependent on the host architecture
- *
- * * 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.
- */
-
-#ifndef X32_HOSTDEP_H
-#define X32_HOSTDEP_H
-
-#endif
diff --git a/linux-user/host/x86_64/hostdep.h b/linux-user/host/x86_64/hostdep.h
deleted file mode 100644
index 9c62bd26bd..0000000000
--- a/linux-user/host/x86_64/hostdep.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * hostdep.h : things which are dependent on the host architecture
- *
- * * 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.
- */
-
-#ifndef X86_64_HOSTDEP_H
-#define X86_64_HOSTDEP_H
-
-/* We have a safe-syscall.inc.S */
-#define HAVE_SAFE_SYSCALL
-
-#endif
diff --git a/linux-user/safe-syscall.h b/linux-user/safe-syscall.h
index 97837faddb..f43267a8fc 100644
--- a/linux-user/safe-syscall.h
+++ b/linux-user/safe-syscall.h
@@ -124,7 +124,7 @@
* need to check SA_RESTART flags in QEMU or distinguish the various
* kinds of restartability.
*/
-#ifdef HAVE_SAFE_SYSCALL
+
/* The core part of this function is implemented in assembly */
extern long safe_syscall_base(int *pending, long number, ...);
extern long safe_syscall_set_errno_tail(int value);
@@ -137,15 +137,4 @@ extern char safe_syscall_end[];
safe_syscall_base(&((TaskState *)thread_cpu->opaque)->signal_pending, \
__VA_ARGS__)
-#else
-
-/*
- * Fallback for architectures which don't yet provide a safe-syscall assembly
- * fragment; note that this is racy!
- * This should go away when all host architectures have been updated.
- */
-#define safe_syscall syscall
-
-#endif
-
#endif
diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h
index 661612a088..f71f372829 100644
--- a/linux-user/user-internals.h
+++ b/linux-user/user-internals.h
@@ -18,7 +18,6 @@
#ifndef LINUX_USER_USER_INTERNALS_H
#define LINUX_USER_USER_INTERNALS_H
-#include "hostdep.h"
#include "exec/user/thunk.h"
#include "exec/exec-all.h"
#include "qemu/log.h"
diff --git a/linux-user/safe-syscall-error.c b/linux-user/safe-syscall-error.c
index d7e2700f81..55d95ac39a 100644
--- a/linux-user/safe-syscall-error.c
+++ b/linux-user/safe-syscall-error.c
@@ -10,10 +10,8 @@
*/
#include "qemu/osdep.h"
-#include "hostdep.h"
#include "safe-syscall.h"
-#ifdef HAVE_SAFE_SYSCALL
/*
* This is intended to be invoked via tail-call on the error path
* from the assembly in host/arch/safe-syscall.inc.S. This takes
@@ -25,4 +23,3 @@ long safe_syscall_set_errno_tail(int value)
errno = value;
return -1;
}
-#endif
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 6d5e5b698c..ca8f24b9ec 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -798,7 +798,6 @@ int queue_signal(CPUArchState *env, int sig, int si_type,
/* Adjust the signal context to rewind out of safe-syscall if we're in it */
static inline void rewind_if_in_safe_syscall(void *puc)
{
-#ifdef HAVE_SAFE_SYSCALL
ucontext_t *uc = (ucontext_t *)puc;
uintptr_t pcreg = host_signal_pc(uc);
@@ -806,7 +805,6 @@ static inline void rewind_if_in_safe_syscall(void *puc)
&& pcreg < (uintptr_t)safe_syscall_end) {
host_signal_set_pc(uc, (uintptr_t)safe_syscall_start);
}
-#endif
}
static void host_signal_handler(int host_sig, siginfo_t *info, void *puc)
diff --git a/linux-user/safe-syscall.S b/linux-user/safe-syscall.S
index 42ea7c40ba..7ddc997801 100644
--- a/linux-user/safe-syscall.S
+++ b/linux-user/safe-syscall.S
@@ -10,15 +10,12 @@
* 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
--
2.25.1
next prev parent reply other threads:[~2021-11-23 17:46 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-23 17:37 [PATCH for-7.0 v6 00/16] linux-user: simplify safe signal handling Richard Henderson
2021-11-23 17:37 ` [PATCH v6 01/16] linux-user: Untabify all safe-syscall.inc.S Richard Henderson
2021-11-25 10:17 ` Warner Losh
2021-11-23 17:37 ` [PATCH v6 02/16] linux-user/host/ppc64: Use r11 for signal_pending address Richard Henderson
2021-11-29 11:01 ` Peter Maydell
2021-11-29 14:30 ` Richard Henderson
2021-11-23 17:37 ` [PATCH v6 03/16] linux-user: Move syscall error detection into safe_syscall_base Richard Henderson
2021-11-25 10:25 ` Warner Losh
2021-11-23 17:37 ` [PATCH v6 04/16] linux-user/host/mips: Add safe-syscall.inc.S Richard Henderson
2021-11-25 10:22 ` Warner Losh
2021-11-29 16:40 ` Peter Maydell
2021-11-29 16:51 ` Richard Henderson
2021-11-23 17:37 ` [PATCH v6 05/16] linux-user/host/sparc64: " Richard Henderson
2021-11-23 17:37 ` Richard Henderson [this message]
2021-11-23 17:37 ` [PATCH v6 07/16] linux-user: Rename TARGET_ERESTARTSYS to QEMU_ERESTARTSYS Richard Henderson
2021-11-23 17:37 ` [PATCH v6 08/16] bsd-user: " Richard Henderson
2021-11-23 17:37 ` [PATCH v6 09/16] linux-user: Rename TARGET_QEMU_ESIGRETURN to QEMU_ESIGRETURN Richard Henderson
2021-11-23 17:37 ` [PATCH v6 10/16] linux-user: Create special-errno.h Richard Henderson
2021-11-23 17:37 ` [PATCH v6 11/16] bsd-user: " Richard Henderson
2021-11-23 17:37 ` [PATCH v6 12/16] common-user: Move safe-syscall.* from linux-user Richard Henderson
2021-11-23 17:37 ` [PATCH v6 13/16] common-user: Adjust system call return on FreeBSD Richard Henderson
2021-11-23 17:37 ` [PATCH v6 14/16] linux-user: Move thunk.c from top-level Richard Henderson
2021-11-23 17:37 ` [PATCH v6 15/16] meson: Move linux_user_ss to linux-user/ Richard Henderson
2021-11-23 17:37 ` [PATCH v6 16/16] meson: Move bsd_user_ss to bsd-user/ Richard Henderson
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=20211123173759.1383510-7-richard.henderson@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).