FreeBSD doesn't handle SMAP on Zotac GF9300-D-E board

From: James R. Van Artsdalen <james-freebsd-current_at_jrv.org>
Date: Mon, 24 Aug 2009 20:03:21 -0500
FreeBSD only sees about 3GB of RAM out of 8GB apparently due to a
problem handling E820 data.

FreeBSD pygmy.housenet.jrv 9.0-CURRENT FreeBSD 9.0-CURRENT #3 r196500:
Mon Aug 24 09:18:50 CDT 2009    
james_at_pygmy.housenet.jrv:/usr/obj/usr/src/sys/GENERIC  amd64

System: "ZOTAC GeForce GF9300-D-E ITX WiFi LGA 775 Mini ITX" with 8GB
RAM and an Intel 9550S CPU.

>From dmesg:

real memory  = 8589934592 (8192 MB)
Physical memory chunk(s):
0x0000000000001000 - 0x0000000000098fff, 622592 bytes (152 pages)
0x00000000011fe000 - 0x000000006a5a7fff, 1765449728 bytes (431018 pages)
0x0000000080000000 - 0x00000000bfecffff, 1072496640 bytes (261840 pages)
avail memory = 2819760128 (2689 MB)

This code seems to be suspect
sys/amd64/amd64/machdep.c:

                for (i = 0; i <= physmap_idx; i += 2) {
                        if (smap->base < physmap[i + 1]) {
                if (boothowto & RB_VERBOSE)
                                    printf(
        "Overlapping or non-monotonic memory region, ignoring second
region\n");
                                continue;
            }
            }

I don't think BIOS e820 addresses need be uniformly ascending and in
fact Zotac's aren't.
Transcribed by hand from the loader's SMAP command, with spaces added
for readability:

SMAP type=01 base=0000 0000 0000 0000 len=0000 0000 0009 d000
SMAP type=02 base=0000 0000 0009 d000 len=0000 0000 0000 3000
SMAP type=02 base=0000 0000 000f 0000 len=0000 0000 0001 0000
SMAP type=01 base=0000 0000 0010 0000 len=0000 0000 6ff0 0000
SMAP type=04 base=0000 0000 bfee 0000 len=0000 0000 0000 3000
SMAP type=03 base=0000 0000 bfee 3000 len=0000 0000 0000 d000
SMAP type=02 base=0000 0000 bfef 0000 len=0000 0000 0001 0000
SMAP type=02 base=0000 0000 f000 0000 len=0000 0000 0200 0000
SMAP type=02 base=0000 0000 fec0 0000 len=0000 0000 0140 0000
SMAP type=01 base=0000 0001 0000 0000 len=0000 0001 4000 0000
SMAP type=02 base=0000 0000 7000 0000 len=0000 0000 1000 0000
SMAP type=01 base=0000 0000 8000 0000 len=0000 0000 3fee 0000


I don't see the failure mode of that code offhand, but that's it somehow.
Received on Mon Aug 24 2009 - 23:03:22 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:54 UTC