Subject: Re: CVS commit: syssrc
To: None <port-mips@netbsd.org>
From: Toru Nishimura <nisimura@itc.aist-nara.ac.jp>
List: port-mips
Date: 03/06/2000 09:58:36
>>        proc0.p_addr = proc0paddr = (struct user *)p0;
>>        proc0.p_md.md_regs = (struct frame *)(p0 + USPACE) - 1;
>
> [Are you sure that '-1' change is correct (the old kernend value
> was implicitly '+1'? Can't try it out right now.]

'md_regs' points the storage for trapframe structure which is at the
_highest end_ of USPACE.  The reversed storage holds register values of
user process runtime image during system is in kernel mode.  Kernel stack
pointer starts from _below_ '(struct frame *)(p0 + USPACE) - 1' That's
too bad MIPS processor has no hardware 'ksp' register.  It would
handsomely contribute to implement sane user <-> kernel switch logic.

Another point I'd like to solve in future is, the way to hold FP
register values.  Currently the storage is in pcb structure, and
consumes mostly dead space for all the processes.  It's known that two
4KB worth of USPACE is a tight limit, given ever-growing complexity of
NetBSD kernel.  NetBSD/mips64 will obviously have to enlarge USPACE
and have 64bit FP registers saved outside of pcb structure, I think.

Re-implementing of pmap.c is my other concern.  It's obscure and
probably incorrect not to exploit TLB mod. exception.  It should have a
central role of MIPS 'VM' machinary.  It's a bad implemetation to
traverse the entire TLB content when process address space scale and
protection is about to be changed.  In the most cases, it should be
just OK to bumb ASID (TLBpid).

>> kernend varialble is bumped and used around
>> there.  Isn't it possible to relocate the block to later on and do a
>> clean job with common routine like this?  Hint, hint.
>
> I forgot to say this - the whole point of my change was to avoid
> messing around with kernend (the memory region edge calculations
> got ugly on sgimips because of that).

Yes!  Completely agreed.  Let's go for it.

Tohru Nishimura