linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Saving to 32 bits of GPRs in signal context
@ 2007-05-29  7:24 Benjamin Herrenschmidt
  2007-05-29  7:52 ` Dan Malek
  2007-05-29 13:53 ` Ulrich Weigand
  0 siblings, 2 replies; 63+ messages in thread
From: Benjamin Herrenschmidt @ 2007-05-29  7:24 UTC (permalink / raw)
  To: Paul Mackerras
  Cc: linuxppc-dev list, Steve Munroe, Anton Blanchard, Ulrich Weigand

Hi Folks !

I've been looking at saving & restoring the top 32 bits of 64 bits
registers when delivering signals to 32 bits processes on a 64 bits
kernel. The principle is easy, but I wonder where to stick them.

I was initially tempted to add them to the end of struct mcontext32 but
decided against it.

Then, knowing that we have this uc_regs pointer that points to the
mcontext, I was thinking about adding next to it a uc_highregs pointer
that points to them (and I can then add them anywhere in the signal
frame, the user don't have to know, just follow the pointer).

But that means changing slightly the layout of ucontext32...

Thus my question is which fields in there have their location
ABIficated ? (not necessarily written ABI, but more like gdb "knows"
about them for example, or the infamous old style signal frame unmangler
in gcc C++ exception runtime).

Specifically, are everybody using the uc_regs pointer to get to the
mcontext or are some people likely to expect the mcontext to always be
at the same offset from the beginning of the signal frame ?

I'd like to add my highregs pointer just before the mcontext (after all
the other fields) but I see a uc_pad2 in there which makes me wonder...
I suppose I could also hijack one of the pad fields... they are only
here to make sure the mcontext is 16 bytes aligned right ?

There are a few other issues... one is, the pad fields aren't cleared.
Thus how can userland or rt_sigreturn differenciate between a valid
highregs pointers and ramdom junk ? Is there a trick one of you can come
up with that I could do to let userland/gdb/rt_sigreturn know that
there's something there ?

rt_sigreturn isn't much of a problem since I will initialize the
contexts I create to 0 in that field, and will check the pointer
validity so the worst that can happen is crap in the top 32 bits if some
app mucks around too much, which isn't not a problem.

I'm a bit more worried about how will gdb know that there's something
useful to peek/poke at in there.

Cheers,
Ben

^ permalink raw reply	[flat|nested] 63+ messages in thread

end of thread, other threads:[~2007-05-31  5:40 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-29  7:24 Saving to 32 bits of GPRs in signal context Benjamin Herrenschmidt
2007-05-29  7:52 ` Dan Malek
2007-05-29  8:05   ` Benjamin Herrenschmidt
2007-05-29  9:26     ` Gabriel Paubert
2007-05-29  9:44       ` Benjamin Herrenschmidt
2007-05-29 13:12         ` Segher Boessenkool
2007-05-29 14:00           ` Steve Munroe
2007-05-29 14:08             ` Ulrich Weigand
2007-05-29 14:17               ` Kumar Gala
2007-05-29 14:38                 ` Segher Boessenkool
2007-05-29 19:04                   ` Becky Bruce
2007-05-30 10:04                     ` Christoph Hellwig
2007-05-30 12:13                       ` Kumar Gala
2007-05-30 12:30                     ` Segher Boessenkool
2007-05-29 14:31               ` Segher Boessenkool
2007-05-29 14:51               ` Steve Munroe
2007-05-29 21:44                 ` Benjamin Herrenschmidt
2007-05-29 23:16                   ` Steve Munroe
2007-05-29 23:19                     ` Benjamin Herrenschmidt
2007-05-30  7:34                     ` Hiroyuki Machida
2007-05-30 11:40                   ` Segher Boessenkool
2007-05-30 11:48                     ` Benjamin Herrenschmidt
2007-05-30  3:37                 ` Paul Mackerras
2007-05-30  5:32                   ` Kumar Gala
2007-05-30 11:44                     ` Benjamin Herrenschmidt
2007-05-30 12:15                       ` Kumar Gala
2007-05-30 12:48                         ` Hiroyuki Machida
2007-05-30 12:58                           ` Benjamin Herrenschmidt
2007-05-30 18:09                             ` Steve Munroe
2007-05-30 21:02                       ` Gabriel Paubert
2007-05-30 21:41                         ` Steve Munroe
2007-05-30 12:01                     ` Segher Boessenkool
2007-05-30 11:59                   ` Segher Boessenkool
2007-05-30 12:01                     ` Benjamin Herrenschmidt
2007-05-30 12:07                       ` Segher Boessenkool
2007-05-30 12:09                         ` Benjamin Herrenschmidt
2007-05-30 12:36                           ` Segher Boessenkool
2007-05-29 14:28             ` Segher Boessenkool
2007-05-29 21:37             ` Benjamin Herrenschmidt
2007-05-29 21:38               ` Benjamin Herrenschmidt
2007-05-29 13:04       ` Segher Boessenkool
2007-05-29 14:28         ` Arnd Bergmann
2007-05-29 14:43           ` Segher Boessenkool
2007-05-29 15:54             ` Geert Uytterhoeven
2007-05-29 18:48             ` Arnd Bergmann
2007-05-29 21:27         ` Benjamin Herrenschmidt
2007-05-29 21:45           ` Felix Domke
2007-05-30 11:23             ` Benjamin Herrenschmidt
2007-05-30 11:52               ` Felix Domke
2007-05-30 13:14                 ` Segher Boessenkool
2007-05-30 11:54             ` Segher Boessenkool
2007-05-30 12:07               ` Felix Domke
2007-05-31  5:39                 ` Benjamin Herrenschmidt
2007-05-29 13:10     ` Kumar Gala
2007-05-29 21:32       ` Benjamin Herrenschmidt
2007-05-29 23:46         ` Olof Johansson
2007-05-30  0:43           ` Kumar Gala
2007-05-30  2:54             ` Steve Munroe
2007-05-30  5:31               ` Kumar Gala
2007-05-30 19:47                 ` Steve Munroe
2007-05-30 20:52                   ` Olof Johansson
2007-05-30 21:33                     ` Steve Munroe
2007-05-29 13:53 ` Ulrich Weigand

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).