From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 19:20:02 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B7A9106564A for ; Mon, 21 Jun 2010 19:20:02 +0000 (UTC) (envelope-from andreast-list@fgznet.ch) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 299FE8FC13 for ; Mon, 21 Jun 2010 19:20:00 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-8-131.flashcable.ch [91.190.8.131]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id o5LJJvNp025233; Mon, 21 Jun 2010 21:19:59 +0200 (CEST) (envelope-from andreast-list@fgznet.ch) Message-ID: <4C1FBB5D.4000306@fgznet.ch> Date: Mon, 21 Jun 2010 21:19:57 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.10) Gecko/20100512 Lightning/1.0b1 Thunderbird/3.0.5 MIME-Version: 1.0 To: Andriy Gapon References: <4C1CFB72.5000806@fgznet.ch> <4C1D27F9.60709@icyb.net.ua> In-Reply-To: <4C1D27F9.60709@icyb.net.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: freebsd-current Subject: Re: only 3 of 4GB memory available on amd64 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 19:20:02 -0000 On 19.06.10 22:26, Andriy Gapon wrote: > on 19/06/2010 20:16 Andreas Tobler said the following: >> Hi all, >> >> I got my hands on a t60 with 4GB of RAM (BIOS displays it) >> >> And I installed 8.1-RC1 on it: >> >> FreeBSD 8.1-RC1 #0: Mon Jun 14 13:40:28 UTC 2010 >> root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >> Timecounter "i8254" frequency 1193182 Hz quality 0 >> CPU: Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz (1828.76-MHz >> K8-class CPU) >> Origin = "GenuineIntel" Id = 0x6f6 Family = 6 Model = f Stepping = 6 >> >> Features=0xbfebfbff >> >> Features2=0xe3bd >> AMD Features=0x20100800 >> AMD Features2=0x1 >> TSC: P-state invariant >> real memory = 4294967296 (4096 MB) >> avail memory = 3092344832 (2949 MB) >> ACPI APIC Table: >> FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs >> FreeBSD/SMP: 1 package(s) x 2 core(s) >> cpu0 (BSP): APIC ID: 0 >> cpu1 (AP): APIC ID: 1 >> >> >> >> Do I need to configure something special to get the full 4GB of memory? >> >> I only found the PAE hint, but this is for x86 machines, right? > > Yes, PAE is for what we call in FreeBSD land "i386". > "x86" we use for both i386 and amd64. > > Now, to the rest. > I recently investigated this topic myself, so I can share what I learned. > The first thing you'd want to have is SMAP information. > You can get it at the loader prompt with 'smap' command. > It is also reported by kernel during a verbose boot, but it is only printed to > console; it is not saved to dmesg, because it is printed before msgbuf is created. > > Example of how SMAP information looks: > SMAP type=01 base=0000000000000000 end=000000000009f800 > SMAP type=02 base=00000000000f0000 end=0000000000100000 > SMAP type=02 base=00000000fec00000 end=0000000100000000 > SMAP type=02 base=00000000e0000000 end=00000000f0000000 > SMAP type=02 base=000000000009f800 end=00000000000a0000 > SMAP type=02 base=00000000bfdf0000 end=00000000bfe00000 > SMAP type=01 base=0000000000100000 end=00000000bfde0000 > SMAP type=03 base=00000000bfde3000 end=00000000bfdf0000 > SMAP type=04 base=00000000bfde0000 end=00000000bfde3000 > SMAP type=01 base=0000000100000000 end=0000000130000000 > > Type 1 ('01') is memory ranges free for OS use. > Note that the ranges could be unsorted. > > SMAP would give you an idea what is free for OS use and what is taken away for > BIOS and hardware needs. Also note that what's reported as "avail memory" is > smaller than sum of sizes of all unreserved regions. Some space is taken away > by FreeBSD virtual memory code to store some core page/memory management > information (~3%). Memory used by kernel and preloaded modules is also not > included into "avail memory". > > If you discover that your system reserves, in your opinion, too much memory, > then consider the following things. > 1. Some memory might be allocated as video adapter's aperture and/or video > adapter's memory in case of some integrated graphics solutions. > 2. Some memory addresses below 4GB are used for MMIO (memory mapped > input/output) - accessing those addresses is actually communicating with some > hardware rather than accessing DRAM. Some hardware+firmware combinations can > hoist (or remap) DRAM that corresponds to such an address range to a different > address range above 4G. If you examine last line of my sample SMAP output, then > you'll see that there is 756MB of "type 01" RAM above 4GB and that machine has > exactly 4GB of DRAM installed - this is MMIO range 0xd0000000-0x100000000 > hoisted to 0x100000000-0x130000000. > If your hardware doesn't support that option, then too bad - the memory is > "overshadowed" by MMIO and is effectively lost. > Sometimes hoisting option (under whatever name) has to be explicitly set in BIOS > configuration. Thanks for the explanation! > That's about all. > I am curious as to what you would discover about your system - please share with us. I'd like to, but how do I get this information out of my box? There is no serial line. The only way I know is getting a screen shot. Do you know another way? Unfortunately I do not have a docking station, there I guess I'd have a serial line. Also, sorry for the delay, I had to upgrade the bios in hope that the em0 is recognized properly, but no chance: em0: port 0x3000-0x301f mem 0xee000000-0xee01ffff irq 16 at device 0.0 on pci2 em0: attempting to allocate 1 MSI vectors (1 supported) msi: routing MSI IRQ 256 to local APIC 0 vector 49 em0: using IRQ 256 for MSI em0: Using MSI interrupt em0: The EEPROM Checksum Is Not Valid Thanks again! Andreas