From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: Riku Voipio <riku.voipio@iki.fi>, patches@linaro.org
Subject: [Qemu-devel] [PATCH 1/6] linux-user/signal.c: Remove current_exec_domain_sig()
Date: Thu, 8 Jan 2015 12:19:43 +0000 [thread overview]
Message-ID: <1420719588-8138-2-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1420719588-8138-1-git-send-email-peter.maydell@linaro.org>
Remove the function current_exec_domain_sig(), which always returns
its argument. This was intended as a stub for supporting the kernel's
exec_domain handling, but:
* we don't have any of the other code for execution domains
* in the kernel this handling is architecture-specific, not generic
* we only call this function in the x86, ppc and sh4 signal code paths,
and the PPC one is wrong anyway because the PPC kernel doesn't
have this signal-remapping code
So it's best to simply delete the function; any future attempt to
implement exec domains will be better served by adding the correct
code from scratch based on the kernel sources at that time.
This change also fixes some clang warnings about the function being
defined but not used for some target architectures.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
linux-user/signal.c | 31 ++++++-------------------------
1 file changed, 6 insertions(+), 25 deletions(-)
diff --git a/linux-user/signal.c b/linux-user/signal.c
index e11b208..fa955ef 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -738,12 +738,6 @@ static inline void copy_siginfo_to_user(target_siginfo_t *tinfo,
tswap_siginfo(tinfo, info);
}
-static inline int current_exec_domain_sig(int sig)
-{
- return /* current->exec_domain && current->exec_domain->signal_invmap
- && sig < 32 ? current->exec_domain->signal_invmap[sig] : */ sig;
-}
-
#if defined(TARGET_I386) && TARGET_ABI_BITS == 32
/* from the Linux kernel */
@@ -926,8 +920,7 @@ static void setup_frame(int sig, struct target_sigaction *ka,
if (!lock_user_struct(VERIFY_WRITE, frame, frame_addr, 0))
goto give_sigsegv;
- __put_user(current_exec_domain_sig(sig),
- &frame->sig);
+ __put_user(sig, &frame->sig);
setup_sigcontext(&frame->sc, &frame->fpstate, env, set->sig[0],
frame_addr + offsetof(struct sigframe, fpstate));
@@ -988,7 +981,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka,
if (!lock_user_struct(VERIFY_WRITE, frame, frame_addr, 0))
goto give_sigsegv;
- __put_user(current_exec_domain_sig(sig), &frame->sig);
+ __put_user(sig, &frame->sig);
addr = frame_addr + offsetof(struct rt_sigframe, info);
__put_user(addr, &frame->pinfo);
addr = frame_addr + offsetof(struct rt_sigframe, uc);
@@ -3228,14 +3221,11 @@ static void setup_frame(int sig, struct target_sigaction *ka,
abi_ulong frame_addr;
int i;
int err = 0;
- int signal;
frame_addr = get_sigframe(ka, regs->gregs[15], sizeof(*frame));
if (!lock_user_struct(VERIFY_WRITE, frame, frame_addr, 0))
goto give_sigsegv;
- signal = current_exec_domain_sig(sig);
-
setup_sigcontext(&frame->sc, regs, set->sig[0]);
for (i = 0; i < TARGET_NSIG_WORDS - 1; i++) {
@@ -3259,7 +3249,7 @@ static void setup_frame(int sig, struct target_sigaction *ka,
/* Set up registers for signal handler */
regs->gregs[15] = frame_addr;
- regs->gregs[4] = signal; /* Arg for signal handler */
+ regs->gregs[4] = sig; /* Arg for signal handler */
regs->gregs[5] = 0;
regs->gregs[6] = frame_addr += offsetof(typeof(*frame), sc);
regs->pc = (unsigned long) ka->_sa_handler;
@@ -3280,14 +3270,11 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka,
abi_ulong frame_addr;
int i;
int err = 0;
- int signal;
frame_addr = get_sigframe(ka, regs->gregs[15], sizeof(*frame));
if (!lock_user_struct(VERIFY_WRITE, frame, frame_addr, 0))
goto give_sigsegv;
- signal = current_exec_domain_sig(sig);
-
copy_siginfo_to_user(&frame->info, info);
/* Create the ucontext. */
@@ -3322,7 +3309,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka,
/* Set up registers for signal handler */
regs->gregs[15] = frame_addr;
- regs->gregs[4] = signal; /* Arg for signal handler */
+ regs->gregs[4] = sig; /* Arg for signal handler */
regs->gregs[5] = frame_addr + offsetof(typeof(*frame), info);
regs->gregs[6] = frame_addr + offsetof(typeof(*frame), uc);
regs->pc = (unsigned long) ka->_sa_handler;
@@ -4680,7 +4667,6 @@ static void setup_frame(int sig, struct target_sigaction *ka,
struct target_sigcontext *sc;
target_ulong frame_addr, newsp;
int err = 0;
- int signal;
#if defined(TARGET_PPC64)
struct image_info *image = ((TaskState *)thread_cpu->opaque)->info;
#endif
@@ -4690,8 +4676,6 @@ static void setup_frame(int sig, struct target_sigaction *ka,
goto sigsegv;
sc = &frame->sctx;
- signal = current_exec_domain_sig(sig);
-
__put_user(ka->_sa_handler, &sc->handler);
__put_user(set->sig[0], &sc->oldmask);
#if TARGET_ABI_BITS == 64
@@ -4724,7 +4708,7 @@ static void setup_frame(int sig, struct target_sigaction *ka,
/* Set up registers for signal handler. */
env->gpr[1] = newsp;
- env->gpr[3] = signal;
+ env->gpr[3] = sig;
env->gpr[4] = frame_addr + offsetof(struct target_sigframe, sctx);
#if defined(TARGET_PPC64)
@@ -4765,7 +4749,6 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka,
struct target_mcontext *mctx = 0;
target_ulong rt_sf_addr, newsp = 0;
int i, err = 0;
- int signal;
#if defined(TARGET_PPC64)
struct image_info *image = ((TaskState *)thread_cpu->opaque)->info;
#endif
@@ -4774,8 +4757,6 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka,
if (!lock_user_struct(VERIFY_WRITE, rt_sf, rt_sf_addr, 1))
goto sigsegv;
- signal = current_exec_domain_sig(sig);
-
copy_siginfo_to_user(&rt_sf->info, info);
__put_user(0, &rt_sf->uc.tuc_flags);
@@ -4821,7 +4802,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka,
/* Set up registers for signal handler. */
env->gpr[1] = newsp;
- env->gpr[3] = (target_ulong) signal;
+ env->gpr[3] = (target_ulong) sig;
env->gpr[4] = (target_ulong) h2g(&rt_sf->info);
env->gpr[5] = (target_ulong) h2g(&rt_sf->uc);
env->gpr[6] = (target_ulong) h2g(rt_sf);
--
1.9.1
next prev parent reply other threads:[~2015-01-08 12:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-08 12:19 [Qemu-devel] [PATCH 0/6] linux-user: Fix various clang warnings Peter Maydell
2015-01-08 12:19 ` Peter Maydell [this message]
2015-01-08 12:19 ` [Qemu-devel] [PATCH 2/6] linux-user/alpha: Add define for NR_shmat to enable shmat syscall Peter Maydell
2015-01-10 15:56 ` Peter Maydell
2015-01-10 21:02 ` Richard Henderson
2015-01-08 12:19 ` [Qemu-devel] [PATCH 3/6] linux-user/arm/nwfpe: Delete unused aCC array Peter Maydell
2015-01-08 12:19 ` [Qemu-devel] [PATCH 4/6] linux-user/main.c: Call cpu_exec_start/end on all target archs Peter Maydell
2015-01-08 12:19 ` [Qemu-devel] [PATCH 5/6] linux-user/main.c: Mark end_exclusive() as possibly unused Peter Maydell
2015-01-21 8:40 ` Thomas Huth
2015-01-21 10:54 ` Peter Maydell
2015-01-08 12:19 ` [Qemu-devel] [PATCH 6/6] linux-user/signal.c: Remove unnecessary wrapper copy_siginfo_to_user Peter Maydell
2015-01-20 14:54 ` [Qemu-devel] [PATCH 0/6] linux-user: Fix various clang warnings Peter Maydell
2015-01-21 10:23 ` Riku Voipio
2015-01-27 19:06 ` Peter Maydell
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=1420719588-8138-2-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=patches@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/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).