From: Carlos O'Donell <carlos@baldric.uwo.ca>
To: parisc-linux@lists.parisc-linux.org
Subject: [parisc-linux] Re: [parisc-linux-cvs] linux-2.6 carlos
Date: Wed, 10 Dec 2003 20:03:40 -0500 [thread overview]
Message-ID: <20031211010340.GH15502@systemhalted> (raw)
In-Reply-To: <20031210224026.33A39494275@palinux.hppa>
On Wed, Dec 10, 2003 at 03:40:26PM -0700, Carlos O'Donell wrote:
> CVSROOT: /var/cvs
> Module name: linux-2.6
> Changes by: carlos 03/12/10 15:40:25
>
> Modified files:
> include/asm-parisc: compat.h rt_sigframe.h siginfo.h ucontext.h
>
> Log message:
> Cleanup for non-native thread signals, and ensure that during 64-bit builds everything works too.
You may have noticed the following:
8 #define SIGRETURN_TRAMP 4
9 #define SIGRESTARTBLOCK_TRAMP 5
10 #define TRAMP_SIZE (SIGRETURN_TRAMP + SIGRESTARTBLOCK_TRAMP)
11
12 struct rt_sigframe {
13 /* XXX: Must match trampoline size in arch/parisc/kernel/signal.c
14 Secondary to that it must protect the ERESTART_RESTARTBLOCK
15 trampoline we left on the stack (we were bad and didn't
16 change sp so we could run really fast.) */
17 unsigned int tramp[TRAMP_SIZE];
18 struct siginfo info;
19 struct ucontext uc;
20 };
And wondered "Why do people write XXX: followed by some scary sounding
stuff?" Here is the part where we clarify what this means.
When Randolph wrote the ERESTART_RESTARTBLOCK code he used a stack
trampoline to rewrite the syscall entry into the kernel with a different
syscall number. This stack trampoline is *unprotected* and the stack
pointer is not adjusted.
If one were to take a signal while executing the ERESTART_RESTARTBLOCK
stack trampoline the signal's frame would destroy the trampoline. Instead
we *notch* 5 more words out of the front of the signal frame to protect a
possible ERESTART_RESTARTBLOCK trampoline. The signal code used to do
exactly the same thing before, it had it's own notch for the sigreturn
trampoline on the stack. Thus now we protect both trampolines.
What if you took another ERESTART_RESTARTBLOCK signal while walking the
last ERESTART_RESTARTBLOCK trampoline? Well that scenario isn't allowed
to happen, and according to Linux we have to disable
ERESTART_RESTARTBLOCK until we are back in the kernel handling the
restart. We still haven't fixed this last bit.
c.
next parent reply other threads:[~2003-12-11 1:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20031210224026.33A39494275@palinux.hppa>
2003-12-11 1:03 ` Carlos O'Donell [this message]
[not found] <20040430141548.EFE284945CD@palinux.hppa>
2004-04-30 15:57 ` [parisc-linux] Re: [parisc-linux-cvs] linux-2.6 carlos Carlos O'Donell
[not found] <20040428231338.BB0124945C3@palinux.hppa>
2004-04-28 23:15 ` Carlos O'Donell
2004-04-28 23:51 ` Carlos O'Donell
[not found] <20040426044648.93EE4494593@palinux.hppa>
2004-04-26 4:51 ` Carlos O'Donell
[not found] <20040203230410.71952494194@palinux.hppa>
2004-02-03 23:07 ` Carlos O'Donell
[not found] <20040203215113.E38D0494194@palinux.hppa>
2004-02-03 21:53 ` Carlos O'Donell
[not found] <20040128060516.492DE4941AA@palinux.hppa>
2004-01-28 14:00 ` [parisc-linux] " Joel Soete
2004-01-28 23:11 ` Carlos O'Donell
2004-01-29 7:28 ` Joel Soete
2004-01-29 9:25 ` Joel Soete
2004-02-01 20:05 ` Randolph Chung
2004-02-02 10:25 ` Joel Soete
2004-02-02 17:50 ` Joel Soete
[not found] <20040128051415.4C9724941AA@palinux.hppa>
2004-01-28 5:25 ` [parisc-linux] " Carlos O'Donell
[not found] <20040128051247.D6C6C4941AA@palinux.hppa>
2004-01-28 5:23 ` Carlos O'Donell
[not found] <20031211004856.66476494275@palinux.hppa>
2003-12-11 1:23 ` Carlos O'Donell
[not found] <20031108210057.7FFAB49402D@palinux.hppa>
2003-11-08 21:16 ` Joel Soete
2003-11-08 22:11 ` Carlos O'Donell
[not found] <20031108205955.7039B49402D@palinux.hppa>
2003-11-08 20:58 ` Carlos O'Donell
[not found] ` <3FAD63B7.6020805@tiscali.be>
2003-11-08 22:00 ` Carlos O'Donell
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=20031211010340.GH15502@systemhalted \
--to=carlos@baldric.uwo.ca \
--cc=parisc-linux@lists.parisc-linux.org \
/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.