From 9a52756044676370f20527b85d450d5fc3ac32e5 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Wed, 30 Jan 2019 02:07:13 +0000 Subject: i386: Merge PAE and non-PAE pmaps into same kernel. Effectively all i386 kernels now have two pmaps compiled in: one managing PAE pagetables, and another non-PAE. The implementation is selected at cold time depending on the CPU features. The vm_paddr_t is always 64bit now. As result, nx bit can be used on all capable CPUs. Option PAE only affects the bus_addr_t: it is still 32bit for non-PAE configs, for drivers compatibility. Kernel layout, esp. max kernel address, low memory PDEs and max user address (same as trampoline start) are now same for PAE and for non-PAE regardless of the type of page tables used. Non-PAE kernel (when using PAE pagetables) can handle physical memory up to 24G now, larger memory requires re-tuning the KVA consumers and instead the code caps the maximum at 24G. Unfortunately, a lot of drivers do not use busdma(9) properly so by default even 4G barrier is not easy. There are two tunables added: hw.above4g_allow and hw.above24g_allow, the first one is kept enabled for now to evaluate the status on HEAD, second is only for dev use. i386 now creates three freelists if there is any memory above 4G, to allow proper bounce pages allocation. Also, VM_KMEM_SIZE_SCALE changed from 3 to 1. The PAE_TABLES kernel config option is retired. In collaboarion with: pho Discussed with: emaste Reviewed by: markj MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D18894 --- lib/libkvm/kvm_i386.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/libkvm') diff --git a/lib/libkvm/kvm_i386.h b/lib/libkvm/kvm_i386.h index 5440db2adc69..1a4d672f16f3 100644 --- a/lib/libkvm/kvm_i386.h +++ b/lib/libkvm/kvm_i386.h @@ -67,14 +67,16 @@ typedef uint64_t i386_pde_pae_t; _Static_assert(PAGE_SHIFT == I386_PAGE_SHIFT, "PAGE_SHIFT mismatch"); _Static_assert(PAGE_SIZE == I386_PAGE_SIZE, "PAGE_SIZE mismatch"); _Static_assert(PAGE_MASK == I386_PAGE_MASK, "PAGE_MASK mismatch"); +#if 0 _Static_assert(NPTEPG == I386_NPTEPG, "NPTEPG mismatch"); -_Static_assert(PDRSHIFT == I386_PDRSHIFT, "PDRSHIFT mismatch"); _Static_assert(NBPDR == I386_NBPDR, "NBPDR mismatch"); +#endif +_Static_assert(PDRSHIFT_NOPAE == I386_PDRSHIFT, "PDRSHIFT mismatch"); _Static_assert(PG_V == I386_PG_V, "PG_V mismatch"); _Static_assert(PG_PS == I386_PG_PS, "PG_PS mismatch"); -_Static_assert((u_int)PG_FRAME == I386_PG_FRAME, "PG_FRAME mismatch"); -_Static_assert(PG_PS_FRAME == I386_PG_PS_FRAME, "PG_PS_FRAME mismatch"); +_Static_assert((u_int)PG_FRAME_NOPAE == I386_PG_FRAME, "PG_FRAME mismatch"); +_Static_assert(PG_PS_FRAME_NOPAE == I386_PG_PS_FRAME, "PG_PS_FRAME mismatch"); #endif int _i386_native(kvm_t *); -- cgit v1.2.3