From: David Daney <ddaney@avtrex.com>
To: Franck Bui-Huu <vagabon.xyz@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
linux-mips <linux-mips@linux-mips.org>
Subject: Re: Question about signal syscalls !
Date: Thu, 01 Feb 2007 09:01:50 -0800 [thread overview]
Message-ID: <45C21CFE.9060804@avtrex.com> (raw)
In-Reply-To: <cda58cb80702010654w74527a34k4ed229b499b8f9b2@mail.gmail.com>
Franck Bui-Huu wrote:
> Hi Ralf,
>
> On 2/1/07, Ralf Baechle <ralf@linux-mips.org> wrote:
>> The values of those registers need to be preserved so they can later be
>> copied into the signal frame.
>>
>
> Let's take for example sys_sigreturn(). In my understanding this
> syscall is used automatically when the signal handler returns. At this
> time, I don't see the point to save the static registers since they
> have been already saved by setup_sigcontext().
>
> Actually I don't see why they need to be saved/restored at all...
>
> Let's say that process P1 sends a signal X to process P2 which has a
> handler defined for signal X and assume that the static registers are
> not saved at all.
>
> Signal X is received by P2. The signal handler is now executed in user
> mode. At this point what are the values of the static registers ? I
> would say they have the same values (let's call this state S) when P2
> got interrupted. Once the signal handler returns into the kernel mode
> by executing 'syscall __NR_sigreturn' instructions, static registers
> still have state S and this state is normally preserved during
> sys_sigreturn syscall execution. So when resuming the normal execution
> of P2, the static registers have the correct values.
>
> What am I missing ?
I don't think *any* registers *need* to be saved on sys_sigreturn().
The values in sigcontext on the user stack associated with the system
call are all used instead of the actual register values.
David Daney
next prev parent reply other threads:[~2007-02-01 17:02 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-01 10:43 Question about signal syscalls ! Franck Bui-Huu
2007-02-01 13:57 ` Ralf Baechle
2007-02-01 14:54 ` Franck Bui-Huu
2007-02-01 17:01 ` David Daney [this message]
2007-02-02 8:55 ` Franck Bui-Huu
2007-02-02 16:04 ` David Daney
2007-02-02 16:36 ` Franck Bui-Huu
2007-02-02 16:53 ` Daniel Jacobowitz
2007-02-02 20:03 ` Franck Bui-Huu
2007-02-02 20:18 ` Franck Bui-Huu
2007-02-02 16:56 ` David Daney
2007-02-02 19:58 ` Franck Bui-Huu
2007-02-02 20:41 ` David Daney
2007-02-05 0:55 ` Daniel Jacobowitz
2007-02-05 1:10 ` Ralf Baechle
2007-02-05 2:30 ` Daniel Jacobowitz
2007-02-05 6:00 ` David Daney
2007-02-05 9:17 ` Franck Bui-Huu
2007-02-05 9:08 ` Franck Bui-Huu
2007-02-01 18:10 ` Ralf Baechle
2007-02-02 8:54 ` Franck Bui-Huu
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=45C21CFE.9060804@avtrex.com \
--to=ddaney@avtrex.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=vagabon.xyz@gmail.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