[PATCH] PPC64: Fix recent regression

Olof Johansson olof at lixom.net
Thu Sep 15 14:20:54 EST 2005


On Wed, Sep 14, 2005 at 09:16:57PM -0700, Linus Torvalds wrote:
> 
> Hmm.. The patch that you say broke things changed _two_ cases of
> 
> 	cmpldi  r3,PLATFORM_PSERIES_LPAR
> 
> to
> 
> 	andi.   r3,r3,PLATFORM_LPAR
> 
> (and changed one "andi. r3,r3,0x1" to use the symbolic form and also 
> become a "andi. r3,r3,PLATFORM_LPAR").
> 
> However, your patch only changes one of the two "bne"s to "beq" (and 
> added a comment for the case where we'd just turned 0x1 into the symbolic 
> helper value). Hmm?
> 
> I won't claim to understand the code, but it looks like there's one change 
> missing. Or maybe an explanation of why that ones polarity stays the same.

The reason is that the second change just changes the hard-coded 0x1 to
PLATFORM_LPAR, not the kind of comparison. It got me the first time too,
I changed both and couldn't understand why it still wouldn't boot.

i.e. cmpldi would give eq=1 if the comparison matched, but the andi. is
eq=1 if the result is 0.

That's why I added the /* eq=1... */ comments.


-Olof



More information about the Linuxppc64-dev mailing list