From 6e64bebb6ff828f3f65be61b0563d9c5569625b2 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Wed, 9 Sep 2020 21:01:36 +0000 Subject: [PATCH] amd64: report support for 1G superpages in getpagesizes(2). Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24652 --- sys/amd64/amd64/pmap.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 0ef96a29dd85..ddc012f04123 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2382,6 +2382,11 @@ pmap_init(void) KASSERT(MAXPAGESIZES > 1 && pagesizes[1] == 0, ("pmap_init: can't assign to pagesizes[1]")); pagesizes[1] = NBPDR; + if ((amd_feature & AMDID_PAGE1GB) != 0) { + KASSERT(MAXPAGESIZES > 1 && pagesizes[2] == 0, + ("pmap_init: can't assign to pagesizes[2]")); + pagesizes[2] = NBPDP; + } } /*