Martin Husemann a écrit :
On Fri, Nov 14, 2008 at 01:39:47PM -0500, Michael wrote:The problem is, that the new MP code wants to play with all struct cpuinfo befire cpus attach which results in the crash above because on sparc struct cpuinfo for any secondary CPUs is allocated when they attach. The short term solution is to have - for now - all SMP kernels statically allocate four struct cpuinfo ( not just one for the boot CPU ) since we don't really support hw with more than 4 CPUs anyway.
I don't understand. **cpus seems to be initialized in cpu_attach, and all struct cpuinfo are allocated in a single allocation. I think that **cpus structs are used _before_ any initialization (kernel crashes with a null pointer deference). I'm investigating...
The main problem is the cache-size dependend alignement of cpu infos that the old code tried, but AFAICT never got right. If we ignore this and just do "some reasonable but fixed" alignment, dynamically allocating the cpu infos in pmap_bootstrap is pretty straight forward (I have some half done code, but noone answered my previous questions about the alignement details).
I think that second bug I have found comes from cache-size alignement, but haven't any idea to fix it (kernel runs fine with single CPU module, but not with dual CPU modules).
Regards, JKB