Gentoo Archives: gentoo-amd64

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] Re: I can use only 3GB aout of install 6GB
Date: Wed, 06 May 2009 13:42:42
Message-Id: pan.2009.05.06.13.42.24@cox.net
In Reply to: Re: [gentoo-amd64] I can use only 3GB aout of install 6GB by Volker Armin Hemmann
1 Volker Armin Hemmann <volkerarmin@××××××××××.com> posted
2 200905061337.38907.volkerarmin@××××××××××.com, excerpted below, on Wed,
3 06 May 2009 13:37:38 +0200:
4
5 > On Mittwoch 06 Mai 2009, Nadav Horesh wrote:
6 >> I recently added 4GB to the existing 2GB I had. The BIOS and lshw
7 >> recognize the memory configuration (2 dimm of 1G and 2 of 2G), but
8 >> /prc/meminfo and a test program I ran recognize 3.2GB.
9
10 > get a non broken bios?
11
12 ... Or possibly, reconfigure the BIOS you (OP) have.
13
14 The story is this. Legacy PCI devices were designed for 32-bit memory
15 only. That means their hardware I/O addresses must be below the 32-bit
16 4-gig memory ceiling. Back before memory got cheap and plentiful enough
17 that people commonly ran 3+ gigs, that was no problem, the hardware
18 addresses simply lived at the top of the 4-gig memory area, typically
19 3.5-4 gig.
20
21 Now that common memory installations exceed that 3.5 gig barrier, the
22 BIOS must be prepared to create a "memory hole", mapping memory that
23 would otherwise fall behind the PCI hardware I/O area up beyond the 4-gig
24 barrier. IOMMUs (input/output memory management units) or software
25 bounce-buffers are then used to remap DMAs such that legacy PCI hardware
26 operating with addresses in this memory hole can still handle DMAs
27 working with memory addresses above the 4-gig barrier.
28
29 This was in fact one of the reasons early AMD64 hardware was considered
30 superior to early Intel em64t hardware, AMD had a GART based hardware
31 IOMMU, while Intel hardware of the era required a software emulated IOMMU
32 bounce-buffer, AMD hardware could thus handle DMAs directly, while Intel
33 hardware had to emulate it in software. The kernel now has support for
34 two additional forms of IOMMU, the newer AMD hardware and IBM's Calgary
35 IOMMUs. I honestly don't know what modern Intel hardware uses, whether
36 it's still software bounce-buffer based (the GART based IOMMU option
37 includes the software emulator as well), or if they have a hardware IOMMU
38 covered by one of the above kernel config options.
39
40 If you've been in computers long enough to remember, the situation is
41 somewhat analogous to the way early IBM PC hardware had conventional
42 memory to 640 kB, a hardware memory area 640 kB to 1 MB, then expanded
43 (early tech) or extended (later) memory beyond the 1 MB barrier. The 640
44 kB to 1 MB area was also called a "memory hole" with a BIOS option for
45 handling it. If I'm not mistaken, it can still be seen in some modern
46 BIOS in the form of an OS specifier, OS/2 or not. (It is however
47 possible that I'm confused and that the OS/2 BIOS option is unrelated.)
48
49 Anyway, check your BIOS. It's obviously difficult to refer to mine while
50 I'm typing this, and I'm running AMD hardware (older first/second
51 generation socket-940 Opteron, AMD 8xxx chipset) anyway, which may have
52 different options or have it labeled differently, but look for an option
53 mapping the memory hole as contiguous, discrete, or left undescribed, and
54 try playing with that. If I recall correctly, my BIOS actually has two
55 places to set something like that. I'm not sure how the two relate to
56 each other nor do I recall precisely which each is labeled, but
57 basically, when I upgraded memory from a gig to 8 gig, I played with
58 these two BIOS options and the related kernel options until I got both
59 BIOS and the kernel seeing the additional memory. Interestingly enough,
60 the BIOS now counts to ~10 gig of memory, obviously counting the memory
61 hole as well, but regardless, the kernel gets it right so I've left well
62 enough alone since then.
63
64 The related kernel config options I can actually check while I'm posting.
65 =:^) These options can be found in menuconfig under processor type and
66 features. As mentioned above, you'll want to figure out which IOMMU
67 option matches your hardware and enable it. (The GART based option
68 should work in any case, as it includes the software bounce-buffer
69 emulation, but it may not be the fastest option if you have a hardware
70 IOMMU OTHER than the original AMD 8xxx GART based version.)
71
72 Then, look at memory model. Here, with current kernels, I have only one
73 option, Sparse, evidently limited by my choice of hardware (Processor
74 family and/or Supported processor vendor options, higher on the page, I'd
75 guess or perhaps probed from the BIOS). However with older kernels, and
76 presumably now if I were to choose hardware other than AMD Opteron/K8 (or
77 choose a different BIOS option), there are Flat and Discontiguous options
78 as well. Unfortunately, I can't tell you which options are correct for
79 your (Intel) hardware. If you have multiple memory model choices, you
80 may just have to try them and see.
81
82 --
83 Duncan - List replies preferred. No HTML msgs.
84 "Every nonfree program has a lord, a master --
85 and if you use the program, he is your master." Richard Stallman

Replies

Subject Author
Re: [gentoo-amd64] Re: I can use only 3GB aout of install 6GB Branko Badrljica <brankob@××××××××××.com>