Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Sep 2009 17:09:34 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r197317 - in head/sys: amd64/amd64 i386/i386
Message-ID:  <200909181709.n8IH9YLu096735@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Fri Sep 18 17:09:33 2009
New Revision: 197317
URL: http://svn.freebsd.org/changeset/base/197317

Log:
  When superpages are enabled, add the 2 or 4MB page size to the array of
  supported page sizes.
  
  Reviewed by:	jhb
  MFC after:	3 weeks

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/i386/i386/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Fri Sep 18 17:04:57 2009	(r197316)
+++ head/sys/amd64/amd64/pmap.c	Fri Sep 18 17:09:33 2009	(r197317)
@@ -701,6 +701,11 @@ pmap_init(void)
 	 * 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;
+	}
 
 	/*
 	 * Calculate the size of the pv head table for superpages.

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Fri Sep 18 17:04:57 2009	(r197316)
+++ head/sys/i386/i386/pmap.c	Fri Sep 18 17:09:33 2009	(r197317)
@@ -702,6 +702,11 @@ pmap_init(void)
 	 * 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;
+	}
 
 	/*
 	 * Calculate the size of the pv head table for superpages.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909181709.n8IH9YLu096735>