Re: [PATCH 0/4] Hacks to allow booting ARM SMP kernel on UP ARMv7

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Russell King - ARM Linux <linux@xxxxxxxxxxxxxxxx> [100902 06:25]:
> On Thu, Aug 19, 2010 at 10:38:11AM +0300, Tony Lindgren wrote:
> > --- a/arch/arm/kernel/head.S
> > +++ b/arch/arm/kernel/head.S
> > @@ -346,8 +346,10 @@ __fixup_smp:
> >  	bne	smp_on_up		@ no, assume UP
> >  	mrc	p15, 0, r0, c0, c0, 5	@ read MIDR
> >  	movs	r0, r0, lsr #30
> > -	teqne	r0, #3			@ check top two bits 00 or 11
> > -	moveq	pc, lr
> > +	teq	r0, #0			@ check two top bits 00
> > +	beq	smp_on_up		@ yes, assume UP
> > +	teq	r0, #3			@ check top two bits 11
> > +	movne	pc, lr			@ no, running on SMP hw
> 
> This should be:
> 
> 	movs	r0, r0, lsr #30
> 	teqne	r0, #3
> 	movne	pc, lr
> 
> so that 0 or 3 avoids the return.

Actually should also handle value of 1:

31	30
0	0	Not using new register, assume not SMP
0	1	Not using new register, assume not SMP
1	0	Using new register, SMP
1	1	Using new register, UP

So we should return early only if it's 2.

Regards,

Tony
>From 22aaafd2659b95dc1434c5d6dbb7403329d51b90 Mon Sep 17 00:00:00 2001
From: Tony Lindgren <tony@xxxxxxxxxxx>
Date: Thu, 2 Sep 2010 17:51:42 -0700
Subject: [PATCH] Fix smp_on_up detection

This is needed to detect UP properly on older ARMv7 like Cortex-A8.

Signed-off-by: Tony Lindgren <tony@xxxxxxxxxxx>

diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 0b4a626..86aa36d 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -346,8 +346,8 @@ __fixup_smp:
 	bne	smp_on_up		@ no, assume UP
 	mrc	p15, 0, r0, c0, c0, 5	@ read MIDR
 	movs	r0, r0, lsr #30
-	teqne	r0, #3			@ check top two bits 00 or 11
-	movne	pc, lr
+	teq	r0, #2			@ check top two bits, 10 for SMP
+	moveq	pc, lr
 
 smp_on_up:
 	adr	r0, 1f

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux