From owner-p4-projects@FreeBSD.ORG Fri Jul 21 18:25:21 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A2A7216A4E1; Fri, 21 Jul 2006 18:25:21 +0000 (UTC) X-Original-To: perforce@freebsd.org 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 7902016A4DD for ; Fri, 21 Jul 2006 18:25:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 05B6B43D45 for ; Fri, 21 Jul 2006 18:25:21 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k6LIPKnG092633 for ; Fri, 21 Jul 2006 18:25:20 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k6LIPKE8092630 for perforce@freebsd.org; Fri, 21 Jul 2006 18:25:20 GMT (envelope-from jhb@freebsd.org) Date: Fri, 21 Jul 2006 18:25:20 GMT Message-Id: <200607211825.k6LIPKE8092630@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 102067 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jul 2006 18:25:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=102067 Change 102067 by jhb@jhb_zion on 2006/07/21 18:25:14 Don't allow MAXMEM/hw.physmem to extend the last memory segment size if we used an SMAP, treating the SMAP as authoritative on what parts of physical address space are RAM. This makes hw.physmem safe to use with ACPI. Affected files ... .. //depot/projects/smpng/sys/amd64/amd64/machdep.c#54 edit .. //depot/projects/smpng/sys/i386/i386/machdep.c#110 edit Differences ... ==== //depot/projects/smpng/sys/amd64/amd64/machdep.c#54 (text+ko) ==== @@ -951,13 +951,6 @@ (boothowto & RB_VERBOSE)) printf("Physical memory use set to %ldK\n", Maxmem * 4); - /* - * If Maxmem has been increased beyond what the system has detected, - * extend the last memory segment to the new limit. - */ - if (atop(physmap[physmap_idx + 1]) < Maxmem) - physmap[physmap_idx + 1] = ptoa((vm_paddr_t)Maxmem); - /* call pmap initialization to make new kernel address space */ pmap_bootstrap(&first); ==== //depot/projects/smpng/sys/i386/i386/machdep.c#110 (text+ko) ==== @@ -1633,7 +1633,7 @@ getmemsize(int first) { int i, physmap_idx, pa_indx, da_indx; - int hasbrokenint12; + int hasbrokenint12, has_smap; u_long physmem_tunable; u_int extmem; struct vm86frame vmf; @@ -1742,6 +1742,7 @@ if (boothowto & RB_VERBOSE) printf("SMAP type=%02x base=%016llx len=%016llx\n", smap->type, smap->base, smap->length); + has_smap = 1; if (smap->type != 0x01) continue; @@ -1888,10 +1889,11 @@ printf("Physical memory use set to %ldK\n", Maxmem * 4); /* - * If Maxmem has been increased beyond what the system has detected, - * extend the last memory segment to the new limit. + * If Maxmem has been increased beyond what the system has detected + * and we didn't get the memory layout via SMAP, extend the last + * memory segment to the new limit. */ - if (atop(physmap[physmap_idx + 1]) < Maxmem) + if (!has_smap && atop(physmap[physmap_idx + 1]) < Maxmem) physmap[physmap_idx + 1] = ptoa((vm_paddr_t)Maxmem); /* call pmap initialization to make new kernel address space */