Re: [patch-2.3.33] memory size on proliant/1600 (was Re: Ok, making , ready for pre-2.4 and code-fre

Tigran Aivazian (tigran@sco.COM)
Wed, 15 Dec 1999 16:15:29 +0000 (GMT)


On Wed, 15 Dec 1999, Tigran Aivazian wrote:
> --- linux/arch/i386/kernel/setup.c Wed Dec 8 07:01:40 1999
> +++ ta/arch/i386/kernel/setup.c Wed Dec 15 15:41:06 1999
> @@ -594,7 +594,7 @@
> for (i = 0; i < e820.nr_map; i++) {
> unsigned long curr_pfn;
> /* RAM? */
> - if (e820.map[i].type != E820_RAM)
> + if (e820.map[i].type != E820_RAM || (int)e820.map[i].size == 0)
> continue;
> curr_pfn = PFN_DOWN(e820.map[i].addr + e820.map[i].size);
> if (curr_pfn > max_pfn)

Just to confirm that the above is the *right* fix (despite some doubts I
had for a minute), the e820 map as discovered during boot on this hardware
looks like this (using gdb -q vmlinux /proc/kcore):

(gdb) p e820
$3 = {nr_map = 0x8, map = {{addr = 0x0, size = 0x9f800, type = 0x1}, {addr
= 0x9f800,
size = 0x800, type = 0x2}, {addr = 0xf0000, size = 0x10000, type =
0x2}, {addr = 0x100000,
size = 0x3f00000, type = 0x1}, {addr = 0xfec00000, size = 0x10000,
type = 0x2}, {
addr = 0xfee00000, size = 0x10000, type = 0x2}, {addr = 0xfff80000,
size = 0x80000,
type = 0x2}, {addr = 0x100000000, size = 0x0, type = 0x1}, {addr =
0x0, size = 0x0,
type = 0x0} <repeats 24 times>}}

so, the entry e820[7] is definitely bogus (addr = 0x100000000) and is best
avoided and not counted as valid E820_RAM...

Regards,
Tigran.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/