Skip to contentSkip to conversation

sparc32 broke

DISCUSSION Robert Reif 3 participants 9 messages Jan 9, 2009 – Jan 11, 2009 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

A compile of todays mainline produces this compile error:

arch/sparc/kernel/sun4d_smp.c:63: error: expected identifier or ‘(’ before ‘{’ token
arch/sparc/kernel/sun4d_smp.c: In function ‘smp4d_callin’:
arch/sparc/kernel/sun4d_smp.c:118: error: lvalue required as left operand of assignment
arch/sparc/kernel/sun4d_smp.c:118: error: lvalue required as left operand of assignment

Prior to today, sparc32 has also failed to boot completely for the last few days.
It boots but fails in the init scripts when it can't find the boot partition.

Ill try to bisect the boot problem but it will take a while.

maintainer
#1 lore raw

From: Robert Reif <[email protected]>
Date: Thu, 08 Jan 2009 19:32:21 -0500

Quoted 6 lines

A compile of todays mainline produces this compile error:

arch/sparc/kernel/sun4d_smp.c:63: error: expected identifier or ‘(’ before ‘{’ token arch/sparc/kernel/sun4d_smp.c: In function ‘smp4d_callin’:
arch/sparc/kernel/sun4d_smp.c:118: error: lvalue required as left operand of assignment arch/sparc/kernel/sun4d_smp.c:118: error: lvalue required as left operand of assignment

Thanks for the report, I've committed the fix below to sparc-2.6

Quoted 4 lines

Prior to today, sparc32 has also failed to boot completely for the last few days. It boots but fails in the init scripts when it can't find the boot partition.

Ill try to bisect the boot problem but it will take a while.

Thanks, let us know if you need any help figuring something out.

sparc: Fix sun4d_irq.c build.

Reported by Robert Reif.

Fallout from 'swap' changes.

---
 arch/sparc/kernel/sun4d_smp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/sparc/kernel/sun4d_smp.c +2 -2
index 16ab0cb..50afaed 100644
@@ -60,7 +60,7 @@ extern int __smp4d_processor_id(void);
 #define SMP_PRINTK(x)
 #endif
 
-static inline unsigned long swap(volatile unsigned long *ptr, unsigned long val)
+static inline unsigned long sun4d_swap(volatile unsigned long *ptr, unsigned long val)
 {
 	__asm__ __volatile__("swap [%1], %0\n\t" :
 			     "=&r" (val), "=&r" (ptr) :
@@ -115,7 +115,7 @@ void __cpuinit smp4d_callin(void)
 	local_flush_tlb_all();
 
 	/* Allow master to continue. */
-	swap((unsigned long *)&cpu_callin_map[cpuid], 1);
+	sun4d_swap((unsigned long *)&cpu_callin_map[cpuid], 1);
 	local_flush_cache_all();
 	local_flush_tlb_all();
 	
Signature · 3 lines
1.6.1.15.g159c88

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ¥Šwÿº{.nÇ+‰·¬¥ªÜ–)îÇø§¶›¡Ü¨}©ž²Æ zÚ&j:+v‰¨þø¯ù®w¥þŠà2ŠÞ™¨è­Ú&¢)ß¡«a¶Úÿÿûàz¿äz¹Þ—ú+ƒùšŽŠÝ¢jÿŠwèþf
#2 lore raw
In reply to Robert Reif
Quoted 6 lines · Robert Reif

Prior to today, sparc32 has also failed to boot completely for the last few days.
It boots but fails in the init scripts when it can't find the boot partition.

Ill try to bisect the boot problem but it will take a while.

I bisected it down to: ece93487c31607558f4b91f378fcee4b43956dbc sparc:
unify signal.h

maintainer
#3 lore raw
In reply to Robert Reif

From: Robert Reif <[email protected]>
Date: Fri, 09 Jan 2009 23:19:19 -0500

Quoted 2 lines

I bisected it down to: ece93487c31607558f4b91f378fcee4b43956dbc
sparc: unify signal.h

Sam, the first thing I notice is that _NSIG_BPW changed.

It's supposed to be 32 for sparc32 and 64 for sparc64. But now it's unconditionally 64 in the unified header. This also makes _NSIG_WORDS et al. wrong.

Robert, does this fix the bug for you?

sparc: Fix asm/signal.h for 32-bit.

Fix a 32-bit sparc regression reported by Robert Reif.

_NSIG_BPW needs to be 32 for 32-bit and 64 for 64-bit

arch/sparc/include/asm/signal.h +1 -1
index 41535e7..047fbd0 100644
@@ -84,7 +84,7 @@
 
 #define __OLD_NSIG	32
 #define __NEW_NSIG      64
-#define _NSIG_BPW       64
+#define _NSIG_BPW       CONFIG_BITS
 #define _NSIG_WORDS     (__NEW_NSIG / _NSIG_BPW)
 
 #define SIGRTMIN       32
#4 lore raw
In reply to Robert Reif
Quoted 11 lines · David Miller

From: Robert Reif <[email protected]>
Date: Fri, 09 Jan 2009 23:19:19 -0500

Quoted 2 lines

I bisected it down to: ece93487c31607558f4b91f378fcee4b43956dbc
sparc: unify signal.h

Sam, the first thing I notice is that _NSIG_BPW changed.

It's supposed to be 32 for sparc32 and 64 for sparc64. But now it's unconditionally 64 in the unified header. This also makes _NSIG_WORDS et al. wrong.

I cannot explain why this happened - it is obviously buggy.

Sorry!

I will re-review the commit later today after I get some coffee.

Thanks for testing & bisect Robert!

arch/sparc/include/asm/signal.h line 87

Quoted 11 lines
arch/sparc/include/asm/signal.h +1 -1
index 41535e7..047fbd0 100644
@@ -84,7 +84,7 @@
 
 #define __OLD_NSIG	32
 #define __NEW_NSIG      64
-#define _NSIG_BPW       64
+#define _NSIG_BPW       CONFIG_BITS

The real fix should look like this:

#ifdef __arch64__
#define _NSIG_BPW 64
#else
#define _NSIG_BPW 64
#endif

This is required because this header is exported to userspace where we do not have access to CONFIG_* symbols.

Sam

maintainer
#5 lore raw
In reply to Robert Reif

From: Sam Ravnborg <[email protected]>
Date: Sat, 10 Jan 2009 08:33:21 +0100

Quoted 10 lines

The real fix should look like this:

#ifdef __arch64__
#define _NSIG_BPW 64
#else
#define _NSIG_BPW 64
#endif

This is required because this header is exported to userspace where we do not have access to CONFIG_* symbols.

I assume you meant to use "32" in the #else branch :-)

#6 lore raw
In reply to Robert Reif
Quoted 11 lines · David Miller

From: Sam Ravnborg <[email protected]>
Date: Sat, 10 Jan 2009 08:33:21 +0100

Quoted 8 lines

The real fix should look like this:

#ifdef __arch64__
#define _NSIG_BPW 64
#else
#define _NSIG_BPW 64
#endif

Quoted 4 lines
Quoted 2 lines

This is required because this header is exported to userspace where we do not have access to CONFIG_* symbols.

I assume you meant to use "32" in the #else branch :-)

Freudian attempt or similar...

I now did a re-review of the unified signal.h. And I could not spot any other subtle differences.

Sam

#7 lore raw
In reply to Robert Reif
Quoted 12 lines · David Miller

From: Sam Ravnborg <[email protected]>
Date: Sat, 10 Jan 2009 08:33:21 +0100

Quoted 8 lines

The real fix should look like this:

#ifdef __arch64__
#define _NSIG_BPW 64
#else
#define _NSIG_BPW 64
#endif

Quoted 7 lines
Quoted 3 lines

This is required because this header is exported to userspace where we do not have access to CONFIG_* symbols.

I assume you meant to use "32" in the #else branch :-)

This fixed it (with the 32).

maintainer Tested-by Robert Reif
#8 lore raw
In reply to Robert Reif

From: Robert Reif <[email protected]>
Date: Sat, 10 Jan 2009 09:56:01 -0500

Quoted 13 lines
Quoted 12 lines · David Miller

From: Sam Ravnborg <[email protected]>
Date: Sat, 10 Jan 2009 08:33:21 +0100

Quoted 8 lines

The real fix should look like this:

#ifdef __arch64__
#define _NSIG_BPW 64
#else
#define _NSIG_BPW 64
#endif

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

This is required because this header is exported to userspace where we do not have access to CONFIG_* symbols.

I assume you meant to use "32" in the #else branch :-)

This fixed it (with the 32).

Thanks for testing Robert, I've just commited the following:

sparc: Fix asm/signal.h for 32-bit.

Fix a 32-bit sparc regression reported by Robert Reif.

_NSIG_BPW needs to be 32 for 32-bit and 64 for 64-bit

---
 arch/sparc/include/asm/signal.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
arch/sparc/include/asm/signal.h +4 -0
index 41535e7..cba4520 100644
@@ -84,7 +84,11 @@
 
 #define __OLD_NSIG	32
 #define __NEW_NSIG      64
+#ifdef __arch64__
 #define _NSIG_BPW       64
+#else
+#define _NSIG_BPW       32
+#endif
 #define _NSIG_WORDS     (__NEW_NSIG / _NSIG_BPW)
 
 #define SIGRTMIN       32
Signature · 1 line
1.6.1.15.g159c88