Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 May 2003 21:25:22 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 31677 for review
Message-ID:  <200305230425.h4N4PMhg010929@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=31677

Change 31677 by peter@peter_hammer on 2003/05/22 21:24:58

	hopefully expand the direct map segment in chunks of 1GB
	to cover all physical memory up to 512GB.  That should be
	enough for a while.

Affected files ...

.. //depot/projects/hammer/sys/amd64/amd64/pmap.c#14 edit
.. //depot/projects/hammer/sys/amd64/include/pmap.h#11 edit

Differences ...

==== //depot/projects/hammer/sys/amd64/amd64/pmap.c#14 (text+ko) ====

@@ -168,6 +168,7 @@
 static boolean_t pmap_initialized = FALSE;	/* Has pmap_init completed? */
 
 static int nkpt;
+static int ndmpdp;
 vm_offset_t kernel_vm_end;
 
 static u_int64_t	KPTphys;	/* phys addr of kernel level 1 */
@@ -365,8 +366,11 @@
 	KPDPphys = allocpages(NKPML4E);
 	KPDphys = allocpages(NKPDPE);
 
+	ndmpdp = (ptoa(Maxmem) + NBPDP - 1) >> PDPSHIFT;
+	if (ndmpdp < 1)
+		ndmpdp = 1;
 	DMPDPphys = allocpages(NDMPML4E);
-	DMPDphys = allocpages(NDMPDPE);
+	DMPDphys = allocpages(ndmpdp);
 
 	/* Fill in the underlying page table pages */
 	/* Read-only from zero to physfree */
@@ -399,13 +403,13 @@
 
 
 	/* Now set up the direct map space using 2MB pages */
-	for (i = 0; i < NPDEPG; i++) {
+	for (i = 0; i < NPDEPG * ndmpdp; i++) {
 		((pd_entry_t *)DMPDphys)[i] = i << PDRSHIFT;
 		((pd_entry_t *)DMPDphys)[i] |= PG_RW | PG_V | PG_PS;
 	}
 
 	/* And the direct map space's PDP */
-	for (i = 0; i < NDMPDPE; i++) {
+	for (i = 0; i < ndmpdp; i++) {
 		((pdp_entry_t *)DMPDPphys)[i] = DMPDphys + (i << PAGE_SHIFT);
 		((pdp_entry_t *)DMPDPphys)[i] |= PG_RW | PG_V | PG_U;
 	}

==== //depot/projects/hammer/sys/amd64/include/pmap.h#11 (text+ko) ====

@@ -108,7 +108,6 @@
 #define	NUPDE		(NUPDPE*NPDEPG)	/* number of userland PD entries */
 
 #define	NDMPML4E	1		/* number of dmap PML4 slots */
-#define	NDMPDPE		1		/* number of dmap PDP slots */
 
 /*
  * The *PDI values control the layout of virtual memory



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