From: Catalin Marinas <catalin.marinas@arm.com> To: Russell King - ARM Linux <linux@arm.linux.org.uk> Cc: Tony Lindgren <tony@atomide.com>, linux-omap@vger.kernel.org, Will Deacon <will.deacon@arm.com>, linux-arm-kernel@lists.infradead.org, Bryan Wu <bryan.wu@canonical.com> Subject: Re: [PATCH 3/6] ARM: Fix v7wbi_tlb_flags for SMP on UP Date: Mon, 06 Sep 2010 12:46:34 +0100 [thread overview] Message-ID: <1283773594.11660.10.camel@e102109-lin.cambridge.arm.com> (raw) In-Reply-To: <20100903091029.GK26319@n2100.arm.linux.org.uk> Russell, I can see you posted another version while writing this e-mail. But I think most comments still apply. On Fri, 2010-09-03 at 10:10 +0100, Russell King - ARM Linux wrote: > diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h > index 6e8f05c..55974d2 100644 > --- a/arch/arm/include/asm/assembler.h > +++ b/arch/arm/include/asm/assembler.h > @@ -154,16 +154,32 @@ > .long 9999b,9001f; \ > .popsection > > +#ifdef CONFIG_SMP > +#define SMP(instr...) \ > +9998: instr > +#define UP(instr...) \ > + .pushsection ".smpalt.init", "a" ;\ > + .word 9998b ;\ > + instr ;\ > + .popsection > +#else > +#define SMP(instr...) > +#define UP(instr...) instr > +#endif Would this work with Thumb-2 kernel builds? Maybe you can add a W(instr) in the SMP/UP macros to make sure that the instruction is always 32-bit wide. > diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S > index bb8e93a..bb2ef60 100644 > --- a/arch/arm/kernel/entry-armv.S > +++ b/arch/arm/kernel/entry-armv.S > @@ -965,11 +965,8 @@ kuser_cmpxchg_fixup: > beq 1b > rsbs r0, r3, #0 > /* beware -- each __kuser slot must be 8 instructions max */ > -#ifdef CONFIG_SMP > - b __kuser_memory_barrier > -#else > - usr_ret lr > -#endif > + SMP(b __kuser_memory_barrier) > + UP(usr_ret lr) Ah, the automatic W() I mentioned above wouldn't work for macros. > @@ -333,4 +336,35 @@ __create_page_tables: > ENDPROC(__create_page_tables) > .ltorg > > +#ifdef CONFIG_SMP_ON_UP > +__fixup_smp: > + and r0, r9, #0xff000000 > + teq r0, #0x41000000 @ ARM CPU? > + bne smp_on_up @ no, assume UP That's a bit restricting but I'm not sure we have a better way. If we have the new CPUID format (MIDR[19:16] = 0xf), we can check MMFR0[31:28] for 1 which means "implemented with hardware coherency support". > + and r0, r9, #0x00070000 > + teq r0, #0x00070000 @ ARMv6/v7? > + bne smp_on_up @ no, assume UP > + mrc p15, 0, r0, c0, c0, 5 @ read MIDR Typo in comment - MPIDR. I think this applies to the smp_midr.h file. Should we call it smp_mpidr.h or just mpidr.h? > + movs r0, r0, lsr #30 > + teqne r0, #3 @ check top two bits 00 or 11 > + movne pc, lr > + > +smp_on_up: > + adr r0, 1f > + ldmia r0, {r3, r6, r7} > + sub r3, r0, r3 > + add r6, r6, r3 > + add r7, r7, r3 > +2: cmp r6, r7 > + ldmia r6!, {r0, r4} > + movhs pc, lr > + str r4, [r0, r3] > + b 2b > +ENDPROC(__fixup_smp) > + > +1: .word . > + .word __smpalt_begin > + .word __smpalt_end I think a '.align 2' would be useful as Thumb-2 code may break the alignment of 1f. -- Catalin
WARNING: multiple messages have this Message-ID (diff)
From: catalin.marinas@arm.com (Catalin Marinas) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/6] ARM: Fix v7wbi_tlb_flags for SMP on UP Date: Mon, 06 Sep 2010 12:46:34 +0100 [thread overview] Message-ID: <1283773594.11660.10.camel@e102109-lin.cambridge.arm.com> (raw) In-Reply-To: <20100903091029.GK26319@n2100.arm.linux.org.uk> Russell, I can see you posted another version while writing this e-mail. But I think most comments still apply. On Fri, 2010-09-03 at 10:10 +0100, Russell King - ARM Linux wrote: > diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h > index 6e8f05c..55974d2 100644 > --- a/arch/arm/include/asm/assembler.h > +++ b/arch/arm/include/asm/assembler.h > @@ -154,16 +154,32 @@ > .long 9999b,9001f; \ > .popsection > > +#ifdef CONFIG_SMP > +#define SMP(instr...) \ > +9998: instr > +#define UP(instr...) \ > + .pushsection ".smpalt.init", "a" ;\ > + .word 9998b ;\ > + instr ;\ > + .popsection > +#else > +#define SMP(instr...) > +#define UP(instr...) instr > +#endif Would this work with Thumb-2 kernel builds? Maybe you can add a W(instr) in the SMP/UP macros to make sure that the instruction is always 32-bit wide. > diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S > index bb8e93a..bb2ef60 100644 > --- a/arch/arm/kernel/entry-armv.S > +++ b/arch/arm/kernel/entry-armv.S > @@ -965,11 +965,8 @@ kuser_cmpxchg_fixup: > beq 1b > rsbs r0, r3, #0 > /* beware -- each __kuser slot must be 8 instructions max */ > -#ifdef CONFIG_SMP > - b __kuser_memory_barrier > -#else > - usr_ret lr > -#endif > + SMP(b __kuser_memory_barrier) > + UP(usr_ret lr) Ah, the automatic W() I mentioned above wouldn't work for macros. > @@ -333,4 +336,35 @@ __create_page_tables: > ENDPROC(__create_page_tables) > .ltorg > > +#ifdef CONFIG_SMP_ON_UP > +__fixup_smp: > + and r0, r9, #0xff000000 > + teq r0, #0x41000000 @ ARM CPU? > + bne smp_on_up @ no, assume UP That's a bit restricting but I'm not sure we have a better way. If we have the new CPUID format (MIDR[19:16] = 0xf), we can check MMFR0[31:28] for 1 which means "implemented with hardware coherency support". > + and r0, r9, #0x00070000 > + teq r0, #0x00070000 @ ARMv6/v7? > + bne smp_on_up @ no, assume UP > + mrc p15, 0, r0, c0, c0, 5 @ read MIDR Typo in comment - MPIDR. I think this applies to the smp_midr.h file. Should we call it smp_mpidr.h or just mpidr.h? > + movs r0, r0, lsr #30 > + teqne r0, #3 @ check top two bits 00 or 11 > + movne pc, lr > + > +smp_on_up: > + adr r0, 1f > + ldmia r0, {r3, r6, r7} > + sub r3, r0, r3 > + add r6, r6, r3 > + add r7, r7, r3 > +2: cmp r6, r7 > + ldmia r6!, {r0, r4} > + movhs pc, lr > + str r4, [r0, r3] > + b 2b > +ENDPROC(__fixup_smp) > + > +1: .word . > + .word __smpalt_begin > + .word __smpalt_end I think a '.align 2' would be useful as Thumb-2 code may break the alignment of 1f. -- Catalin
next prev parent reply other threads:[~2010-09-06 11:46 UTC|newest] Thread overview: 231+ messages / expand[flat|nested] mbox.gz Atom feed top 2010-08-17 10:53 [PATCH 0/4] Hacks to allow booting ARM SMP kernel on UP ARMv7 Tony Lindgren 2010-08-17 10:53 ` Tony Lindgren 2010-08-17 10:53 ` [PATCH 1/4] ARM: Add SMP_ON_UP Kconfig option for booting SMP kernel on UP Tony Lindgren 2010-08-17 10:53 ` Tony Lindgren 2010-08-17 10:53 ` [PATCH 2/4] ARM: Allow optional UP processor functions for SMP kernels Tony Lindgren 2010-08-17 10:53 ` Tony Lindgren 2010-08-17 11:08 ` Russell King - ARM Linux 2010-08-17 11:08 ` Russell King - ARM Linux 2010-08-17 11:20 ` Tony Lindgren 2010-08-17 11:20 ` Tony Lindgren 2010-08-17 10:53 ` [PATCH 3/4] ARM: Set separate proc-v7 functions for SMP Tony Lindgren 2010-08-17 10:53 ` Tony Lindgren 2010-08-17 10:53 ` [PATCH 4/4] omap: Fix SMP on UP interrupt handling for multi-omap Tony Lindgren 2010-08-17 10:53 ` Tony Lindgren 2010-08-17 11:07 ` srinidhi 2010-08-17 11:07 ` srinidhi 2010-08-17 11:30 ` Tony Lindgren 2010-08-17 11:30 ` Tony Lindgren 2010-08-17 12:14 ` srinidhi 2010-08-17 12:14 ` srinidhi 2010-08-17 14:14 ` Tony Lindgren 2010-08-17 14:14 ` Tony Lindgren 2010-08-17 15:07 ` Shilimkar, Santosh 2010-08-17 15:07 ` Shilimkar, Santosh 2010-09-02 16:27 ` Tony Lindgren 2010-09-02 16:27 ` Tony Lindgren 2010-08-17 13:52 ` [PATCH 0/4] Hacks to allow booting ARM SMP kernel on UP ARMv7 Russell King - ARM Linux 2010-08-17 13:52 ` Russell King - ARM Linux 2010-08-17 14:12 ` Tony Lindgren 2010-08-17 14:12 ` Tony Lindgren 2010-08-17 15:40 ` Russell King - ARM Linux 2010-08-17 15:40 ` Russell King - ARM Linux 2010-08-19 7:38 ` Tony Lindgren 2010-08-19 7:38 ` Tony Lindgren 2010-08-19 9:38 ` Bryan Wu 2010-08-19 9:38 ` Bryan Wu 2010-08-19 9:57 ` Tony Lindgren 2010-08-19 9:57 ` Tony Lindgren 2010-08-19 10:20 ` Russell King - ARM Linux 2010-08-19 10:20 ` Russell King - ARM Linux 2010-08-20 12:06 ` Tony Lindgren 2010-08-20 12:06 ` Tony Lindgren 2010-08-30 22:55 ` Tony Lindgren 2010-08-30 22:55 ` Tony Lindgren 2010-09-02 13:36 ` Russell King - ARM Linux 2010-09-02 13:36 ` Russell King - ARM Linux 2010-09-02 16:16 ` Tony Lindgren 2010-09-02 16:16 ` Tony Lindgren 2010-09-02 16:18 ` [PATCH 1/6] ARM: Add inline function smp_on_up() for early init testing Tony Lindgren 2010-09-02 16:18 ` Tony Lindgren 2010-09-02 17:08 ` Russell King - ARM Linux 2010-09-02 17:08 ` Russell King - ARM Linux 2010-09-02 17:15 ` [PATCH 0/6] " Tony Lindgren 2010-09-02 17:15 ` Tony Lindgren 2010-09-02 17:42 ` [PATCH 1/6] " Tony Lindgren 2010-09-02 17:42 ` Tony Lindgren 2010-09-02 19:26 ` [PATCH 1/6] ARM: Add inline function smp_cpu() " Tony Lindgren 2010-09-02 19:26 ` Tony Lindgren 2010-09-03 0:08 ` Tony Lindgren 2010-09-03 0:08 ` Tony Lindgren 2010-09-03 2:22 ` Tony Lindgren 2010-09-03 2:22 ` Tony Lindgren 2010-09-03 8:58 ` Will Deacon 2010-09-03 9:02 ` Russell King - ARM Linux 2010-09-03 9:02 ` Russell King - ARM Linux 2010-09-03 9:07 ` Will Deacon 2010-09-03 9:07 ` Will Deacon 2010-09-03 8:58 ` Will Deacon 2010-09-03 12:12 ` Shilimkar, Santosh 2010-09-03 12:12 ` Shilimkar, Santosh 2010-09-03 12:23 ` Will Deacon 2010-09-03 12:23 ` Will Deacon 2010-09-03 12:31 ` Shilimkar, Santosh 2010-09-03 12:31 ` Shilimkar, Santosh 2010-09-05 1:53 ` Michał Nazarewicz 2010-09-05 1:53 ` Michał Nazarewicz 2010-09-03 12:09 ` [PATCH 1/6] ARM: Add inline function smp_on_up() " Shilimkar, Santosh 2010-09-03 12:09 ` Shilimkar, Santosh 2010-09-06 10:17 ` Bryan Wu 2010-09-06 10:17 ` Bryan Wu 2010-09-08 3:26 ` Tony Lindgren 2010-09-08 3:26 ` Tony Lindgren 2010-09-08 20:26 ` Tony Lindgren 2010-09-08 20:26 ` Tony Lindgren 2010-09-09 3:45 ` Bryan Wu 2010-09-09 3:45 ` Bryan Wu 2010-09-02 16:19 ` [PATCH 2/6] ARM: Use SMP and UP macros for cacheflush Tony Lindgren 2010-09-02 16:19 ` Tony Lindgren 2010-09-03 11:57 ` Shilimkar, Santosh 2010-09-03 11:57 ` Shilimkar, Santosh 2010-09-04 10:57 ` Russell King - ARM Linux 2010-09-04 10:57 ` Russell King - ARM Linux 2010-09-04 11:01 ` Shilimkar, Santosh 2010-09-04 11:01 ` Shilimkar, Santosh 2010-09-02 16:20 ` [PATCH 3/6] ARM: Fix v7wbi_tlb_flags for SMP on UP Tony Lindgren 2010-09-02 16:20 ` Tony Lindgren 2010-09-02 16:25 ` Russell King - ARM Linux 2010-09-02 16:25 ` Russell King - ARM Linux 2010-09-02 16:34 ` Tony Lindgren 2010-09-02 16:34 ` Tony Lindgren 2010-09-02 23:47 ` Tony Lindgren 2010-09-02 23:47 ` Tony Lindgren 2010-09-03 9:07 ` Russell King - ARM Linux 2010-09-03 9:07 ` Russell King - ARM Linux 2010-09-03 9:10 ` Russell King - ARM Linux 2010-09-03 9:10 ` Russell King - ARM Linux 2010-09-03 17:04 ` Tony Lindgren 2010-09-03 17:04 ` Tony Lindgren 2010-09-03 19:36 ` Russell King - ARM Linux 2010-09-03 19:36 ` Russell King - ARM Linux 2010-09-06 11:46 ` Catalin Marinas [this message] 2010-09-06 11:46 ` Catalin Marinas 2010-09-06 15:34 ` Russell King - ARM Linux 2010-09-06 15:34 ` Russell King - ARM Linux 2010-09-06 15:53 ` Catalin Marinas 2010-09-06 15:53 ` Catalin Marinas 2010-09-06 16:36 ` Russell King - ARM Linux 2010-09-06 16:36 ` Russell King - ARM Linux 2010-09-06 17:11 ` Catalin Marinas 2010-09-06 17:11 ` Catalin Marinas 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-02 16:21 ` Tony Lindgren 2010-09-03 12:00 ` Shilimkar, Santosh 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 2010-09-04 10:55 ` Russell King - ARM Linux 2010-09-04 10:55 ` Russell King - ARM Linux 2010-09-02 16:22 ` [PATCH 5/6] ARM: Don't set TLB ops broadcasting on UP ARMv7 Tony Lindgren 2010-09-02 16:22 ` Tony Lindgren 2010-09-02 16:57 ` Russell King - ARM Linux 2010-09-02 16:57 ` Russell King - ARM Linux 2010-09-02 17:21 ` Tony Lindgren 2010-09-02 17:21 ` Tony Lindgren 2010-09-02 18:01 ` Russell King - ARM Linux 2010-09-02 18:01 ` Russell King - ARM Linux 2010-09-02 18:13 ` Tony Lindgren 2010-09-02 18:13 ` Tony Lindgren 2010-09-02 18:18 ` Russell King - ARM Linux 2010-09-02 18:18 ` Russell King - ARM Linux 2010-09-02 16:23 ` [PATCH 6/6] omap: Fix SMP on UP interrupt handling for multi-omap Tony Lindgren 2010-09-02 16:23 ` Tony Lindgren 2010-09-02 19:30 ` Tony Lindgren 2010-09-02 19:30 ` Tony Lindgren 2010-09-03 12:15 ` Shilimkar, Santosh 2010-09-03 12:15 ` Shilimkar, Santosh 2010-09-08 3:30 ` Tony Lindgren 2010-09-08 3:30 ` Tony Lindgren 2010-09-03 12:06 ` Shilimkar, Santosh 2010-09-03 12:06 ` Shilimkar, Santosh 2010-09-04 11:05 ` Russell King - ARM Linux 2010-09-04 11:05 ` Russell King - ARM Linux 2010-09-04 11:22 ` Shilimkar, Santosh 2010-09-04 11:22 ` Shilimkar, Santosh 2010-09-03 4:20 ` [PATCH 0/4] Hacks to allow booting ARM SMP kernel on UP ARMv7 Bryan Wu 2010-09-03 4:20 ` Bryan Wu 2010-09-03 7:46 ` Russell King - ARM Linux 2010-09-03 7:46 ` Russell King - ARM Linux 2010-09-06 9:28 ` Catalin Marinas 2010-09-06 9:28 ` Catalin Marinas 2010-09-06 9:34 ` Russell King - ARM Linux 2010-09-06 9:34 ` Russell King - ARM Linux 2010-09-06 9:38 ` Catalin Marinas 2010-09-06 9:38 ` Catalin Marinas 2010-09-06 10:06 ` Russell King - ARM Linux 2010-09-06 10:06 ` Russell King - ARM Linux 2010-09-06 10:39 ` Catalin Marinas 2010-09-06 10:39 ` Catalin Marinas 2010-09-02 13:33 ` Russell King - ARM Linux 2010-09-02 13:33 ` Russell King - ARM Linux 2010-09-03 1:39 ` Tony Lindgren 2010-09-03 1:39 ` Tony Lindgren 2010-08-23 16:59 ` Will Deacon 2010-08-23 16:59 ` Will Deacon 2010-08-30 22:53 ` Tony Lindgren 2010-08-30 22:53 ` Tony Lindgren 2010-09-06 10:44 ` Russell King - ARM Linux 2010-09-06 10:44 ` Russell King - ARM Linux 2010-09-06 15:16 ` Catalin Marinas 2010-09-06 15:16 ` Catalin Marinas 2010-09-06 18:03 ` Tony Lindgren 2010-09-06 18:03 ` Tony Lindgren 2010-09-08 3:09 ` Tony Lindgren 2010-09-08 3:09 ` Tony Lindgren 2010-09-08 3:12 ` [PATCH] ARM: Check for is_smp for tlb_ops and cache_ops boardcast Tony Lindgren 2010-09-08 3:12 ` Tony Lindgren 2010-09-08 3:14 ` [PATCH] ARM: Don't try to send IPI on UP systems with CONFIG_SMP Tony Lindgren 2010-09-08 3:14 ` Tony Lindgren 2010-09-08 3:17 ` [PATCH] omap: Fix CONFIG_LOCAL_TIMERS initialization for multi-omap Tony Lindgren 2010-09-08 3:17 ` Tony Lindgren 2010-09-08 7:26 ` Shilimkar, Santosh 2010-09-08 7:26 ` Shilimkar, Santosh 2010-09-08 7:30 ` [PATCH] ARM: Don't try to send IPI on UP systems with CONFIG_SMP Shilimkar, Santosh 2010-09-08 7:30 ` Shilimkar, Santosh 2010-09-08 8:56 ` Russell King - ARM Linux 2010-09-08 8:56 ` Russell King - ARM Linux 2010-09-08 19:32 ` Tony Lindgren 2010-09-08 19:32 ` Tony Lindgren 2010-10-05 22:19 ` [PATCH] ARM: Check for is_smp for tlb_ops and cache_ops boardcast Tony Lindgren 2010-10-05 22:19 ` Tony Lindgren 2010-10-05 22:33 ` Russell King - ARM Linux 2010-10-05 22:33 ` Russell King - ARM Linux 2010-10-06 14:44 ` Tony Lindgren 2010-10-06 14:44 ` Tony Lindgren 2010-10-06 22:33 ` Russell King - ARM Linux 2010-10-06 22:33 ` Russell King - ARM Linux 2010-10-06 23:07 ` Tony Lindgren 2010-10-06 23:07 ` Tony Lindgren 2010-09-14 18:59 ` [PATCH] ARM: Handle __flush_icache_all for CONFIG_SMP_ON_UP Tony Lindgren 2010-09-14 18:59 ` Tony Lindgren 2010-09-14 19:03 ` [PATCH] omap: Update omap3_defconfig to work with SMP_ON_UP Tony Lindgren 2010-09-14 19:03 ` Tony Lindgren 2010-09-14 19:05 ` [PATCH] omap: Update omap3_defconfig for omap2 Tony Lindgren 2010-09-14 19:05 ` Tony Lindgren 2010-09-14 19:17 ` [PATCH] omap: Update omap3_defconfig to work with SMP_ON_UP Shilimkar, Santosh 2010-09-14 19:17 ` Shilimkar, Santosh 2010-09-14 20:27 ` Tony Lindgren 2010-09-14 20:27 ` Tony Lindgren 2010-09-15 6:11 ` Shilimkar, Santosh 2010-09-15 6:11 ` Shilimkar, Santosh 2010-09-15 16:11 ` Tony Lindgren 2010-09-15 16:11 ` Tony Lindgren 2010-09-15 18:25 ` Shilimkar, Santosh 2010-09-15 18:25 ` Shilimkar, Santosh 2010-09-15 23:15 ` Tony Lindgren 2010-09-15 23:15 ` Tony Lindgren 2010-09-16 17:05 ` [PATCH] ARM: Handle __flush_icache_all for CONFIG_SMP_ON_UP Catalin Marinas 2010-09-16 17:05 ` Catalin Marinas 2010-09-21 16:16 ` Tony Lindgren 2010-09-21 16:16 ` Tony Lindgren 2010-09-01 23:49 [PATCH 3/6] ARM: Fix v7wbi_tlb_flags for SMP on UP Tony Lindgren
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1283773594.11660.10.camel@e102109-lin.cambridge.arm.com \ --to=catalin.marinas@arm.com \ --cc=bryan.wu@canonical.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-omap@vger.kernel.org \ --cc=linux@arm.linux.org.uk \ --cc=tony@atomide.com \ --cc=will.deacon@arm.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.