PERFORCE change 102067 for review
John Baldwin
jhb at FreeBSD.org
Fri Jul 21 18:25:21 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=102067
Change 102067 by jhb at 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 */
More information about the p4-projects
mailing list