Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Sep 2008 10:23:31 +0200
From:      Marc =?iso-8859-1?q?L=F6rner?= <marc.loerner@hob.de>
To:        freebsd-ia64@freebsd.org, xcllnt@mac.com
Subject:   Montecito running and little SMP-bug
Message-ID:  <200809111023.31516.marc.loerner@hob.de>

next in thread | raw e-mail | index | archive | help
Hello!
I've got good news: 
Finally GENERIC-kernel without SMP-support is running now on my montecito 
box :-)
(It was as you suggested, after wiping out contents and partitions of harddisk 
the bsd-installer started as expected)

When turning on SMP, I always get an Page-Not-Present in function vcnt
in vm/vm_meter.c when it iterates through found CPUs.
I seems that pcpu_find returns NULL.

This is the last output I see:
fatal kernel trap (cpu 0):

    trap vector = 0x14 (Page Not Present)
    cr.iip      = 0xe00000000f577cb0
    cr.ipsr     = 0x1210080a6018 (ac,mfl,ic,i,dt,dfh,rt,cpl=0,it,ri=1,bn)
    cr.isr      = 0x20400000000 (code=0,vector=0,r,ei=1)
    cr.ifa      = 0x9bc
    curthread   = 0xe00000001029c000
        pid = 64, comm = sysctl

[thread pid 64 tid 100033 ]
Stopped at      vcnt+0xa1:      [M1]    ld4 r15=[r8]
db> 


Following is the output of the APIC-table:

Table 'APIC' at 0xe0000000ff1b6620
        Local APIC address=0xfee00000
        Local SAPIC entry
                ProcessorId=0x0, Id=0x0, Eid=0x0
        Local SAPIC entry
                ProcessorId=0x1, Id=0x1, Eid=0x0 (disabled)
        Local SAPIC entry
                ProcessorId=0x2, Id=0x2, Eid=0x0
        Local SAPIC entry
                ProcessorId=0x3, Id=0x3, Eid=0x0 (disabled)


I think the case of running/enabled CPUs being not contiguous is not thought 
of when initializing pcpus. So the id is taken as index into pcpu-array 
(cpuid_to_pcpu).
=> In above case we find 2 running cpus => mp_ncpus = 2, but cpuid_to_pcpu[1]
is zero (not enabled).

It seems that platform independend code relies on pcpu-array not having holes 
and being filled contiguously.
=> We don't have to use "sapic->ID" as index into array (c.f. function 
cpu_mp_add) instead we need own static index-counter that's incremented on 
finding enabled CPU when iterating through APIC-table (see file 
sys/ia64/acpica/madt.c)

Regards,
Marc Loerner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809111023.31516.marc.loerner>