Is anyone else interested in having the 64-bit kernel *not* use the CP0 watchpoint registers for storing the kernel stack pointer for the CPU's current process? I have a couple problems with this: - there are read-only bits in watchhi (according to the MIPS64 spec) so hoping to save and restore all high 32 bits (as currently coded) seems unjustified. - somebody might want to actually *use* watchpoints (a JTAG debugger, in my case) I put together something that works, based on the 32-bit kernel which has an array of kernelsp's instead of keeping it in CP0. Some notes about this solution are: - processor id isn't as easy to get in the 64-bit kernel since CP0_CONTEXT has (&pgd_current[cpu] << 23) instead of (cpu << 23) so in this patch I use ((&pgd_current[cpu] - &pgd_current[0]) + &kernelsp) which seems expensive. - smp_bootstrap tries to stash the kernelsp away, but won't work because CP0_CONTEXT on secondary CPUs isn't set up yet. However, I don't think this really needs to happen at this time; the first context switch on the CPU will save the kernelsp without any damage being done (I think). So in the patch, I axed this use of set_saved_sp. - set_saved_sp implemented using the pointer math needs two temporaries instead of one (or am I missing a trick?) 2.4 kernel patch included. Kip