[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH 21/26] Implement TCE translation for sPAPR V
Re: [Qemu-devel] Re: [PATCH 21/26] Implement TCE translation for sPAPR VIO
Wed, 16 Mar 2011 15:21:31 -0500
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:188.8.131.52) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8
On 03/16/2011 03:05 PM, Benjamin Herrenschmidt wrote:
On Wed, 2011-03-16 at 17:03 +0100, Alexander Graf wrote:
+int spapr_tce_dma_zero(VIOsPAPRDevice *dev, uint64_t taddr,
+ uint8_t *zeroes;
+ fprintf(stderr, "spapr_tce_dma_zero taddr=0x%llx size=0x%x\n",
+ (unsigned long long)taddr, size);
+ /* 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 ?
Yeah, the compiler can't do that. The return of alloca() is valid as
long as the stack frame is valid. Inlining doesn't change that.
Re: [Qemu-devel] [PATCH 21/26] Implement TCE translation for sPAPR VIO, Anthony Liguori, 2011/03/16
[Qemu-devel] [PATCH 18/26] Implement the PAPR (pSeries) virtualized interrupt controller (xics), David Gibson, 2011/03/16
Re: [Qemu-devel] [PATCH 18/26] Implement the PAPR (pSeries) virtualized interrupt controller (xics), Anthony Liguori, 2011/03/16