summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2003-04-07 14:27:19 +0000
committerjake <jake@FreeBSD.org>2003-04-07 14:27:19 +0000
commit204303829b2377e9906ca6134117bc854c094c8e (patch)
treedf3f7543c3cf950addbb2bd70ac68ae670fae1ec /sys/amd64/include
parent0dc33fa1034609689d0515827253347bc5e1a1a1 (diff)
downloadFreeBSD-src-204303829b2377e9906ca6134117bc854c094c8e.zip
FreeBSD-src-204303829b2377e9906ca6134117bc854c094c8e.tar.gz
Better fix for previous previous which still allows the 4megs of kva at
the top of the address space to be reclaimed. The problem is that with the APTD gone the mapable kernel address space runs right to the end of the 32 bit address space. As a max this is 0x100000000, which can't be represented in 32 bits, so we have to use ptd entry n-1 and pte offset n-1, instead of ptd entry n and pte offset 0. There's still 1 page we can't use, but we gain just under 4 megs of kva (8 megs with PAE). Sponsored by: DARPA, Network Associates Laboratories
Diffstat (limited to 'sys/amd64/include')
-rw-r--r--sys/amd64/include/pmap.h4
-rw-r--r--sys/amd64/include/vmparam.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h
index b5e2378..d1e2975 100644
--- a/sys/amd64/include/pmap.h
+++ b/sys/amd64/include/pmap.h
@@ -111,7 +111,7 @@
#ifdef SMP
#define NKPDE (KVA_PAGES - 1) /* number of page tables/pde's */
#else
-#define NKPDE (KVA_PAGES - 1) /* number of page tables/pde's */
+#define NKPDE (KVA_PAGES) /* number of page tables/pde's */
#endif
#endif
@@ -127,7 +127,7 @@
#define MPPTDI (NPDEPTD-1) /* per cpu ptd entry */
#define KPTDI (MPPTDI-NKPDE) /* start of kernel virtual pde's */
#else
-#define KPTDI ((NPDEPTD-1)-NKPDE)/* start of kernel virtual pde's */
+#define KPTDI (NPDEPTD-NKPDE)/* start of kernel virtual pde's */
#endif /* SMP */
#define PTDPTDI (KPTDI-NPGPTD) /* ptd entry that points to ptd! */
diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h
index f02d508..bb7c7e1 100644
--- a/sys/amd64/include/vmparam.h
+++ b/sys/amd64/include/vmparam.h
@@ -90,7 +90,7 @@
* messy at times, but hey, we'll do anything to save a page :-)
*/
-#define VM_MAX_KERNEL_ADDRESS VADDR(KPTDI+NKPDE, 0)
+#define VM_MAX_KERNEL_ADDRESS VADDR(KPTDI+NKPDE-1, NPTEPG-1)
#define VM_MIN_KERNEL_ADDRESS VADDR(PTDPTDI, PTDPTDI)
#define KERNBASE VADDR(KPTDI, 0)
OpenPOWER on IntegriCloud