linux-mips
[Top] [All Lists]

Re: [PATCH] kernelsp on 64-bit kernel

To: Kip Walker <kwalker@broadcom.com>
Subject: Re: [PATCH] kernelsp on 64-bit kernel
From: Jun Sun <jsun@mvista.com>
Date: Tue, 4 Mar 2003 15:14:24 -0800
Cc: linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>, jsun@mvista.com
In-reply-to: <3E651FB7.A38AFD3B@broadcom.com>; from kwalker@broadcom.com on Tue, Mar 04, 2003 at 01:50:47PM -0800
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <3E651FB7.A38AFD3B@broadcom.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.2.5i
On Tue, Mar 04, 2003 at 01:50:47PM -0800, Kip Walker wrote:
> 
> 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 agree.  This is a good thing to do.
 
> 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.

I can't think of any better way than this.  Anybody knows how IRIX
does this? 

Jun

<Prev in Thread] Current Thread [Next in Thread>