From patchwork Tue Mar 29 14:13:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 8687521 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 517EF9F44D for ; Tue, 29 Mar 2016 14:14:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BFDCA202AE for ; Tue, 29 Mar 2016 14:14:28 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8B39720253 for ; Tue, 29 Mar 2016 14:14:26 +0000 (UTC) Received: from localhost ([::1]:47271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akuPZ-0008GO-Ry for patchwork-qemu-devel@patchwork.kernel.org; Tue, 29 Mar 2016 10:14:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akuPS-0008Ey-HR for qemu-devel@nongnu.org; Tue, 29 Mar 2016 10:14:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akuPP-0004Gx-3o for qemu-devel@nongnu.org; Tue, 29 Mar 2016 10:14:18 -0400 Received: from out114-136.biz.mail.alibaba.com ([205.204.114.136]:33309 helo=out21.biz.mail.alibaba.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akuPO-0004G7-LR for qemu-devel@nongnu.org; Tue, 29 Mar 2016 10:14:15 -0400 X-Alimail-AntiSpam: AC=CONTINUE; BC=0.151805|-1; FP=0|0|0|0|0|-1|-1|-1; HT=e02c03281; MF=chengang@emindsoft.com.cn; NM=1; PH=DS; RN=11; RT=10; SR=0; TI=SMTPD_----4ee6FIS_1459260833; Received: from localhost.localdomain(mailfrom:chengang@emindsoft.com.cn ip:223.72.89.125) by smtp.aliyun-inc.com(10.147.41.187); Tue, 29 Mar 2016 22:13:59 +0800 From: chengang@emindsoft.com.cn To: rth@twiddle.net, peter.maydell@linaro.org, cmetcalf@ezchip.com, laurent@vivier.eu, edgar.iglesias@gmail.com Date: Tue, 29 Mar 2016 22:13:45 +0800 Message-Id: <1459260825-5710-1-git-send-email-chengang@emindsoft.com.cn> X-Mailer: git-send-email 1.9.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 205.204.114.136 Cc: walt@tilera.com, Chen Gang , riku.voipio@iki.fi, qemu-devel@nongnu.org, Chen Gang Subject: [Qemu-devel] [PATCH] 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.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Edgar E. Iglesias --- 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 4157154..c0a6f7e 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -3532,7 +3532,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 */