mirror of
https://github.com/opnsense/src.git
synced 2026-04-29 18:32:49 -04:00
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
This commit is contained in:
parent
564b641ef9
commit
46ea68dd10
4 changed files with 6 additions and 6 deletions
|
|
@ -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! */
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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! */
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue