qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 21/26] Implement TCE translation for sPAPR VIO


From: Benjamin Herrenschmidt
Subject: [Qemu-devel] Re: [PATCH 21/26] Implement TCE translation for sPAPR VIO
Date: Thu, 17 Mar 2011 07:05:19 +1100

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]