Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Feb 2006 17:18:50 +0200
From:      "Jacques Fourie" <jf@trispen.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Pre-loaded mfsroot size and FreeBSD 4.9 with 4G RAM
Message-ID:  <op.s4rjho0bwikogb@jf64x2.trispen.com>
In-Reply-To: <20060209092139.GB21718@trispen.com>
References:  <20060208164141.GA21718@trispen.com> <20060208185836.GA55307@xor.obsecurity.org> <20060209092139.GB21718@trispen.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 09 Feb 2006 11:21:39 +0200, Jacques Fourie <jf@trispen.com> wrote:

> On Wed, Feb 08, 2006 at 01:58:36PM -0500, Kris Kennaway wrote:
>> On Wed, Feb 08, 2006 at 06:41:41PM +0200, Jacques Fourie wrote:
>> > Hi,
>> >
>> > I am pre-loading an image (used as MFS root) from the boot loader on  
>> FreeBSD
>> > 4.9 by using 'load -t mfs_root mfsroot' in loader.conf. The size of  
>> this
>> > image is 64M. If I have 4G of RAM in the machine, the 64M size causes  
>> the
>> > kernel to panic almost immediately. With only 2G of RAM the kernel  
>> boots
>> > without a problem. I have tried to increase the KVA_PAGES value to  
>> 512 but
>> > the kernel still panics. If I decrease the image size to 40M the  
>> kernel
>> > boots successfully on a machine with 4G of RAM. Any ideas as to how I  
>> can go
>> > about finding (or fixing) this problem?
>>
>> Start by showing the panic ;-)
>>
>> Kris
>
> Hi,
>
> Here is the kernel panic :). The kernel was compiled with
> 'makeoptions DEBUG=-g' and DDB was included in the kernel. Unfortunately  
> the
> stack trace from DDB does not seem to show any symbols. I've created this
> panic by installing FreeBSD 4.11-RELEASE with a GENERIC kernel that has
> 'makeoptions DEBUG=-g' and DDB included.
>
> Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
>         The Regents of the University of California. All rights reserved.
>
>
> Fatal trap 12: page fault while in kernel mode
> fault virtual address   = 0xbff1e000
> fault code              = supervisor write, page not present
> instruction pointer     = 0x8:0xc03afa66
> stack pointer           = 0x10:0xc4589f88
> frame pointer           = 0x10:0xc4589f90
> code segment            = base 0x0, limit 0xfffff, type 0x1b
>                         = DPL 0, pres 1, def32 1, gran 1
> processor eflags        = interrupt enabled, resume, IOPL = 0
> current process         = Idle
> interrupt mask          = net tty bio cam
> kernel: type 12 trap, code=0
> Stopped at      0xc03afa66:     movl    %eax,0xbfc00000(,%edx,4)
> db> t
> (null)(c4dac000,f3cd2000,f76f0000,3,c0497f14) at 0xc03afa66
> (null)(458e000,f7f78000,c45ac000,c4589ff8,c023051c) at 0xc0363027
> (null)(0,4586c00,458e000,0,c0132e2d) at 0xc035c313
> (null)(0,0,0,0,0) at 0xc023051c
> (null)() at 0xc0132e2d
> db>
>
> Here is the output from a 'gdb -k' session on the kernel in question :
>
> # cd /usr/src/sys/compile/TEST
> # gdb -k kernel.debug
> GNU gdb 4.18 (FreeBSD)
> Copyright 1998 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you  
> are
> welcome to change it and/or distribute copies of it under certain  
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for  
> details.
> This GDB was configured as "i386-unknown-freebsd"...Deprecated bfd_read  
> called at  
> /usr/src/gnu/usr.bin/binutils/gdb/../../../../contrib/gdb/gdb/dbxread.c  
> line 2627 in elfstab_build_psymtabs
> Deprecated bfd_read called at  
> /usr/src/gnu/usr.bin/binutils/gdb/../../../../contrib/gdb/gdb/dbxread.c  
> line 933 in fill_symbuf
>
> (kgdb) list *(0xc03afa66)
> 0xc03afa66 is in pmap_map (../../i386/i386/pmap.c:799).
> 794     pmap_kenter(vm_offset_t va, vm_paddr_t pa)
> 795     {
> 796             pt_entry_t *pte;
> 797
> 798             pte = vtopte(va);
> 799             *pte = pa | PG_RW | PG_V | pgeflag;
> 800             invltlb_1pg(va);
> 801     }
> 802
> 803     /*
> (kgdb) list *(0xc0363027)
> 0xc0363027 is in vm_page_startup (../../vm/vm_page.c:296).
> 291             /*
> 292              * Validate these addresses.
> 293              */
> 294
> 295             new_end = trunc_page(end - page_range * sizeof(struct  
> vm_page));
> 296             mapped = pmap_map(mapped, new_end, end,
> 297                 VM_PROT_READ | VM_PROT_WRITE);
> 298
> 299             /*
> 300              * Clear all of the page structures
> (kgdb) list *(0xc035c313)
> 0xc035c313 is in vm_mem_init (../../vm/vm_init.c:108).
> 103              * Initializes resident memory structures. From here on,  
> all physical
> 104              * memory is accounted for, and we use only virtual  
> addresses.
> 105              */
> 106
> 107             vm_set_page_size();
> 108             virtual_avail = vm_page_startup(avail_start, avail_end,  
> virtual_avail);
> 109             /*
> 110              * Initialize other VM packages
> 111              */
> 112             vm_object_init()
>
>
> regards,
> jacques

I have installed 6.0-RELEASE and the behaviour is still the same. If I try  
to pre-load an md_image of 64M with 4G of RAM installed, the kernel panics  
early in the boot cycle. Here is the panic on 6.0-RELEASE:

131072K of memory above 4GB ignored
Copyright (c) 1992-2005 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
         The Regents of the University of California. All rights reserved.
FreeBSD 6.0-RELEASE #0: Thu Nov  3 09:36:13 UTC 2005
     root@x64.samsco.home:/usr/obj/usr/src/sys/GENERIC


Fatal trap 12: page fault while in kernel mode
fault virtual address   = 0xbff1e000
fault code              = supervisor write, page not present
instruction pointer     = 0x20:0xc0802464
stack pointer           = 0x28:0xc4c20d00
frame pointer           = 0x28:0xc4c20d0c
code segment            = base 0x0, limit 0xfffff, type 0x1b
                         = DPL 0, pres 1, def32 1, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 0 ()
trap number             = 12
panic: page fault
Uptime: 1s

I will add DDB to the kernel to try and figure out what is going on...

regards,
jacques




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?op.s4rjho0bwikogb>