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

From: Matt Sealey <[email-masked]>
Date: Tue, 19 Sep 2006 21:20:36 +0200

Segher Boessenkool wrote:
>> For a generic "powerpc" kernel it can be understood, but when you
>> consider that on 970/POWER4 and above they use lwsync instead of sync
> 
> lwsync (sync 1) doesn't (architecturally) do anything to order MMIO
> accesses, so you're misunderstanding something.

See below :D

>> (google for them and see the mailing list posts :), just to breathe back
>> some performance in spinlocks and so on, surely this can be rejigged so
>> that processors don't do more work than necessary..? Even a noop takes
>> time doesn't it?
> 
> No-ops don't matter for performance, compared to the cost of the I/O
> itself.  It would help to avoid heavier-than-necessary synchronisation
> instructions if not needed on some certain CPU (or on non-SMP kernels,
> etc.)

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

-- 
Matt Sealey <[email-masked]>
Genesi, Manager, Developer Relations