[Cbe-oss-dev] [off topic] Debugging advice

Arnd Bergmann arnd at arndb.de
Thu Jul 31 17:32:27 EST 2008


On Wednesday 30 July 2008, Mads Alhof Kristiansen wrote:
> The bug causes a dma-transfer of size 0xb80 (~ 2.9Kb) initiated by the
> PPC to place SPU-code from address 0x0. It does not halt the SPE so
> things first goes wrong when I start to execute (the now overwritten)
> code from address 0x80 to 0xb80. I can only reproduce the bug when I
> do a specific number of calls to printf.

Note that during a PPU-assist call like printf, the thread that normally
runs on the SPU will execute code on the PPU. At this point, it is not
able to handle page faults for your DMA request. Normally, it should
resume the DMA fault handling once it gets back to the PPU, but there
may be a bug in that, because PPU proxy DMA is rarely used and therefore
not well tested.

In most cases, it's faster to load the data from the PPU into the
local store using memcpy instead of proxy DMA.

BTW, if you do not want to use the ELF loader or PPU assist calls
and do not expect your program to be portable across operating systems,
you may want to write it to the low-level system calls instead of libspe2,
as that will give you more flexibility in your code.

	Arnd <><




More information about the cbe-oss-dev mailing list