* [Qemu-devel] [PATCH] linux-user/signal.c: Use frame->retcode instead of frame address for alpha target restorer
@ 2016-03-29 14:01 chengang
2016-03-29 14:25 ` Laurent Vivier
0 siblings, 1 reply; 4+ messages in thread
From: chengang @ 2016-03-29 14:01 UTC (permalink / raw)
To: rth, peter.maydell, cmetcalf, laurent
Cc: walt, Chen Gang, riku.voipio, qemu-devel, Chen Gang
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) {
--
1.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] linux-user/signal.c: Use frame->retcode instead of frame address for alpha target restorer
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
0 siblings, 2 replies; 4+ messages in thread
From: Laurent Vivier @ 2016-03-29 14:25 UTC (permalink / raw)
To: chengang, rth, peter.maydell, cmetcalf
Cc: walt, riku.voipio, qemu-devel, Chen Gang
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?
Laurent
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] linux-user/signal.c: Use frame->retcode instead of frame address for alpha target restorer
2016-03-29 14:25 ` Laurent Vivier
@ 2016-03-29 14:36 ` Chen Gang
2016-03-29 15:42 ` Richard Henderson
1 sibling, 0 replies; 4+ messages in thread
From: Chen Gang @ 2016-03-29 14:36 UTC (permalink / raw)
To: Laurent Vivier, rth, peter.maydell, cmetcalf
Cc: walt, riku.voipio, qemu-devel, Chen Gang
On 3/29/16 22:25, Laurent Vivier wrote:
> Le 29/03/2016 16:01, chengang@emindsoft.com.cn a écrit :
>> 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.
>
Oh, yes, thanks.
> It seems correct.
>
> Richard, as you have written the original code, could you check this is
> correct?
>
Please give a check when you have time.
Thanks.
--
Chen Gang (陈刚)
Managing Natural Environments is the Duty of Human Beings.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] linux-user/signal.c: Use frame->retcode instead of frame address for alpha target restorer
2016-03-29 14:25 ` Laurent Vivier
2016-03-29 14:36 ` Chen Gang
@ 2016-03-29 15:42 ` Richard Henderson
1 sibling, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2016-03-29 15:42 UTC (permalink / raw)
To: Laurent Vivier, chengang, peter.maydell, cmetcalf
Cc: walt, riku.voipio, qemu-devel, 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 <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~
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-03-29 15:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).