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

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

On Tue, 2006-09-19 at 20:58 +0200, Matt Sealey wrote:
> Shouldn't this stuff be optimized out depending on what processor you're 
> ACTUALLY running?
> 
> 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
> (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?

The architecture is precise enough there. It should be twi,isync. The
goal of the isync is to make sure no subsequent instruction can execute
until the previous conditional branch has been fully resolved, which
implies loading the dependent data. An isync is the only instruction in
this specific case that is guaranteed to provide what we need by the
architecture.

Ben