linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Dan Malek <dan@embeddedalley.com>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>,
	Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
	Paul Mackerras <paulus@samba.org>,
	Steve Munroe <sjmunroe@us.ibm.com>,
	Anton Blanchard <anton@samba.org>
Subject: Re: Saving to 32 bits of GPRs in signal context
Date: Tue, 29 May 2007 18:05:00 +1000	[thread overview]
Message-ID: <1180425900.19517.136.camel@localhost.localdomain> (raw)
In-Reply-To: <B1348C8C-09B1-4906-BF89-CC4206F0CA0A@embeddedalley.com>

On Tue, 2007-05-29 at 03:52 -0400, Dan Malek wrote:
> > 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'm wondering why you need to do this at all?
> Why would a 32-bit application care about or
> know what to do with these?

There are regular demands for the ability to use the full 64 bits
registers in 32 bits applications when running on a 64 bits processor.
That ranges from, iirc, the java folks, to people wanting to optimize
some libs to use 64 bits registers internally when called from 32 bits
apps etc...

You can use the full 64 bits easily on powerpc, ld/std just work, it's
only the flags calculations and branches, mostly, that are truncated
when running in 32 bits mode. Also, the kernel syscall & interrupt
entry/exit path will save & restore the full 64 bits.

The problem is when you use signals. The compat signal code for 32 bits
apps will only save and restore the bottom 32 bits, thus an application
using signals will potentially corrupt the top 32 bits, which can be a
problem if, for example, it uses a library that has optimisations based
on using the full 64 bits.

We don't intend to update jmpbuf, getcontext/setcontext etc... for
those... they are purely call clobbered etc..., but it would be nice if
at least the signal frame save/restore could properly deal with them so
they don't get randomly clobbered.

Ben.

  reply	other threads:[~2007-05-29  8:05 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=1180425900.19517.136.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=anton@samba.org \
    --cc=dan@embeddedalley.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    --cc=sjmunroe@us.ibm.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;
as well as URLs for NNTP newsgroup(s).