From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akvnO-0007xs-GI for qemu-devel@nongnu.org; Tue, 29 Mar 2016 11:43:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akvnL-0000rk-5A for qemu-devel@nongnu.org; Tue, 29 Mar 2016 11:43:06 -0400 Received: from mail-qg0-x22d.google.com ([2607:f8b0:400d:c04::22d]:33885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akvnL-0000rb-1Z for qemu-devel@nongnu.org; Tue, 29 Mar 2016 11:43:03 -0400 Received: by mail-qg0-x22d.google.com with SMTP id n34so6970297qge.1 for ; Tue, 29 Mar 2016 08:43:02 -0700 (PDT) Sender: Richard Henderson References: <1459260105-5536-1-git-send-email-chengang@emindsoft.com.cn> <56FA9049.3090803@vivier.eu> From: Richard Henderson Message-ID: <56FAA283.4020207@twiddle.net> Date: Tue, 29 Mar 2016 08:42:59 -0700 MIME-Version: 1.0 In-Reply-To: <56FA9049.3090803@vivier.eu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] linux-user/signal.c: Use frame->retcode instead of frame address for alpha target restorer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier , chengang@emindsoft.com.cn, peter.maydell@linaro.org, cmetcalf@ezchip.com Cc: walt@tilera.com, riku.voipio@iki.fi, qemu-devel@nongnu.org, Chen Gang On 03/29/2016 07:25 AM, Laurent Vivier wrote: > > > Le 29/03/2016 16:01, chengang@emindsoft.com.cn a écrit : >> From: Chen Gang >> >> The restorer needs the return code address which is frame->retcode, not >> frame itself. >> >> Signed-off-by: Chen Gang >> --- >> linux-user/signal.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/linux-user/signal.c b/linux-user/signal.c >> index e487f9e..4157154 100644 >> --- a/linux-user/signal.c >> +++ b/linux-user/signal.c >> @@ -5455,7 +5455,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, >> &frame->retcode[1]); >> __put_user(INSN_CALLSYS, &frame->retcode[2]); >> /* imb(); */ >> - r26 = frame_addr; >> + r26 = frame_addr + offsetof(struct target_rt_sigframe, retcode); >> } >> >> if (err) { >> > > If you change setup_rt_frame(), you must update setup_frame() too. > > It seems correct. > > Richard, as you have written the original code, could you check this is > correct? Yes, it's correct, and yes both functions need fixing. In practice, this path is historical and will never be used; it was now a very old glibc that didn't supply a restorer. r~