Subject: Re: [POWERPC] convert string i/o operations to C

From: Benjamin Herrenschmidt <[email-masked]>
Date: Wed, 20 Sep 2006 09:17:15 +1000

> But it couldn't hurt, right? There has to be an application note per-CPU 
> on the correct sequence of operations for such an access (I seem to have 
> collected a directory full for firmware development), it seems a little 
> odd to pick and choose one instruction over another for one thing, and 
> then say you need to do it to support the 601 of all things, and run 
> this code against the G3/G4/G5 which perhaps doesn't care or is more 
> intelligent about it (or is guaranteed to have a more intelligent host 
> bridge at least).
> 
> Maybe I'm talking crap, please say so :D

No, your basic idea is valid. One of the thing we are tackling doing is
to add to our cpu feature "nop'ing out" mecanism something closer to
what x86 does nowadays which is to have alternate sequence of
instructions depending on the CPU.

I just think however that the MMIO loads aren't a very high priority
spot for such an optimisation :) Spinlocks are more interesting and we
are looking into doing something like x86 where you don't need to build
a UP kernel, the SMP kernel will automatically replace the spinlocks
with simple preempt_disable/enable at boot if running on only one CPU.
We could do similar things with some barriers etc...

Ben.