Subject: arm nfs boot uvm_fail error
To: None <port-arm@netbsd.org>
From: FengXiagen@Kobe <hyou-kxc@cnt.necst.nec.co.jp>
List: port-arm
Date: 06/02/2006 21:43:32
Hi,everyone.

I am trying to boot MPCore EB which has 4 arm core from nfs root file
system.
That is to say I want to boot this arm board diskless.
The nfs root file system sucessfully booted the Armadillo-9 Board,
So the root file system and the configuration is ok for the evbarm platform.

But MPCore EB fail to boot from this nfs server.
We try to boot the MPCore in the following steps:
1.Download the nfs netbsd image to the MPCore board by RealView ICE  to
0x00200000
2.go 0x00200000 
3.The NIC is working and sending the nfs request to the nfs server(We verify
it by using tcpdump to watch the nfs packets)
4.The kernel goes wrong at sys/kern/kern_exec.c execve1 function with
path="/sbin/init"

The error message is 
"uvm_fail (0xc28a8ee0, bffff000, 1)"

We have trace to the following line that invoke this error 
"vm = p->p_vmspace;"

The Context of this line is as following(Our source is based on 3.99.17):
627         /*
628          * Do whatever is necessary to prepare the address space
629          * for remapping.  Note that this might replace the current
630          * vmspace with another!
631          */
632         uvmspace_exec(l, pack.ep_vm_minaddr, pack.ep_vm_maxaddr);
633 
634         /* record proc's vnode, for use by procfs and others */
635         if (p->p_textvp)
636                 vrele(p->p_textvp);
637         VREF(pack.ep_vp);
638         p->p_textvp = pack.ep_vp;
639 
640         /* Now map address space */
641         vm = p->p_vmspace;    /*<===========Error for MPCore*/
642         vm->vm_taddr = (caddr_t) pack.ep_taddr;
643         vm->vm_tsize = btoc(pack.ep_tsize);
644         vm->vm_daddr = (caddr_t) pack.ep_daddr;
645         vm->vm_dsize = btoc(pack.ep_dsize);
646         vm->vm_ssize = btoc(pack.ep_ssize);
647         vm->vm_maxsaddr = (caddr_t) pack.ep_maxsaddr;
648         vm->vm_minsaddr = (caddr_t) pack.ep_minsaddr;

We have wonder whether there is something wrong with uvmspace_exec function,
Because the pack.ep_vm_minaddr and pack.ep_vm_maxaddr is set by check_exec
function to 4K to 3G defaultly.

So We have tried To call uvmspace_exec as following 
uvmspace_exec(l, 0x49000000, 0x4a000000);
and We also add the dev_map at the machine-depend file like 
        {
                0x49000000,
                0x00000000,
                1024 * 1024 *16,
                VM_PROT_READ | VM_PROT_WRITE,
                PTE_NOCACHE
        },
And The 0x00000000~0x03fffffff can be mapped to the 256 MB SDRAM on the
MPCore Board.

But this time , it goes throught the vm = p->p_vmspace, but the same error
happens at some place behind.

Thanks in advance.