From fd859d1f827f1738ff9de1ad265c4ab1ad0288d2 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Tue, 22 Nov 2022 13:05:15 -0500 Subject: [PATCH 19/52] mips: Add new page sizes Extend the pagesizes array to record support for larger TLB entry sizes. --- sys/mips/include/param.h | 5 ++++- sys/mips/mips/pmap_mips64.c | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sys/mips/include/param.h b/sys/mips/include/param.h index 1c9bc6457e02..2c1eb4ad0877 100644 --- a/sys/mips/include/param.h +++ b/sys/mips/include/param.h @@ -165,7 +165,10 @@ #define SEGMASK (NBSEG - 1) /* byte offset into segment */ #ifdef MIPS64_NEW_PMAP -#define MAXPAGESIZES 2 /* max supported pagesizes */ +/* + * The following page sizes are supported: 4KB, 2MB, 8MB, 32MB, 128MB, 512MB. + */ +#define MAXPAGESIZES 6 /* max supported pagesizes */ #else #define MAXPAGESIZES 1 /* max supported pagesizes */ #endif diff --git a/sys/mips/mips/pmap_mips64.c b/sys/mips/mips/pmap_mips64.c index cd6b3c338d23..da5f92f47be1 100644 --- a/sys/mips/mips/pmap_mips64.c +++ b/sys/mips/mips/pmap_mips64.c @@ -577,9 +577,13 @@ pmap_init(void) */ TUNABLE_INT_FETCH("vm.pmap.pg_ps_enabled", &pg_ps_enabled); if (pg_ps_enabled) { - KASSERT(MAXPAGESIZES > 1 && pagesizes[1] == 0, - ("pmap_init: can't assign to pagesizes[1]")); + KASSERT(MAXPAGESIZES == 6, + ("pmap_init: invalid MAXPAGESIZES value")); pagesizes[1] = NBPDR; + pagesizes[2] = 8 * 1024 * 1024; + pagesizes[3] = 32 * 1024 * 1024; + pagesizes[4] = 128 * 1024 * 1024; + pagesizes[5] = 512 * 1024 * 1024; } /* -- 2.41.0