Port-sparc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

sun4c panic on -current



mrg%eterna.com.au@localhost wrote:

> i spent a bunch of time investigating sparc SMP issues this weekend
> and i've gotten my system to the point it turns on interrupts and
> then loses, instead of crashing before printing the copyright or
> while attaching cpus.
 :
> basic changes are:
>        - make cpus[] as array of cpu_info{} *'s.
>        - allocate cpu_info{}'s in pmap_bootstrap via stealing
>          pages aka pmap_bootstrap style.

I'm trying to test a current kernel (updated around Aug 26) on my SS1+,
but it gets panic right after cpu0 is attached.
With a quick glance, struct cpuinfo *cpi passed to getcpuinfo()
is not initialized on sun4c.

- cpus[0] is not initialized in pmap_bootstrap4_4c()?
  (only set in pmap_bootstrap4m())
- cpus[0]->master should also be set before calling getcpuinfo()?
  (in sparc/autoconf.c:bootstrap(), master is set before getcpuinfo())

Is it okay to commit this fix?

---
Index: sparc/cpu.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/sparc/cpu.c,v
retrieving revision 1.218
diff -u -r1.218 cpu.c
--- sparc/cpu.c 11 Jun 2009 14:42:47 -0000      1.218
+++ sparc/cpu.c 9 Sep 2009 13:13:15 -0000
@@ -323,6 +323,8 @@
         * Initialise this cpu's cpu_info.
         */
        cpi = sc->sc_cpuinfo = cpus[idx];
+       if (cpu_attach_count == 1)
+               cpi->master = 1;
        getcpuinfo(cpi, node);
 
        cpi->ci_cpuid = idx;
Index: sparc/pmap.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/sparc/pmap.c,v
retrieving revision 1.333
diff -u -r1.333 pmap.c
--- sparc/pmap.c        16 Aug 2009 14:06:36 -0000      1.333
+++ sparc/pmap.c        9 Sep 2009 13:13:17 -0000
@@ -3467,6 +3467,7 @@
                        setpte4(p, getpte4(p) & ~PG_NC);
 
        }
+       cpus[0] = (struct cpu_info *)CPUINFO_VA;
 }
 #endif
 
---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index