From patchwork Tue Jan 27 21:07:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 43854 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 291372409D for ; Tue, 27 Jan 2015 21:10:10 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id n3sf3810530wiv.0 for ; Tue, 27 Jan 2015 13:10:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=bk3bwiXBqquX/Enet8gwjKqCpv2ftP3Gj9oN7qkBCsk=; b=Ljylo9+L14awjIbWLe0Rhq+KLeqI50qQAwTzHw9QX3zLRKM1XVHw2w04ZSSI7ofUvp S7H3XU+m9lkekVFMw9FEo7CqM3t9fXUZXtohT3cb7j4qma2VexKpbJEiTN5xKELS5HLC tj3A5l0dDAri/r4SEphM7dIjIDvRv+LEIJCeA0ogS2v+FWsTWWDuVSXqqLc4LTmwFLEE /lHyWzWCpzCswaMyJ4OTtIzNIq5JbSdNt7iP7qG15rw4INtlPqUofrHJezJVxyZp5Rmh qBIeiQz/F+ZQwd1OQg7tpA9cNhCUgrT9S1RR/HJ0w1efh4k6/ds4Rq4MwPWHGirPaJ82 jyHw== X-Gm-Message-State: ALoCoQmHLZVllWUlibKHZjljoy6QtadCe5NoGVaAEZXg/oZfHvatORWePyqj49inKP1AkjdVuL9I X-Received: by 10.180.92.133 with SMTP id cm5mr14262wib.4.1422393009487; Tue, 27 Jan 2015 13:10:09 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.195 with SMTP id c3ls90501lab.61.gmail; Tue, 27 Jan 2015 13:10:09 -0800 (PST) X-Received: by 10.152.163.100 with SMTP id yh4mr4001610lab.98.1422393009261; Tue, 27 Jan 2015 13:10:09 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id t1si2415189laz.36.2015.01.27.13.10.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 Jan 2015 13:10:09 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id gq15so15570043lab.12 for ; Tue, 27 Jan 2015 13:10:09 -0800 (PST) X-Received: by 10.152.8.1 with SMTP id n1mr4002154laa.47.1422393009133; Tue, 27 Jan 2015 13:10:09 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1227101lbj; Tue, 27 Jan 2015 13:10:08 -0800 (PST) X-Received: by 10.224.4.74 with SMTP id 10mr6046357qaq.37.1422393003973; Tue, 27 Jan 2015 13:10:03 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d2si3061263qaf.109.2015.01.27.13.10.03 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 27 Jan 2015 13:10:03 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:49972 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGDOc-0006LF-Tt for patch@linaro.org; Tue, 27 Jan 2015 16:10:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGDMA-000476-1P for qemu-devel@nongnu.org; Tue, 27 Jan 2015 16:07:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGDM4-0005ly-SU for qemu-devel@nongnu.org; Tue, 27 Jan 2015 16:07:29 -0500 Received: from afflict.kos.to ([92.243.29.197]:35438) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGDM4-0005lB-Jv for qemu-devel@nongnu.org; Tue, 27 Jan 2015 16:07:24 -0500 Received: from afflict.kos.to (afflict [92.243.29.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id 010BF264C8; Tue, 27 Jan 2015 22:07:23 +0100 (CET) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 27 Jan 2015 23:07:12 +0200 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Cc: peter.maydell@linaro.org Subject: [Qemu-devel] [PULL 01/11] linux-user/signal.c: Remove current_exec_domain_sig() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Peter Maydell 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 Signed-off-by: Riku Voipio --- 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);