linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/6] ARM: Do not call test_for_ipi or test_for_ltrirq on UP systems
@ 2010-09-02  3:40 Tony Lindgren
  0 siblings, 0 replies; 5+ messages in thread
From: Tony Lindgren @ 2010-09-02  3:40 UTC (permalink / raw)
  To: linux-arm-kernel

Do not call test_for_ipi or test_for_ltrirq on UP systems.

Note that we can't put test_for_ltriq into SMP statement as
it's inlined into the code and the remaining lines of the
macro would still run before UP macro line.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/kernel/entry-armv.S |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index bb2ef60..b8c1ec7 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -40,6 +40,11 @@
 	bne	asm_do_IRQ
 
 #ifdef CONFIG_SMP
+#ifdef CONFIG_SMP_ON_UP
+	adr	lr, BSYM(2f)	@ set lr to end of macro for early return
+	SMP(nop)		@ continue on SMP hardware
+	UP(mov	pc, lr)		@ return early on UP
+#endif
 	/*
 	 * XXX
 	 *
@@ -57,6 +62,7 @@
 	adrne	lr, BSYM(1b)
 	bne	do_local_timer
 #endif
+2:
 #endif
 
 	.endm
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/6] ARM: Do not call test_for_ipi or test_for_ltrirq on UP systems
  2010-09-02 16:16                 ` Tony Lindgren
@ 2010-09-02 16:21                   ` Tony Lindgren
  2010-09-03 12:00                     ` Shilimkar, Santosh
  2010-09-04 10:55                     ` Russell King - ARM Linux
  0 siblings, 2 replies; 5+ messages in thread
From: Tony Lindgren @ 2010-09-02 16:21 UTC (permalink / raw)
  To: linux-arm-kernel



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 4/6] ARM: Do not call test_for_ipi or test_for_ltrirq on UP systems
  2010-09-02 16:21                   ` [PATCH 4/6] ARM: Do not call test_for_ipi or test_for_ltrirq on UP systems Tony Lindgren
@ 2010-09-03 12:00                     ` Shilimkar, Santosh
  2010-09-04 10:55                       ` Russell King - ARM Linux
  2010-09-04 10:55                     ` Russell King - ARM Linux
  1 sibling, 1 reply; 5+ messages in thread
From: Shilimkar, Santosh @ 2010-09-03 12:00 UTC (permalink / raw)
  To: linux-arm-kernel

> -----Original Message-----
> From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-
> owner at vger.kernel.org] On Behalf Of Tony Lindgren
> Sent: Thursday, September 02, 2010 9:51 PM
> To: Russell King - ARM Linux
> Cc: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org;
> Bryan Wu; Will Deacon
> Subject: [PATCH 4/6] ARM: Do not call test_for_ipi or test_for_ltrirq on
> UP systems
> 
> From f80d3cc85327ba84748646bb44a0c45103ef66bc Mon Sep 17 00:00:00 2001
> From: Tony Lindgren <tony@atomide.com>
> Date: Wed, 1 Sep 2010 20:40:47 -0700
> Subject: [PATCH 4/6] ARM: Do not call test_for_ipi or test_for_ltrirq on
> UP systems
> 
> Do not call test_for_ipi or test_for_ltrirq on UP systems.
> 
> Note that we can't put test_for_ltriq into SMP statement as
> it's inlined into the code and the remaining lines of the
> macro would still run before UP macro line.
> 
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/kernel/entry-armv.S |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
> index bb2ef60..b8c1ec7 100644
> --- a/arch/arm/kernel/entry-armv.S
> +++ b/arch/arm/kernel/entry-armv.S
> @@ -40,6 +40,11 @@
>  	bne	asm_do_IRQ
> 
>  #ifdef CONFIG_SMP
Do we need this code to be under " CONFIG_SMP" now ?
> +#ifdef CONFIG_SMP_ON_UP
> +	adr	lr, BSYM(2f)	@ set lr to end of macro for early return
> +	SMP(nop)		@ continue on SMP hardware
> +	UP(mov	pc, lr)		@ return early on UP
> +#endif
>  	/*
>  	 * XXX
>  	 *
> @@ -57,6 +62,7 @@
>  	adrne	lr, BSYM(1b)
>  	bne	do_local_timer
>  #endif
> +2:
>  #endif
> 
>  	.endm
> --
> 1.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 4/6] ARM: Do not call test_for_ipi or test_for_ltrirq on UP systems
  2010-09-02 16:21                   ` [PATCH 4/6] ARM: Do not call test_for_ipi or test_for_ltrirq on UP systems Tony Lindgren
  2010-09-03 12:00                     ` Shilimkar, Santosh
@ 2010-09-04 10:55                     ` Russell King - ARM Linux
  1 sibling, 0 replies; 5+ messages in thread
From: Russell King - ARM Linux @ 2010-09-04 10:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 02, 2010 at 09:21:24AM -0700, Tony Lindgren wrote:
> Do not call test_for_ipi or test_for_ltrirq on UP systems.
> 
> Note that we can't put test_for_ltriq into SMP statement as
> it's inlined into the code and the remaining lines of the
> macro would still run before UP macro line.

I think we can do better than this - unfortunately the assembler gets
a little difficult (complaining about symbols in different sections),
but it's relatively easy to work-around by precomputing the offset
using .equ.  I'm debating about making this a UP_B(label) and hiding
these details beneath this macro, rather than having this kind of thing
exposed every time we need to do something like this.

diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index bb2ef60..947b3ab 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -46,7 +46,9 @@
 	 * this macro assumes that irqstat (r6) and base (r5) are
 	 * preserved from get_irqnr_and_base above
 	 */
-	test_for_ipi r0, r6, r5, lr
+	SMP(test_for_ipi r0, r6, r5, lr)
+	.equ	off, 9997f - 9998b
+	UP(b	. + off)
 	movne	r0, sp
 	adrne	lr, BSYM(1b)
 	bne	do_IPI
@@ -57,6 +59,7 @@
 	adrne	lr, BSYM(1b)
 	bne	do_local_timer
 #endif
+9997:
 #endif
 
 	.endm

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/6] ARM: Do not call test_for_ipi or test_for_ltrirq on UP systems
  2010-09-03 12:00                     ` Shilimkar, Santosh
@ 2010-09-04 10:55                       ` Russell King - ARM Linux
  0 siblings, 0 replies; 5+ messages in thread
From: Russell King - ARM Linux @ 2010-09-04 10:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Sep 03, 2010 at 05:30:57PM +0530, Shilimkar, Santosh wrote:
> > diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
> > index bb2ef60..b8c1ec7 100644
> > --- a/arch/arm/kernel/entry-armv.S
> > +++ b/arch/arm/kernel/entry-armv.S
> > @@ -40,6 +40,11 @@
> >  	bne	asm_do_IRQ
> > 
> >  #ifdef CONFIG_SMP
> Do we need this code to be under " CONFIG_SMP" now ?

Yes, otherwise we get link errors for things like do_IPI and do_local_timer.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-09-04 10:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-02  3:40 [PATCH 4/6] ARM: Do not call test_for_ipi or test_for_ltrirq on UP systems Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2010-08-17 14:12 [PATCH 0/4] Hacks to allow booting ARM SMP kernel on UP ARMv7 Tony Lindgren
2010-08-17 15:40 ` Russell King - ARM Linux
2010-08-19  7:38   ` Tony Lindgren
2010-08-19  9:38     ` Bryan Wu
2010-08-19  9:57       ` Tony Lindgren
2010-08-19 10:20         ` Russell King - ARM Linux
2010-08-20 12:06           ` Tony Lindgren
2010-08-30 22:55             ` Tony Lindgren
2010-09-02 13:36               ` Russell King - ARM Linux
2010-09-02 16:16                 ` Tony Lindgren
2010-09-02 16:21                   ` [PATCH 4/6] ARM: Do not call test_for_ipi or test_for_ltrirq on UP systems Tony Lindgren
2010-09-03 12:00                     ` Shilimkar, Santosh
2010-09-04 10:55                       ` Russell King - ARM Linux
2010-09-04 10:55                     ` Russell King - ARM Linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).