[Cbe-oss-dev] [RFC] spufs: use master control bit in spu_run

Arnd Bergmann arnd at arndb.de
Wed Nov 8 00:36:12 EST 2006


On Tuesday 07 November 2006 07:39, Jeremy Kerr wrote:
> OK, looks like the following change is the problem:
> 
> > @@ -316,12 +321,14 @@ out_drop_priv:
> >  
> >  out_unlock:
> >         spu_release_exclusive(ctx);
> > +out:
> > +       ctx->ops->master_stop(ctx);
> > +       up(&ctx->run_sema);
> >         return ret;
> >  }
> 
> We're now stopping the SPE before returning from spu_create. This means 
> that the SPE is stopped when we send it the address of the isolated 
> mode binary.

Ok, good that we found this. The SPE really _has_ to be stopped when we're
not in spu_run. It's a fundamental assumption we rely on in multiple places,
like debugging, profiling and event handling.

I believe the kernel would trivially oops if an SPU program generates any
interrupt (MFC page fault, mailbox, error) while there is no process
attached to it.

> systemsim tells me that the SPE is blocked on channel 29 (the inbound 
> mailbox). However, it also tells me that there are the necessary 3 
> messages sitting in the inbound mailbox (?!). Is there some issue with 
> sending mailbox messages to a stopped SPE?

It makes sense. When it is stopped externally, the instruction reading from
the mailbox channel won't complete.

> However, we won't have this problem if we do the isolated mode setup in 
> spu_run...

yes, that would be much better indeed.

	Arnd <><



More information about the cbe-oss-dev mailing list