Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: mark.kettenis@xs4all.nl (Mark Kettenis)
Cc: gdb-patches@sourceware.org
Subject: Re: [commit] Respect "red zone" for SPU inferior calls
Date: Wed, 06 Aug 2008 20:13:00 -0000	[thread overview]
Message-ID: <200808062012.m76KCr9m032195@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <200808061913.m76JDwmx015117@brahms.sibelius.xs4all.nl> from "Mark Kettenis" at Aug 06, 2008 09:13:58 PM

Mark Kettenis wrote:

> > From: "Ulrich Weigand" <uweigand@de.ibm.com>
> > GDB neglected to respect the ABI-defined "red zone" of 2000 bytes on the SPU,
> > which could cause stack corruption when calling an inferior function while
> > within prologue code of another function.  Fixed by the patch below.
> 
> Do I read that right, is that reallu *decimal* 2000?  Seems a bit ood
> to me.

It may be odd, but this is indeed what the ABI specifies:
http://www-01.ibm.com/chips/techlib/techlib.nsf/techdocs/02E544E65760B0BF87257060006F8F20/$file/SPU_ABI-Specification_1.8.pdf

  "Storing to memory using the stack pointer plus an offset must never be
   done with an offset less than -2000 (-125*16). This allows interrupt
   handlers to use the application stack by first adding -2000 to the
   stack pointer."   (p. 9)

This also agrees with what GCC implements.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


      reply	other threads:[~2008-08-06 20:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-06 18:31 Ulrich Weigand
2008-08-06 19:15 ` Mark Kettenis
2008-08-06 20:13   ` Ulrich Weigand [this message]

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=200808062012.m76KCr9m032195@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    /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