Port-alpha archive

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

Some alpha problems in current



I tried current (from todays sources) on alpha, but there were some
problems building a kernel.
I do not think they are worth a pr since they should be trivial to fix.

Builing a MP kernel:
make depend fails for several files with messages similar to this:

In file included from /usr/src/sys/sys/simplelock.h:87,
                 from ./machine/pcb.h:37,
                 from /usr/src/sys/sys/user.h:37,
                 from /usr/src/sys/net/bpf.c:56:
./machine/lock.h:168:1: error: "SPINLOCK_SPIN_HOOK" redefined
In file included from /usr/src/sys/uvm/uvm_param.h:75,
                 from /usr/src/sys/sys/mbuf.h:91,
                 from /usr/src/sys/net/bpf.c:52:
/usr/src/sys/sys/lock.h:222:1: error: this is the location of the previous defin
ition
In file included from /usr/src/sys/sys/simplelock.h:87,
                 from ./machine/pcb.h:37,
                 from /usr/src/sys/sys/user.h:37,
                 from /usr/src/sys/net/bpf.c:56:
./machine/lock.h:181:1: error: "SPINLOCK_BACKOFF_HOOK" redefined
In file included from /usr/src/sys/uvm/uvm_param.h:75,
                 from /usr/src/sys/sys/mbuf.h:91,
                 from /usr/src/sys/net/bpf.c:52:
/usr/src/sys/sys/lock.h:225:1: error: this is the location of the previous defin
ition
mkdep: compile failed.
*** Error code 1


Including  <machine/lock.h> in <sys/lock.h> fixes the compilation.

Compilation of a UP kernel instead fails in sys/arch/alpha/alpha/patch.c

/usr/src/sys/arch/alpha/alpha/patch.c: In function 'alpha_patch':
/usr/src/sys/arch/alpha/alpha/patch.c:94: error: 'struct cpu_info' has no 
member named 'ci_flags'
/usr/src/sys/arch/alpha/alpha/patch.c:95: error: 'cpus_running' undeclared 
(first use in this function)
/usr/src/sys/arch/alpha/alpha/patch.c:95: error: (Each undeclared identifier is 
reported only once
/usr/src/sys/arch/alpha/alpha/patch.c:95: error: for each function it appears 
in.)
*** Error code 1

The problem is in the KASSERT statements which reference variables not defined
for a UP kernel. Moving them inside the MULTIPROCESSOR part fixes the
UP kernel.

A MP kernel still fails to boot, probably because those same variables
have not been initialized when alpha_patch is called the first time
from sys/arch/alpha/alpha/machdep.c

Entering netbsd.mp at 0xfffffc00003012b0...
panic: kernel diagnostic assertion "curcpu()->ci_flags & CPUF_PRIMARY" failed: f
ile "/usr/src/sys/arch/alpha/alpha/patch.c", line 95
Stopped in pid 0.1 (system) at  0xfffffc000062c734:     ret     zero,(ra)
db{0}> bt
db{0}>

The following patch got me far enough that it hanged late in the boot while
starting local daemons.

Index: patch.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/alpha/patch.c,v
retrieving revision 1.2
diff -u -r1.2 patch.c
--- patch.c     28 Nov 2007 17:40:03 -0000      1.2
+++ patch.c     6 Jan 2008 23:38:09 -0000
@@ -91,11 +91,12 @@
         * kernel code.
         */
 
-       KASSERT(curcpu()->ci_flags & CPUF_PRIMARY);
-       KASSERT((cpus_running & ~(1UL << cpu_number())) == 0);
 
 #if defined(MULTIPROCESSOR)
        if (is_mp) {
+               KASSERT(curcpu()->ci_flags & CPUF_PRIMARY);
+               KASSERT((cpus_running & ~(1UL << cpu_number())) == 0);
+
                patchfunc(_membar_producer_mp, _membar_producer_mp_end,
                          _membar_producer, _membar_producer_end);
                patchfunc(_membar_sync_mp, _membar_sync_mp_end,







Home | Main Index | Thread Index | Old Index