From patchwork Tue Jul 15 14:24:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 33669 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AC43F20CAD for ; Tue, 15 Jul 2014 14:27:37 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id fp1sf18845365pdb.5 for ; Tue, 15 Jul 2014 07:27:37 -0700 (PDT) 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=yPZEeDN3oucI3SpYjSOZzMAqX7gGeJ6x9XfxuyrROcY=; b=L4xWfp186ww7wThEsrZI11aR4kz2khcWorrZ1kbsVYUB2IZhwm2Gk27ldoVn5WIQUB qKTyDWbF9thlHQnPYM/0tu4OmtrZRYV8OdNSUXVeB+shYKsIJBOJgeY42rVXqc2coZeU fTzIGdsugqZT09hLEdBVht8yZUEPvSUz9kPfE/7OSdHboHlAugeuejygxrSXW3Spe+De AWDW15FgSJl9NOFR9dNx0axS7UwoPU/yP1u4/c7gCYMSOJjpsG4vyB2Fe8Y5auMGEMEJ WyshjdJAtDbX80n1jCxQfGbf7/umUnFejCVL8S9kbVpa+1Ittkg686iKClYBkqWv0Z/w Kkzg== X-Gm-Message-State: ALoCoQl6B3LG/DtxItf3zeyKhYbRT0YXYY9FVF+UkSqEdYuPp7UaV+iN+tA5PlAKUcVYp5EajV3D X-Received: by 10.66.161.234 with SMTP id xv10mr11755039pab.20.1405434457019; Tue, 15 Jul 2014 07:27:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.19.173 with SMTP id 42ls106822qgh.27.gmail; Tue, 15 Jul 2014 07:27:36 -0700 (PDT) X-Received: by 10.220.69.68 with SMTP id y4mr22403542vci.21.1405434456894; Tue, 15 Jul 2014 07:27:36 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id xb10si6788059vcb.45.2014.07.15.07.27.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Jul 2014 07:27:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id lf12so6389370vcb.40 for ; Tue, 15 Jul 2014 07:27:36 -0700 (PDT) X-Received: by 10.221.26.10 with SMTP id rk10mr22909142vcb.0.1405434456816; Tue, 15 Jul 2014 07:27:36 -0700 (PDT) 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.221.37.5 with SMTP id tc5csp218961vcb; Tue, 15 Jul 2014 07:27:36 -0700 (PDT) X-Received: by 10.140.16.67 with SMTP id 61mr34722654qga.28.1405434454914; Tue, 15 Jul 2014 07:27:34 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 31si11892912qgw.57.2014.07.15.07.27.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 15 Jul 2014 07:27:34 -0700 (PDT) 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]:34987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X73he-0000ju-Hg for patch@linaro.org; Tue, 15 Jul 2014 10:27:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X73fI-0005hE-CR for qemu-devel@nongnu.org; Tue, 15 Jul 2014 10:25:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X73fA-0007X9-Sk for qemu-devel@nongnu.org; Tue, 15 Jul 2014 10:25:08 -0400 Received: from [2001:4b98:dc0:45:216:3eff:fe3d:166f] (port=52394 helo=afflict.kos.to) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X73fA-0007Ww-Ly for qemu-devel@nongnu.org; Tue, 15 Jul 2014 10:25:00 -0400 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 3498526560; Tue, 15 Jul 2014 16:24:59 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 15 Jul 2014 17:24:57 +0300 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: 2001:4b98:dc0:45:216:3eff:fe3d:166f Cc: Peter Maydell , Riku Voipio Subject: [Qemu-devel] [PULL for-2.1 5/5] linux-user: use TARGET_SA_ONSTACK in get_sigframe 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.220.181 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: Riku Voipio As reported by Laurent, which should use TARGET_SA_ONSTACK on arm, microblaze and openrisc targets like we do on all others. Practical matter is minimal as for almost all archs SA_ONSTACK is 0x08000000: http://lxr.free-electrons.com/ident?i=SA_ONSTACK Reported-by: Laurent Desnogues Signed-off-by: Riku Voipio --- linux-user/signal.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index f3b4378..1141054 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -1305,7 +1305,7 @@ static abi_ulong get_sigframe(struct target_sigaction *ka, CPUARMState *env) /* * This is the X/Open sanctioned signal stack switching. */ - if ((ka->sa_flags & SA_ONSTACK) && !sas_ss_flags(sp)) { + if ((ka->sa_flags & TARGET_SA_ONSTACK) && !sas_ss_flags(sp)) { sp = target_sigaltstack_used.ss_sp + target_sigaltstack_used.ss_size; } @@ -3509,8 +3509,9 @@ static abi_ulong get_sigframe(struct target_sigaction *ka, { abi_ulong sp = env->regs[1]; - if ((ka->sa_flags & SA_ONSTACK) != 0 && !on_sig_stack(sp)) + if ((ka->sa_flags & TARGET_SA_ONSTACK) != 0 && !on_sig_stack(sp)) { sp = target_sigaltstack_used.ss_sp + target_sigaltstack_used.ss_size; + } return ((sp - frame_size) & -8UL); } @@ -3891,7 +3892,7 @@ static inline abi_ulong get_sigframe(struct target_sigaction *ka, /* redzone */ /* This is the X/Open sanctioned signal stack switching. */ - if ((ka->sa_flags & SA_ONSTACK) != 0 && !onsigstack) { + if ((ka->sa_flags & TARGET_SA_ONSTACK) != 0 && !onsigstack) { sp = target_sigaltstack_used.ss_sp + target_sigaltstack_used.ss_size; }