From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=55844 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzwyR-0002tA-9o for qemu-devel@nongnu.org; Wed, 16 Mar 2011 16:05:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzwyQ-0002AZ-Bg for qemu-devel@nongnu.org; Wed, 16 Mar 2011 16:05:39 -0400 Received: from gate.crashing.org ([63.228.1.57]:50430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzwyQ-0002AL-1d for qemu-devel@nongnu.org; Wed, 16 Mar 2011 16:05:38 -0400 From: Benjamin Herrenschmidt In-Reply-To: <4D80DF6A.8040107@suse.de> References: <1300251423-6715-1-git-send-email-david@gibson.dropbear.id.au> <1300251423-6715-22-git-send-email-david@gibson.dropbear.id.au> <4D80DF6A.8040107@suse.de> Content-Type: text/plain; charset="UTF-8" Date: Thu, 17 Mar 2011 07:05:19 +1100 Message-ID: <1300305919.22236.1175.camel@pasglop> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 21/26] Implement TCE translation for sPAPR VIO List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: paulus@samba.org, qemu-devel@nongnu.org, anton@samba.org, David Gibson On Wed, 2011-03-16 at 17:03 +0100, Alexander Graf wrote: > > > +int spapr_tce_dma_zero(VIOsPAPRDevice *dev, uint64_t taddr, > uint32_t size) > > +{ > > + uint8_t *zeroes; > > + > > +#ifdef DEBUG_TCE > > + fprintf(stderr, "spapr_tce_dma_zero taddr=0x%llx size=0x%x\n", > > + (unsigned long long)taddr, size); > > +#endif > > + > > + /* FIXME: do this better... */ > > + zeroes = alloca(size); > > + memset(zeroes, 0, size); > > You sure that zeroes is still alive during the call? If I were a > compiler, I'd probably optimize the return away so that it'd end up > being a simple branch to spapr_tce_dma_write - coincidentally > invalidating the stack that zeroes is on. Ugh ? How would this ever be legal for a compiler to do that ? Ben.