From patchwork Fri May 27 13:00:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 627181 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rGRxw4mhYz9t3f for ; Fri, 27 May 2016 23:41:40 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=JqaM8eLa; dkim-atps=neutral Received: from localhost ([::1]:45890 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6I1C-0005ND-Lf for incoming@patchwork.ozlabs.org; Fri, 27 May 2016 09:41:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6HOG-0007z0-Bh for qemu-devel@nongnu.org; Fri, 27 May 2016 09:01:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6HOA-0001N6-K9 for qemu-devel@nongnu.org; Fri, 27 May 2016 09:01:24 -0400 Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]:35372) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6HOA-0001Mx-Cc for qemu-devel@nongnu.org; Fri, 27 May 2016 09:01:18 -0400 Received: by mail-lf0-x22c.google.com with SMTP id w16so33413740lfd.2 for ; Fri, 27 May 2016 06:01:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HAm12rQz8nCguRnLrhmAFWcIxQ4tE3eYcd21qrbvC3s=; b=JqaM8eLaZnrDDQALjhDE9z01p3RULX+Is1JldX94gHk/QjR7RI1051HsANjoNRdY90 6cGGCcaaC+LWih+zjPuJQd5rVcAA/1fmoEXEoM0ANIopgf+s1Z5GVOOWitMQpZL0T3IJ /ivE+5+EH7ul5TxTvWFZlY8Hdc9y2YuwoTjb0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HAm12rQz8nCguRnLrhmAFWcIxQ4tE3eYcd21qrbvC3s=; b=VeKM64DKoUyJ1d/1Bar/X46fOwIVCq0jQS2HufvIbxmvFiCCsFOpcIBZPHIGBr7rIv AWy+3Z590LJKUVr1v+SbroZeAyyuoe64CiMuXOziPZ4fiR25ZkottlI8ccap3Rl6XlBY yZwn7UoN1Ox999cxbfB/nBAXOMlAy8IAlt2F114WuKC1pWEwByh33zoMDoVvKLmf/k9G +kUnFeZwr6QAPISguDwiTPBp/57UFKmu7tMzsVpMya/IGXL1wxl4GEBX1L6bxth/zNRX LE+4fghM7aRxgu+NrhY0kqV7ovc6RPO85yqW3ZEeujdR6/e2bx06edZdbL02gfr3VqfG gPCw== X-Gm-Message-State: ALyK8tLNVQLpsd/APv/O+Uy58DyoUX6Oxq+NeuC2fCGBFP4kXKUnMO6hM11lFmNgF1BFm4fr X-Received: by 10.25.88.14 with SMTP id m14mr3745695lfb.156.1464354077509; Fri, 27 May 2016 06:01:17 -0700 (PDT) Received: from beaming.home (91-157-168-132.elisa-laajakaista.fi. [91.157.168.132]) by smtp.gmail.com with ESMTPSA id n16sm2281066lfg.31.2016.05.27.06.01.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 May 2016 06:01:16 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Fri, 27 May 2016 16:00:27 +0300 Message-Id: <166c97edd682878943f496f1a3cbed49e096d43b.1464353863.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22c Subject: [Qemu-devel] [PULL v2 36/38] linux-user/signal.c: Use target address instead of host address for microblaze restorer X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chen Gang Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Chen Gang The return address is in target space, so the restorer address needs to be target space, too. Signed-off-by: Chen Gang Reviewed-by: Peter Maydell Reviewed-by: Laurent Vivier Signed-off-by: Riku Voipio --- linux-user/signal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index a072fa6..c75fb48 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -3573,7 +3573,8 @@ static void setup_frame(int sig, struct target_sigaction *ka, /* Return from sighandler will jump to the tramp. Negative 8 offset because return is rtsd r15, 8 */ - env->regs[15] = ((unsigned long)frame->tramp) - 8; + env->regs[15] = frame_addr + offsetof(struct target_signal_frame, tramp) + - 8; } /* Set up registers for signal handler */