From owner-p4-projects@FreeBSD.ORG Thu May 22 21:25:24 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 18F0937B404; Thu, 22 May 2003 21:25:24 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BCD6E37B401 for ; Thu, 22 May 2003 21:25:23 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6112143F75 for ; Thu, 22 May 2003 21:25:23 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h4N4PN0U010932 for ; Thu, 22 May 2003 21:25:23 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h4N4PMhg010929 for perforce@freebsd.org; Thu, 22 May 2003 21:25:22 -0700 (PDT) Date: Thu, 22 May 2003 21:25:22 -0700 (PDT) Message-Id: <200305230425.h4N4PMhg010929@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 31677 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2003 04:25:25 -0000 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