All of lore.kernel.org
 help / color / mirror / Atom feed
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: Fri, 02 Feb 2007 08:56:38 -0800	[thread overview]
Message-ID: <45C36D46.5040409@avtrex.com> (raw)
In-Reply-To: <cda58cb80702020836t54ab54bam1b83dd7c1dacb4d8@mail.gmail.com>

Franck Bui-Huu wrote:
> David Daney wrote:
>> sys_sigreturn does not return to the caller in the conventional sense.
>
> I expect you're talking about this bite of code taken from 
> _sys_sigreturn():
>
>        /*
>         * Don't let your children do this ...
>         */
>        __asm__ __volatile__(
>                "move\t$29, %0\n\t"
>                "j\tsyscall_exit"
>                :/* no outputs */
>                :"r" (&regs));
>
>> The entire user context (i.e. the value of *all* registers) is replaced
>> with the values stored in the sigcontext structure on the caller's
>> stack.  If all registers are being restored from the sigcontext, then
>> there is no need to save the current values of the registers, because
>> they will never be used.
>>
>
> But I don't see where _all_ registers are saved. Only static registers
> are saved by save_static_function() right before calling
> _sys_sigreturn() and I agree I don't why we need to save those.
>
> And now I'm starting to think that we don't need to save static regs in
> setup_sigcontext() either...
>
All registers *must* be saved in the sigcontext.  That is part of the 
contract the kernel has with user code.

On return from an asynchronous signal, *all* registers must contain the 
same values they had before the process was interrupted.

David Daney

David Daney

  parent reply	other threads:[~2007-02-02 16:57 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
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 [this message]
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=45C36D46.5040409@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.