From owner-freebsd-hackers Sun Jun 23 18:25: 0 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from pintail.mail.pas.earthlink.net (pintail.mail.pas.earthlink.net [207.217.120.122]) by hub.freebsd.org (Postfix) with ESMTP id 9A53037B404 for ; Sun, 23 Jun 2002 18:24:54 -0700 (PDT) Received: from pool0336.cvx22-bradley.dialup.earthlink.net ([209.179.199.81] helo=mindspring.com) by pintail.mail.pas.earthlink.net with esmtp (Exim 3.33 #2) id 17MIam-0000WW-00; Sun, 23 Jun 2002 18:24:32 -0700 Message-ID: <3D1674A3.DA4648ED@mindspring.com> Date: Sun, 23 Jun 2002 18:23:47 -0700 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: John Kozubik Cc: Patrick Thomas , Nielsen , hackers@FreeBSD.ORG Subject: Re: (jail) problem and a (possible) solution ? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG John Kozubik wrote: > Terry, Patrick, et al, > > For 4.5, you have to hack ldscript.i386 and pmap.h. I've posted > > on how to do this before (should be in the archives). > > Actually, in 4.5 you only need to set: > > options KVA_PAGES=512 > > and recompile your kernel. It looks like 4.5-RELEASE was the first > release version to _not_ require hacking sys/i386/include/pmap.h and > sys/conf/ldscript.i386. As you can see by looking at a 4.5-RELEASE > pmap.h: > > #define NKPDE (KVA_PAGES - 2) /* addressable number of page tables/pde's > */ > #else > #define NKPDE (KVA_PAGES - 1) /* addressable number of page tables/pde's > */ > > the offsets that Terry spoke of are already in place. This is in contrast > to 4.4-RELEASE: > > #define NKPDE 254 /* addressable number of page > tables/pde's */ > #else > #define NKPDE 255 /* addressable number of page > tables/pde's */ Yes; this is 1.65.2.3 This is my bad. It's the system I was using as a reference; it has two kernel source trees; the first one has 1.65, the second is a RELENG_4, which makes it a 1.65.2.3. > Where everything was hard coded to match the default KVA_PAGES value. > Further, looking at ldscript.i386 we see in 4.5-RELEASE: > > . = kernbase + 0x00100000 + SIZEOF_HEADERS; > > whereas in 4.4-RELEASE and earlier, we saw: > > . = 0xc0100000 + SIZEOF_HEADERS; > > Which means that in 4.4 you had to change 0xc0100000 to 0x80100000 for a > 2gig KVA. In 4.5, however, you don't have to change ldscript.i386 at all, > because it is now a relative value that takes kernbase into account. Yes, this is 1.4.2.1. The commit comments for ldscript.i386 are incredibly misleading as to what the merge actually does. The derivation of "kernbase" itself is also dependent on a third change, which is not documented, either. > So, if you are running 4.0 - 4.4, you need to edit ldscript.i386 and > change 0xc0100000 to 0x8010000 (for a 2gig KVA), then you need to edit > pmap.h and change the two lines I pasted above from 254 and 255 to 510 and > 511, respectively. Finally, you need to set: > > options KVA_PAGES=512 > > in your kernel config, then recompile your kernel. > > But, if you are running 4.5 or 4.6, from the code I pasted above, it looks > like all you have to do is set: > > options KVA_PAGES=512 > > in your kernel config, then recompile your kernel. > > ----- > > Another explanation of this concept can be found here: > > http://www.kozubik.com/docs/original_kva_increase.txt > > I am posting today mainly to get a little more information stored in the > archives. > > In addition, I myself have a question regarding the default settings of > 4.5 and 4.6 - by looking at the NKPDE values in the 4.4-RELEASE version of > pmap.h, the values of 254 and 255 indicate that they are hard coded for a > default of KVA_PAGES=256, however 4.5 and 4.6 have a KVA_PAGES=260 setting > in LINT, which I assume is also the default ... why the increase of 4 > since 4.4-RELEASE ? I believe that this would be because of the desire for the number of *usable* pages, since you have to subtract out the ones that are not global to all CPUs. The LINT value is *not* the default. It went in in 1.954 of NOTES (LINT is a generated file). I don't know why Peter did this. It says "and a test" in the commit, an since it's only comments and the option itself, I guess that means that the value of 260 is the test that the commit message was referencing. So I guess 4.5 is actually OK, but one of my local boxes is not. My main frustration with this has always been that the information in the Handbook has always been insufficient to actually make the change and have it work. I guess I'm glad that it made it into 4.5, even if it surprised me. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message