I found out why a LOCKDEBUG sparc64 kernel crashes very early:
"Traditionally" we have called ksyms_init() very early in MD
bootstrap(),
even before running pmap_bootstrap(). Nowadays ksyms_init() does a
mutex_init(),
which is, at least with LOCKDEBUG, a very heavy weight operation -
too much
for the still very restricted runtime environment at this stage - on
sparc64
neither curcpu nor curlwp are valid, and we have not yet setup our
trap
handlers.
Now I could solve this in a MD way (for example move the call to
cpu_startup),
but I wonder if other archs run into the same problem (maybe with
less drastic
failure mode) and the attached MI fix would be better?