summaryrefslogtreecommitdiffstats
path: root/sys/i386/include
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-04-27 08:02:12 +0000
committerkib <kib@FreeBSD.org>2015-04-27 08:02:12 +0000
commitfacaa68fb95e65d46783aee588e7c99ae11d5e76 (patch)
tree2490a68d0f0407f65b7522b1e69ee07cc835dfe8 /sys/i386/include
parentbc0b39657e72b1c736b37854e76ac5d962c82641 (diff)
downloadFreeBSD-src-facaa68fb95e65d46783aee588e7c99ae11d5e76.zip
FreeBSD-src-facaa68fb95e65d46783aee588e7c99ae11d5e76.tar.gz
MFC r281495:
Add config option PAE_TABLES for the i386 kernel. It switches pmap to use PAE format for the page tables, but does not incur other consequences of the full PAE config. In particular, vm_paddr_t and bus_addr_t are left 32bit, and max supported memory is still limited by 4GB. The option allows to have nx permissions for memory mappings on i386 kernel, while keeping the usual i386 KBI and avoiding the kernel data sizing problems typical for the PAE config.
Diffstat (limited to 'sys/i386/include')
-rw-r--r--sys/i386/include/param.h2
-rw-r--r--sys/i386/include/pmap.h23
-rw-r--r--sys/i386/include/vmparam.h6
3 files changed, 17 insertions, 14 deletions
diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h
index d7148ae..54477c1 100644
--- a/sys/i386/include/param.h
+++ b/sys/i386/include/param.h
@@ -90,7 +90,7 @@
#define PAGE_MASK (PAGE_SIZE-1)
#define NPTEPG (PAGE_SIZE/(sizeof (pt_entry_t)))
-#ifdef PAE
+#if defined(PAE) || defined(PAE_TABLES)
#define NPGPTD 4
#define PDRSHIFT 21 /* LOG2(NBPDR) */
#define NPGPTD_SHIFT 9
diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h
index 2c9a409..0d8057f 100644
--- a/sys/i386/include/pmap.h
+++ b/sys/i386/include/pmap.h
@@ -63,7 +63,7 @@
#define PG_AVAIL2 0x400 /* < programmers use */
#define PG_AVAIL3 0x800 /* \ */
#define PG_PDE_PAT 0x1000 /* PAT PAT index */
-#ifdef PAE
+#if defined(PAE) || defined(PAE_TABLES)
#define PG_NX (1ull<<63) /* No-execute */
#endif
@@ -71,7 +71,7 @@
/* Our various interpretations of the above */
#define PG_W PG_AVAIL1 /* "Wired" pseudoflag */
#define PG_MANAGED PG_AVAIL2
-#ifdef PAE
+#if defined(PAE) || defined(PAE_TABLES)
#define PG_FRAME (0x000ffffffffff000ull)
#define PG_PS_FRAME (0x000fffffffe00000ull)
#else
@@ -110,7 +110,7 @@
* is 1 Gigabyte. Double everything. It must be a multiple of 8 for PAE.
*/
#ifndef KVA_PAGES
-#ifdef PAE
+#if defined(PAE) || defined(PAE_TABLES)
#define KVA_PAGES 512
#else
#define KVA_PAGES 256
@@ -128,11 +128,14 @@
* be calculated as follows:
* max_phys / PAGE_SIZE * sizeof(struct vm_page) / NBPDR
* PAE: max_phys 16G, sizeof(vm_page) 76, NBPDR 2M, 152 page table pages.
+ * PAE_TABLES: max_phys 4G, sizeof(vm_page) 68, NBPDR 2M, 36 page table pages.
* Non-PAE: max_phys 4G, sizeof(vm_page) 68, NBPDR 4M, 18 page table pages.
*/
#ifndef NKPT
-#ifdef PAE
+#if defined(PAE)
#define NKPT 240
+#elif defined(PAE_TABLES)
+#define NKPT 60
#else
#define NKPT 30
#endif
@@ -166,7 +169,7 @@
#include <vm/_vm_radix.h>
-#ifdef PAE
+#if defined(PAE) || defined(PAE_TABLES)
typedef uint64_t pdpt_entry_t;
typedef uint64_t pd_entry_t;
@@ -193,7 +196,7 @@ extern pt_entry_t PTmap[];
extern pd_entry_t PTD[];
extern pd_entry_t PTDpde[];
-#ifdef PAE
+#if defined(PAE) || defined(PAE_TABLES)
extern pdpt_entry_t *IdlePDPT;
#endif
extern pd_entry_t *IdlePTD; /* physical address of "Idle" state directory */
@@ -331,7 +334,7 @@ pmap_kextract(vm_offset_t va)
#define PT_UPDATES_FLUSH()
#endif
-#if defined(PAE) && !defined(XEN)
+#if (defined(PAE) || defined(PAE_TABLES)) && !defined(XEN)
#define pde_cmpset(pdep, old, new) atomic_cmpset_64_i586(pdep, old, new)
#define pte_load_store(ptep, pte) atomic_swap_64_i586(ptep, pte)
@@ -340,7 +343,7 @@ pmap_kextract(vm_offset_t va)
extern pt_entry_t pg_nx;
-#elif !defined(PAE) && !defined(XEN)
+#elif !defined(PAE) && !defined(PAE_TABLES) && !defined(XEN)
#define pde_cmpset(pdep, old, new) atomic_cmpset_int(pdep, old, new)
#define pte_load_store(ptep, pte) atomic_swap_int(ptep, pte)
@@ -375,8 +378,8 @@ struct pmap {
cpuset_t pm_active; /* active on cpus */
struct pmap_statistics pm_stats; /* pmap statistics */
LIST_ENTRY(pmap) pm_list; /* List of all pmaps */
-#ifdef PAE
- pdpt_entry_t *pm_pdpt; /* KVA of page director pointer
+#if defined(PAE) || defined(PAE_TABLES)
+ pdpt_entry_t *pm_pdpt; /* KVA of page directory pointer
table */
#endif
struct vm_radix pm_root; /* spare page table pages */
diff --git a/sys/i386/include/vmparam.h b/sys/i386/include/vmparam.h
index 9a0dfd8..2e75c8c 100644
--- a/sys/i386/include/vmparam.h
+++ b/sys/i386/include/vmparam.h
@@ -120,11 +120,11 @@
#endif
/*
- * Level 0 reservations consist of 512 pages under PAE and 1024 pages
- * otherwise.
+ * Level 0 reservations consist of 512 pages when PAE pagetables are
+ * used, and 1024 pages otherwise.
*/
#ifndef VM_LEVEL_0_ORDER
-#ifdef PAE
+#if defined(PAE) || defined(PAE_TABLES)
#define VM_LEVEL_0_ORDER 9
#else
#define VM_LEVEL_0_ORDER 10
OpenPOWER on IntegriCloud