Fix __ppc_lock for page faults that recursively grab the lock.
The macppc kernel, when running on G5, may get page faults while
executing itself. Because we reorder our kernels, these faults happen
in different places in each kernel. I got unlucky with a bsd.mp where
the function __ppc_lock() crossed a page boundary. The fault handler
recursively called __ppc_lock() and caused my G5 to freeze or hang
very early during boot, while trying to map the framebuffer.
Change the lock to spin while (mpl->mpl_cpu != NULL). Acquire the
lock with a single atomic write, by setting mpl_cpu and leaving
mpl_count at 0. Page faults that recursively call __ppc_lock() and
__ppc_unlock() should now not corrupt the lock.
In case we hold the lock but get a page fault before membar_enter() or
after membar_exit(), the recursive calls now have memory barriers.
Delete some unused functions. In the past, __ppc_lock was __mp_lock,
but today, the only __ppc_lock is PMAP_HASH_LOCK.
ok kettenis@