From 349db715f70e113387dc70f7ce4a9ce172f11e8b Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 16 Nov 2022 11:17:07 -0500 Subject: [PATCH 02/52] mips: Bump MAXPAGESIZES and fill out the pagesizes[] array --- sys/mips/include/param.h | 4 ++++ sys/mips/mips/pmap_mips64.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/sys/mips/include/param.h b/sys/mips/include/param.h index a5a95cce2a14..1c9bc6457e02 100644 --- a/sys/mips/include/param.h +++ b/sys/mips/include/param.h @@ -164,7 +164,11 @@ #define NBPDR (1 << PDRSHIFT) /* bytes/pagedir */ #define SEGMASK (NBSEG - 1) /* byte offset into segment */ +#ifdef MIPS64_NEW_PMAP +#define MAXPAGESIZES 2 /* max supported pagesizes */ +#else #define MAXPAGESIZES 1 /* max supported pagesizes */ +#endif #define MAXDUMPPGS 1 /* xxx: why is this only one? */ diff --git a/sys/mips/mips/pmap_mips64.c b/sys/mips/mips/pmap_mips64.c index 387ed3bb30f5..f7ba7b43807f 100644 --- a/sys/mips/mips/pmap_mips64.c +++ b/sys/mips/mips/pmap_mips64.c @@ -565,10 +565,17 @@ pmap_init(void) int pv_npg; printf("pmap init start\n"); + /* * Are large page mappings enabled? */ 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]")); + pagesizes[1] = NBPDR; + } + /* * Initialize the pv chunk list mutex. */ -- 2.41.0