Skip to contentSkip to conversation

Fix booting pre-ARM6 machines

PATCH New Uwe Kleine-König 3 participants 4 messages Sep 25, 2009 – Sep 26, 2009 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix booting pre-ARM6 machines

Commit 200b812d0084f800bc52465e273b118ff5f8141f includes the following hunk:

arch/arm/kernel/entry-header.S +7 -0
index a4eaf4f..e17e3c3 100644
@@ -76,13 +76,25 @@
 #ifndef CONFIG_THUMB2_KERNEL
 	.macro	svc_exit, rpsr
 	msr	spsr_cxsf, \rpsr
+#if defined(CONFIG_CPU_32v6K)
+	clrex					@ clear the exclusive monitor
 	ldmia	sp, {r0 - pc}^			@ load r0 - pc, cpsr
+#elif defined (CONFIG_CPU_V6)
+	ldr	r0, [sp]
+	strex	r1, r2, [sp]			@ clear the exclusive monitor
+	ldmib	sp, {r1 - pc}^			@ load r1 - pc, cpsr
+#endif
 	.endm
 
 	.macro	restore_user_regs, fast = 0, offset = 0
 

Having neither CONFIG_THUMB2_KERNEL nor CONFIG_CPU_32v6K nor CONFIG_CPU_V6 this steals the ldmia instruction. The result is that svc_exit doesn't work at all. So reintroduce it.

Cc Catalin Marinas <[email protected]>
Cc Jamie Lokier <[email protected]>
---
 arch/arm/kernel/entry-header.S |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/kernel/entry-header.S +2 -0
index e17e3c3..ac34c0d 100644
@@ -83,6 +83,8 @@
 	ldr	r0, [sp]
 	strex	r1, r2, [sp]			@ clear the exclusive monitor
 	ldmib	sp, {r1 - pc}^			@ load r1 - pc, cpsr
+#else
+	ldmia	sp, {r0 - pc}^			@ load r0 - pc, cpsr
 #endif
 	.endm
 
Signature · 1 line
1.6.4.3
#1 lore raw

PATCH 1/1 Fix booting pre-ARM6 machines

Quoted 13 lines · Uwe Kleine-K?nig

Commit 200b812d0084f800bc52465e273b118ff5f8141f includes the following hunk:

arch/arm/kernel/entry-header.S +2 -0
index a4eaf4f..e17e3c3 100644
@@ -76,13 +76,25 @@
 #ifndef CONFIG_THUMB2_KERNEL
 	.macro	svc_exit, rpsr
 	msr	spsr_cxsf, \rpsr
+#if defined(CONFIG_CPU_32v6K)
+	clrex					@ clear the exclusive monitor

arch/arm/kernel/entry-header.S line 90

Quoted 10 lines
arch/arm/kernel/entry-header.S +5 -0
 	ldmia	sp, {r0 - pc}^			@ load r0 - pc, cpsr
+#elif defined (CONFIG_CPU_V6)
+	ldr	r0, [sp]
+	strex	r1, r2, [sp]			@ clear the exclusive monitor
+	ldmib	sp, {r1 - pc}^			@ load r1 - pc, cpsr
+#endif
 	.endm
 
 	.macro	restore_user_regs, fast = 0, offset = 0
 

I've sent the same patch directly to Linus already in the hope that he'll merge it before -rc1.

Also you should avoid quoting patch hunks without indenting them or prefixing them with some quotation mark, otherwise the tools used to apply patches from emails will pick on that "diff" above as if it was the actual patch and discard everything that follows it.

Nicolas

#2 lore raw

PATCH 1/1 Fix booting pre-ARM6 machines

Hi Nicolas,

Quoted 2 lines

I've sent the same patch directly to Linus already in the hope that he'll merge it before -rc1.

OK.

Quoted 4 lines

Also you should avoid quoting patch hunks without indenting them or prefixing them with some quotation mark, otherwise the tools used to apply patches from emails will pick on that "diff" above as if it was the actual patch and discard everything that follows it.

ah, right. Thanks for the hint.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-K?nig            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
#3 lore raw

PATCH 1/1 Fix booting pre-ARM6 machines

In reply to Uwe Kleine-König
Quoted 9 lines · Uwe Kleine-K?nig

Commit 200b812d0084f800bc52465e273b118ff5f8141f includes the following hunk:

arch/arm/kernel/entry-header.S +0 -0
index a4eaf4f..e17e3c3 100644
@@ -76,13 +76,25 @@
 #ifndef CONFIG_THUMB2_KERNEL

arch/arm/kernel/entry-header.S line 86

Quoted 10 lines
arch/arm/kernel/entry-header.S +7 -0
 	.macro	svc_exit, rpsr
 	msr	spsr_cxsf, \rpsr
+#if defined(CONFIG_CPU_32v6K)
+	clrex					@ clear the exclusive monitor
 	ldmia	sp, {r0 - pc}^			@ load r0 - pc, cpsr
+#elif defined (CONFIG_CPU_V6)
+	ldr	r0, [sp]
+	strex	r1, r2, [sp]			@ clear the exclusive monitor
+	ldmib	sp, {r1 - pc}^			@ load r1 - pc, cpsr
+#endif

hmm, this really shouldn'y be selected at compile time as what if we have a kernel which supports V6 or later and pre-V6 in one image?

Quoted 36 lines
arch/arm/kernel/entry-header.S +0 -0
 	.endm
 
 	.macro	restore_user_regs, fast = 0, offset = 0
 

Having neither CONFIG_THUMB2_KERNEL nor CONFIG_CPU_32v6K nor CONFIG_CPU_V6 this steals the ldmia instruction. The result is that svc_exit doesn't work at all. So reintroduce it.

Cc Catalin Marinas <[email protected]>
Cc Jamie Lokier <[email protected]>
---
 arch/arm/kernel/entry-header.S |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/kernel/entry-header.S +2 -0
index e17e3c3..ac34c0d 100644
@@ -83,6 +83,8 @@
 	ldr	r0, [sp]
 	strex	r1, r2, [sp]			@ clear the exclusive monitor
 	ldmib	sp, {r1 - pc}^			@ load r1 - pc, cpsr
+#else
+	ldmia	sp, {r0 - pc}^			@ load r0 - pc, cpsr
 #endif
 	.endm
 
Signature · 7 lines
1.6.4.3


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.