[PATCH 4/6] ARM: Do not call test_for_ipi or test_for_ltrirq on UP systems

Russell King - ARM Linux linux at arm.linux.org.uk
Sat Sep 4 06:55:01 EDT 2010


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




More information about the linux-arm-kernel mailing list