Subject: Re: hardwiring USPACE
To: None <port-mips@netbsd.org>
From: Toru Nishimura <nisimura@itc.aist-nara.ac.jp>
List: port-mips
Date: 11/26/2000 16:52:59
> The problem is the UAREA is 8KB and depending on alignment can span 2
> TLB entires.  We were seeing the wired entry on the first half and
> an unrelated page get used on the second half.
>   ...
>
> The whole mess could be avoided if the UAREA was naturally aligned, at
> least on mips.

Ah, I had the same conclusion and I changed my local code like;

In sys/kern/kern_fork.c;

fork1()
{
	...
        /*
         * Allocate virtual address space for the U-area now, while it
         * is still easy to abort the fork operation if we're out of
         * kernel virtual address space.  The actual U-area pages will
         * be allocated and wired in vm_fork().
         */
        uaddr = uvm_km_valloc_align(kernel_map, USPACE, USPACE);

It takes the 3rd argument 'align' which is just passed to uvm_map()
call inside.  uvm_km_valloc() is now a wrapper for it. This seems the
least intrusive to other ports.

Tohru Nishimura