[PATCH] ARM: errata: Remove SMP dependency for erratum 751472

Dave Martin dave.martin at linaro.org
Tue Nov 29 13:06:18 EST 2011


On Tue, Nov 29, 2011 at 05:35:37PM +0000, Russell King - ARM Linux wrote:
> On Tue, Nov 29, 2011 at 05:12:43PM +0000, Dave Martin wrote:
> > -	cmp	r6, #0x30			@ present prior to r3p0
> > +	ALT_UP_B(1f)
> > +	ALT_SMP(cmp r6, #0x30)			@ present prior to r3p0
> 
> Why not look at the definition of these before you (ab)use them?

Sorry -- I did look, but it looks like I confused myself afterwards, because
of the way the instruction to skip the SMP block has to be inserted in
between the first and second instructions of the block being skipped,
rather than at the start (as would happen in a conditional branch).

Do you have any concerns about that other than the ALT_SMP/UP being the
wrong way around?


One thing which strikes me about ALT_UP_B() is that the likely use is
to skip over the SMP case code (which may consist of many instructions).
This means that if the SMP code is not there at all (as in a UP kernel)
no branch is necessary.  But the definition is more conservative, so
that we're left with a branch jumping to the next instruction even in a
UP kernel.  The effect is that we really can branch to anywhere with
ALT_UP_B() -- a potentially useful feature, but one which we don't
currently appear to make use of.

An alternative would be for the ALT_UP_B() actually to disappear in a
UP kernel.  So far as I can see, such an implementation would be
compatible with all existing uses of this macro.  What do you think?

Cheers
---Dave



More information about the linux-arm-kernel mailing list