qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Laurent Vivier <laurent@vivier.eu>,
	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 <gang.chen.5i5j@gmail.com>
Subject: Re: [Qemu-devel] [PATCH] linux-user/signal.c: Use frame->retcode instead of frame address for alpha target restorer
Date: Tue, 29 Mar 2016 08:42:59 -0700	[thread overview]
Message-ID: <56FAA283.4020207@twiddle.net> (raw)
In-Reply-To: <56FA9049.3090803@vivier.eu>

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 <chengang@emindsoft.com.cn>
>>
>> The restorer needs the return code address which is frame->retcode, not
>> frame itself.
>>
>> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
>> ---
>>  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~

      parent reply	other threads:[~2016-03-29 15:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29 14:01 [Qemu-devel] [PATCH] linux-user/signal.c: Use frame->retcode instead of frame address for alpha target restorer chengang
2016-03-29 14:25 ` Laurent Vivier
2016-03-29 14:36   ` Chen Gang
2016-03-29 15:42   ` Richard Henderson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56FAA283.4020207@twiddle.net \
    --to=rth@twiddle.net \
    --cc=chengang@emindsoft.com.cn \
    --cc=cmetcalf@ezchip.com \
    --cc=gang.chen.5i5j@gmail.com \
    --cc=laurent@vivier.eu \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    --cc=walt@tilera.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).