[PATCH] PPC64: Fix recent regression

Linus Torvalds torvalds at osdl.org
Thu Sep 15 14:16:57 EST 2005


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.

		Linus

On Wed, 14 Sep 2005, Olof Johansson wrote:
> 
> Please consider for 2.6.14, it broke between 2.6.13 and 2.6.14-rc1:
> 
> A recent patch changed the way the LPAR bit is checked during early
> boot. This resulted in a polarity change in a conditional branch without
> changing the branch, causing at least some legacy machines to not boot.
> 
> 
> Signed-off-by: Olof Johansson <olof at lixom.net>
> 
> Index: 2.6/arch/ppc64/kernel/head.S
> ===================================================================
> --- 2.6.orig/arch/ppc64/kernel/head.S	2005-09-14 22:01:44.000000000 -0500
> +++ 2.6/arch/ppc64/kernel/head.S	2005-09-14 22:46:05.000000000 -0500
> @@ -1813,7 +1813,7 @@ _STATIC(start_here_multiplatform)
>  	ld	r3,0(r3)
>  	lwz	r3,PLATFORM(r3)		/* r3 = platform flags */
>  	andi.	r3,r3,PLATFORM_LPAR	/* Test if bit 0 is set (LPAR bit) */
> -	bne	98f
> +	beq	98f			/* eq=1 if result is 0 */
>  	mfspr	r3,PVR
>  	srwi	r3,r3,16
>  	cmpwi	r3,0x37			/* SStar */
> @@ -1834,7 +1834,7 @@ _STATIC(start_here_multiplatform)
>  	lwz	r3,PLATFORM(r3)		/* r3 = platform flags */
>  	/* Test if bit 0 is set (LPAR bit) */
>  	andi.	r3,r3,PLATFORM_LPAR
> -	bne	98f
> +	bne	98f			/* eq=1 if result is 0 */
>  	LOADADDR(r6,_SDR1)		/* Only if NOT LPAR */
>  	sub	r6,r6,r26
>  	ld	r6,0(r6)		/* get the value of _SDR1 */
> 



More information about the Linuxppc64-dev mailing list