[Cbe-oss-dev] libspe2: RUN_USER_REGS without DEFAULT_ENTRY

Arnd Bergmann arnd at arndb.de
Mon Sep 8 20:04:31 EST 2008


On Monday 08 September 2008, David Mirabito wrote:

> So now I wonder:
>    1. Should perhaps the doc make this clearer, or am I just being a  
> little thick?

Not sure about whether the documentation or the implementation should
be changed, but the way you intend to do it is probably not the best
option, and the documentation should probably have some hint on how
to do it better.

>    2. Is the ability to jump to any PC at will and set r3-r5 a valid  
> use case in the first place?

I would say that it would be better to explicitly disallow this in
libspe, because running from the initial entry point has a significant
performance impact, so you should avoid doing that. To give you some
background, the hardware does not allow updating the registers on a
running SPU, so the kernel first needs to do an expensive context save
before you can access the registers, and then load the context again
in order to run it.

The model of calling spe_context_run() repeatedly with different given
entry points is fine. For optimum performance, you should pass the
arguments by writing them to an mmapped SPE local store address instead.

	Arnd <><



More information about the cbe-oss-dev mailing list