From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6382 invoked by alias); 6 Aug 2008 20:13:54 -0000 Received: (qmail 6374 invoked by uid 22791); 6 Aug 2008 20:13:53 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate3.de.ibm.com (HELO mtagate3.de.ibm.com) (195.212.29.152) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 06 Aug 2008 20:13:11 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.13.8/8.13.8) with ESMTP id m76KCraF112946 for ; Wed, 6 Aug 2008 20:12:53 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m76KCr9v3285066 for ; Wed, 6 Aug 2008 22:12:53 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m76KCr68032198 for ; Wed, 6 Aug 2008 22:12:53 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id m76KCr9m032195; Wed, 6 Aug 2008 22:12:53 +0200 Message-Id: <200808062012.m76KCr9m032195@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Wed, 6 Aug 2008 22:12:53 +0200 Subject: Re: [commit] Respect "red zone" for SPU inferior calls To: mark.kettenis@xs4all.nl (Mark Kettenis) Date: Wed, 06 Aug 2008 20:13:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <200808061913.m76JDwmx015117@brahms.sibelius.xs4all.nl> from "Mark Kettenis" at Aug 06, 2008 09:13:58 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00140.txt.bz2 Mark Kettenis wrote: > > From: "Ulrich Weigand" > > 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