Subject: Re: Uninitalized kernel variable uvm_maxkaddr
To: None <>
From: Bill Studenmund <>
List: tech-kern
Date: 05/31/2005 18:26:10
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, May 31, 2005 at 06:57:57AM -0700, Amatus wrote:
> Hi all, uvm_maxkaddr is never initalized before it's used. It's first
> use is in uvm_pageboot_alloc() (at least on i386) where it's compared
> against:
>         if (uvm_maxkaddr < (addr + size)) {
>                 uvm_maxkaddr =3D pmap_growkernel(addr + size);
>                 if (uvm_maxkaddr < (addr + size))
>                         panic("uvm_pageboot_alloc: pmap_growkernel()
> failed");
>         }
> It doesn't cause a problem because it seems to always be 0 on boot and
> is then set to a more reasonable value (something like 0xc100000000).
> It seems to me it should be initalized in pmap_bootstrap(). Can someone
> tell me why this isn't the case?

I can't speak as to _if_ it should be initialized earlier, but it will=20
always be initialized to zero. It doesn't just "seem" to, but it will=20
always be zero.

Its definition is:

vaddr_t uvm_maxkaddr;

which will cause it to be in the bss section, which will always be zeroed=
on load.

Take care,


Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.3 (NetBSD)