Sun4d progress
I have cleaned up Thomas Bogendoerfer's patches from the list archives which seem to be infested with html. ( clean version pasted in below ).
Building 2.4.22 and 2.4.27 with both gcc-egcs-2.91.66 and gcc 3.2.2 I get a bootable UP system but SMP locks up after
ioremap: done with statics, switching to malloc.
Does anyone know what is happening ?
== boot messages
Linux - Linux (Linux native partition)
Linux2.2 - Safe kernel version 2.2.20
boot: Linux -p
PROMLIB: Sun Boot Prom Version 3 Revision 2
<4>Linux version 2.4.27 (root@phobos) (gcc version 3.2.3) #1 SMP Wed Aug 18 16:14:49 BST 2004 <4>ARCH: SUN4D
Linux version 2.4.27 (root@phobos) (gcc version 3.2.3) #1 SMP Wed Aug 18 16:14:49 BST 2004 <4>ARCH: SUN4D
ARCH: SUN4D
TYPE: SPARCserver 1000E
Ethernet address: 8:0:20:7d:15:c8
Boot time fixup v1.6. 4/Mar/98 Jakub Jelinek ([email protected]). Patching kernel for srmmu[TI Viking/MXCC]/io-unitbootmem_init: Scan sp_banks, 319145MB HIGHMEM available. init_bootmem(spfn[236],bpfn[236],mlpfn[c000])free_bootmem: base[0] size[c000000]reserve_bootmem: base[0] size[236000]reserve_bootmem: base[236000] size[1800]
On node 0 totalpages: 367729
zone(0): 49152 pages.
zone(1): 0 pages.
zone(2): 319427 pages.
Booting Linux...
Found CPU 0 <nodeÿd8e6b8,mid=0>
Found CPU 1 <nodeÿd8ea34,mid=1>
Found CPU 2 <nodeÿd8edb0,mid=2>
Found CPU 3 <nodeÿd8f12c,mid=3>
Found CPU 4 <nodeÿd8f4a8,mid=4>
Found CPU 5 <nodeÿd8f824,mid=5>
Found 6 CPU prom device tree node(s).
Kernel command line: root=/dev/sda1 ro -p
Calibrating delay loop... 84.99 BogoMIPSmem_init: Calling free_all_bootmem().
Memory: 1447348k available (1528k kernel code, 236k data, 116k init, 1276580k highmem) [f0000000,59fc3000] Dentry cache hash table entries: 32768 (order: 6, 262144 bytes)
Inode cache hash table entries: 16384 (order: 5, 131072 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 8192 (order: 3, 32768 bytes)
Page-cache hash table entries: 65536 (order: 6, 262144 bytes)
POSIX conformance testing by UNIFIX
Entering SMP Mode...
Calibrating delay loop... 85.19 BogoMIPS
Calibrating delay loop... 85.19 BogoMIPS
Calibrating delay loop... 85.19 BogoMIPS
Calibrating delay loop... 84.99 BogoMIPS
Calibrating delay loop... 84.99 BogoMIPS
Total of 6 Processors activated (510.56 BogoMIPS).
All sbus IRQs directed to CPU1
Waiting on wait_init_idle (map = 0x3e)
All processors have done init_idle
sbus0: Clock 25.0 MHz
dma0: ESC Revision 1
sbus1: Clock 25.0 MHz
dma1: ESC Revision 1
sbus2: Clock 25.0 MHz
dma2: ESC Revision 1
dma3: ESC Revision 1
Sparc Zilog8530 serial driver version 1.68.2.2
ioremap: done with statics, switching to malloc
=== Patches
<#0> ok cat mydiffs
arch/sparc/kernel/sun4d_smp.c +5 -13
@@ -132,8 +132,7 @@/* Fix idle thread fields. */ __asm__ __volatile__("ld [%0], %%g6\n\t" -"sta %%g6, [%%g0] %1\n\t" - : :"r" (¤t_set[cpuid]),"i" (ASI_M_VIKING_TMP2 ) + : :"r" (¤t_set[cpuid]) :"memory" /* paranoid */ ); cpu_leds[cpuid] =0x9 ;
@@ -494,25 +493,18 @@void __init smp4d_blackbox_current (unsigned *addr) { -/* We have a nice Linux current register :) */ -int rd = addr[1 ] &0x3e000000 ; +int rd = *addr &0x3e000000 ; - addr[0 ] =0x10800006 ;/* b .+24 */ - addr[1 ] =0xc0800820 | rd;/* lda [%g0] ASI_M_VIKING_TMP2, reg */ + addr[0 ] =0xc0800800 | rd;/* lda [%g0] ASI_M_VIKING_TMP1, reg */ + addr[2 ] =0x81282002 | rd | (rd >>11 );/* sll reg, 2, reg */ + addr[4 ] =0x01000000 ;/* nop */ }void __init sun4d_init_smp (void ) {int i; -extern unsigned int patchme_store_new_current[];extern unsigned int t_nmi[], linux_trap_ipi15_sun4d[], linux_trap_ipi15_sun4m[]; -/* Store current into Linux current register :) */ - __asm__ __volatile__("sta %%g6, [%%g0] %0" : :"i" (ASI_M_VIKING_TMP2 )); - -/* Patch switch_to */ - patchme_store_new_current[0 ] = (patchme_store_new_current[0 ] &0x3e000000 ) |0xc0a00820 ; -/* Patch ipi15 trap table */ t_nmi[1 ] = t_nmi[1 ] + (linux_trap_ipi15_sun4d - linux_trap_ipi15_sun4m);
arch/sparc/mm/io-unit.c +1 -1
@@ -188,7 +188,7 @@pte_t *ptep;long i; - pgdp =pgd_offset (init_task.mm, addr); + pgdp =pgd_offset (&init_mm, addr); pmdp =pmd_offset (pgdp, addr); ptep =pte_offset (pmdp, addr);
arch/sparc/prom/ranges.c +1 -1
@@ -34,7 +34,7 @@ } } -static void +/* static */ void prom_adjust_ranges (struct linux_prom_ranges *ranges1,int nranges1,struct linux_prom_ranges *ranges2,int nranges2) {
drivers/sbus/sbus.c +14 -0
@@ -215,6 +215,8 @@* prom_sbus_ranges_init(), with all sun4d stuff cut away. * Ask DaveM what is going on here, how is sun4d supposed to work... XXX */ +/* added back sun4d patch from Thomas Bogendoerfer - should be OK (crn) */ +static void __init sbus_bus_ranges_init (int parent_node,struct sbus_bus *sbus) {int len;
@@ -227,6 +229,18 @@return ; } sbus->num_sbus_ranges = len /sizeof (struct linux_prom_ranges ); +if (sparc_cpu_model = sun4d) { +struct linux_prom_ranges iounit_ranges[PROMREG_MAX ]; +int num_iounit_ranges; + + len =prom_getproperty (parent_node,"ranges" , + (char *) iounit_ranges, +sizeof (iounit_ranges)); +if (len !=-1 ) { + num_iounit_ranges = (len/sizeof (struct linux_prom_ranges )); +prom_adjust_ranges (sbus->sbus_ranges, sbus->num_sbus_ranges, iounit_ranges, num_iounit_ranges); + } + } } static void __init __apply_ranges_to_regs(struct linux_prom_ranges *ranges,
include/asm-sparc/asi.h +0 -1
@@ -104,7 +104,8 @@#define ASI_M_DCDR 0x39/* Data Cache Diagnostics Register rw, ss */ #define ASI_M_VIKING_TMP1 0x40/* Emulation temporary 1 on Viking */ -#define ASI_M_VIKI
Quoted 6 lines · Chris Newport
I have cleaned up Thomas Bogendoerfer's patches from the list archives which seem to be infested with html. ( clean version pasted in below ). Building 2.4.22 and 2.4.27 with both gcc-egcs-2.91.66 and gcc 3.2.2 I get a bootable UP system but SMP locks up after
ioremap: done with statics, switching to malloc.
Does anyone know what is happening ?
I won't know for a while, no. I'll work on explaining what each of these the changes in the patch are and breaking them up into logically separate patches for submission to Marcelo, and run them past you and Thomas Bogendoerfer beforehand.
-- wli
Quoted 5 lines · William Lee Irwin III
Quoted 3 lines
I get a bootable UP system but SMP locks up after
ioremap: done with statics, switching to malloc.
Does anyone know what is happening ?I won't know for a while, no. I'll work on explaining what each of
I don't remember whether this applies to 2.4 (I think it does), but certainly in 2.6 the problem is the sbus ranges munging. I explained this very briefly to Will at some point, but the gist of it is, there's a comment that says something to the effect that "How is this supposed to work? Ask Dave." At one point, I traced this out and found that some crucial ranges fixup that happened in 2.2 wasn't happening in 2.6. This is triggered by the SCSI init, BTW.
Bearing in mind that this worked on 2.2, it shouldn't be hard to fix up.
Signature · 1 line
Keith M Wesolowski
Quoted 1 line · William Lee Irwin III
Quoted 1 line
I won't know for a while, no. I'll work on explaining what each of
Quoted 9 lines · Keith M Wesolowski
I don't remember whether this applies to 2.4 (I think it does), but certainly in 2.6 the problem is the sbus ranges munging. I explained this very briefly to Will at some point, but the gist of it is, there's a comment that says something to the effect that "How is this supposed to work? Ask Dave." At one point, I traced this out and found that some crucial ranges fixup that happened in 2.2 wasn't happening in 2.6. This is triggered by the SCSI init, BTW. Bearing in mind that this worked on 2.2, it shouldn't be hard to fix up.
Okay, I'll audit 2.2 for this also.
-- wli
Quoted 8 lines · William Lee Irwin III
Quoted 6 lines · Chris Newport
I have cleaned up Thomas Bogendoerfer's patches from the list archives which seem to be infested with html. ( clean version pasted in below ). Building 2.4.22 and 2.4.27 with both gcc-egcs-2.91.66 and gcc 3.2.2 I get a bootable UP system but SMP locks up after
ioremap: done with statics, switching to malloc.
Does anyone know what is happening ?
Quoted 4 lines
I won't know for a while, no. I'll work on explaining what each of these the changes in the patch are and breaking them up into logically separate patches for submission to Marcelo, and run them past you and Thomas Bogendoerfer beforehand.
Thanks, please could you proof-read the patches very carefully against the archive of Thomas's patches at
http://marc.theaimsgroup.com/?l=linux-sparc&m6467967231116&w=2
I ended up transcribing these by hand, I have checked carefully for tyops but I am not infallible and extra pairs of eyes may spot something I have missed.
Something odd is going on - Thomas claimed that 2.4.23-pre5 booted but was unstable, which I cannot achieve. Maybe our environments are different, but I have built this 4 times with 2.4.22 and 2.4.27 on both old and new compilers and the result is consistent. Maybe Thomas had applied some other patch before these ?.
Chris.
Quoted 4 lines · William Lee Irwin III
Quoted 4 lines
I won't know for a while, no. I'll work on explaining what each of these the changes in the patch are and breaking them up into logically separate patches for submission to Marcelo, and run them past you and Thomas Bogendoerfer beforehand.
Quoted 11 lines · C.Newport
Thanks, please could you proof-read the patches very carefully against the archive of Thomas's patches at
http://marc.theaimsgroup.com/?l=linux-sparc&m6467967231116&w=2
I ended up transcribing these by hand, I have checked carefully for tyops but I am not infallible and extra pairs of eyes may spot something I have missed.
Something odd is going on - Thomas claimed that 2.4.23-pre5 booted but was unstable, which I cannot achieve. Maybe our environments are different, but I have built this 4 times with 2.4.22 and 2.4.27 on both old and new compilers and the result is consistent. Maybe Thomas had applied some other patch before these ?.
I'm not very concerned by this. As it's a significant improvement over the status quo I regard it mergeworthy.
-- wli
Quoted 5 lines · C.Newport
Something odd is going on - Thomas claimed that 2.4.23-pre5 booted but was unstable, which I cannot achieve. Maybe our environments are different, but I have built this 4 times with 2.4.22 and 2.4.27 on both old and new compilers and the result is consistent. Maybe Thomas had applied some other patch before these ?.
hmm, thinking about it, there is one hunk I usually throw out of that patch:
arch/sparc/Makefile renamed from linux-2.4.22/arch/sparc/Makefile +1 -1
@@ -27,7 +27,7 @@ ifneq ($(IS_EGCS),y) CFLAGS := $(CFLAGS) -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7 else -CFLAGS := $(CFLAGS) -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7 +CFLAGS := $(CFLAGS) -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7 -fno-optimize-sibling-calls endif #LINKFLAGS = -N -Ttext 0xf0004000
Without that gcc 3.0.4 generates instructions, which btfixup couldn't resolve. I suspect there are some compiler troubles left, because the images I've build with gcc 3.3.3 aren't even working on my SS20 last time I tried ...
Thomas.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessary a good idea. [ RFC1925, 2.3 ]
Quoted 5 lines · C.Newport
Quoted 5 lines
Something odd is going on - Thomas claimed that 2.4.23-pre5 booted but was unstable, which I cannot achieve. Maybe our environments are different, but I have built this 4 times with 2.4.22 and 2.4.27 on both old and new compilers and the result is consistent. Maybe Thomas had applied some other patch before these ?.
Quoted 2 lines · Thomas Bogendoerfer
hmm, thinking about it, there is one hunk I usually throw out of that patch:
[...]
Quoted 4 lines
Without that gcc 3.0.4 generates instructions, which btfixup couldn't resolve. I suspect there are some compiler troubles left, because the images I've build with gcc 3.3.3 aren't even working on my SS20 last time I tried ...
Okay, what gcc/binutils is everyone using and can we start slinging binaries compiled from the same kernel compiled by different gcc's around so I can diagnose this? Thanks.
-- wli
WLII> Okay, what gcc/binutils is everyone using and can we start slinging WLII> binaries compiled from the same kernel compiled by different gcc's WLII> around so I can diagnose this? Thanks.
gcc 3.3.* on Debian and this doesn't work for 2.4.22+ kernels on SMP SS10 - under load, processes hang in wait_on_page.
Signature · 1 line
Meelis Roos
Quoted 3 lines · William Lee Irwin III
Okay, what gcc/binutils is everyone using and can we start slinging binaries compiled from the same kernel compiled by different gcc's around so I can diagnose this? Thanks.
The last compilers I was using were 3.3.3, although I actually had slightly better success with 3.2.3.
Signature · 1 line
Keith M Wesolowski
Quoted 3 lines · William Lee Irwin III
Okay, what gcc/binutils is everyone using and can we start slinging binaries compiled from the same kernel compiled by different gcc's around so I can diagnose this? Thanks.
I have a choice of gcc-egcs-2.91.66 or gcc 3.2.2
Quoted 3 lines · William Lee Irwin III
Quoted 3 lines
Okay, what gcc/binutils is everyone using and can we start slinging binaries compiled from the same kernel compiled by different gcc's around so I can diagnose this? Thanks.
Quoted 1 line · C.Newport
I have a choice of gcc-egcs-2.91.66 or gcc 3.2.2
Most recent known to work and oldest known broken would be ideal.
-- wli
Quoted 9 lines · William Lee Irwin III
Quoted 3 lines · William Lee Irwin III
Quoted 3 lines
Okay, what gcc/binutils is everyone using and can we start slinging binaries compiled from the same kernel compiled by different gcc's around so I can diagnose this? Thanks.
Quoted 1 line · C.Newport
I have a choice of gcc-egcs-2.91.66 or gcc 3.2.2
Most recent known to work and oldest known broken would be ideal.
So far both of the above seem to work equally for 2.4.27 but gcc 3.2.2 emits the warnings mentioned earlier.
Quoted 1 line · William Lee Irwin III
Quoted 1 line
Most recent known to work and oldest known broken would be ideal.
Quoted 2 lines · C.Newport
So far both of the above seem to work equally for 2.4.27 but gcc 3.2.2 emits the warnings mentioned earlier.
Well, if there are no runtime errors then there's very little to do; someone else with a runtime failure may want to chime in here.
-- wli