summaryrefslogtreecommitdiffstats
path: root/sys/i386/i386
diff options
context:
space:
mode:
authorroyger <royger@FreeBSD.org>2013-12-05 18:08:05 +0000
committerroyger <royger@FreeBSD.org>2013-12-05 18:08:05 +0000
commit00083cffc40c9a4148dda62f8817f03f5884b15c (patch)
tree7cd273c80ea5d2bfa2118107513388a6d01a77a4 /sys/i386/i386
parent2cbf0740295c624f6395e2abb71e4da935a3ab6c (diff)
downloadFreeBSD-src-00083cffc40c9a4148dda62f8817f03f5884b15c.zip
FreeBSD-src-00083cffc40c9a4148dda62f8817f03f5884b15c.tar.gz
MFC 258176:
Fix accounting for hw.realmem on the i386 and amd64 platforms. sys/i386/i386/machdep.c: sys/amd64/amd64/machdep.c: The value reported by FreeBSD as "real memory" when booting doesn't match what is later reported by sysctl as hw.realmem. This is due to the fact that the value printed during the boot process is fetched from smbios data (when possible), and accounts for holes in physical memory. On the other hand, the value of hw.realmem is unconditionally set to be one larger than the highest page of the physical address space. Fix this by setting hw.realmem to the same value printed during boot, this makes hw.realmem honour it's name and account properly for physical memory present in the system. Submitted by: Roger Pau Monné Reviewed by: gibbs Approved by: gibbs (mentor) Approved by: re (gjb)
Diffstat (limited to 'sys/i386/i386')
-rw-r--r--sys/i386/i386/machdep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index ca15f27..2e1785b 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -294,7 +294,6 @@ cpu_startup(dummy)
#ifdef PERFMON
perfmon_init();
#endif
- realmem = Maxmem;
/*
* Display physical memory if SMBIOS reports reasonable amount.
@@ -308,6 +307,7 @@ cpu_startup(dummy)
if (memsize < ptoa((uintmax_t)cnt.v_free_count))
memsize = ptoa((uintmax_t)Maxmem);
printf("real memory = %ju (%ju MB)\n", memsize, memsize >> 20);
+ realmem = atop(memsize);
/*
* Display any holes after the first chunk of extended memory.
OpenPOWER on IntegriCloud