freebsd-dev/sys/boot/i386/libi386
Toomas Soome 3f247eab7a loader: biosmem allocate heap just below 4GB
The current biosmem code is walking bios smap entries and looking for smap
entry just below 4GB line, if there is such entry, its base and size is set
for heap base and size. Instead of entry base, we should use last HEAP_MIN
(currently 64MB) bytes just below 4GB, to make maximum space for kernel and
modules.

The problem was revealed on ASUS B350M-A system board, an AMD Ryzen 3 1200 CPU

memory map:

SMAP type=01 base=0000000000000000 len=000000000009d400 attr=01
SMAP type=02 base=000000000009d400 len=0000000000002c00 attr=01
SMAP type=02 base=00000000000e0000 len=0000000000020000 attr=01
SMAP type=01 base=0000000000100000 len=0000000009c00000 attr=01
SMAP type=02 base=0000000009d00000 len=0000000000300000 attr=01
SMAP type=01 base=000000000a000000 len=00000000be69b000 attr=01
SMAP type=03 base=00000000c869b000 len=0000000000016000 attr=01
SMAP type=01 base=00000000c86b1000 len=00000000124e7000 attr=01
SMAP type=02 base=00000000dab98000 len=0000000000138000 attr=01
SMAP type=03 base=00000000dacd0000 len=0000000000008000 attr=01
SMAP type=01 base=00000000dacd8000 len=0000000000100000 attr=01
SMAP type=04 base=00000000dadd8000 len=00000000003b3000 attr=01
SMAP type=02 base=00000000db18b000 len=0000000000d42000 attr=01
SMAP type=01 base=00000000dbecd000 len=0000000002133000 attr=01
SMAP type=01 base=0000000100000000 len=000000011f380000 attr=01
SMAP type=02 base=00000000de000000 len=0000000002000000 attr=01
SMAP type=02 base=00000000f8000000 len=0000000004000000 attr=01
SMAP type=02 base=00000000fdf00000 len=0000000000100000 attr=01
SMAP type=02 base=00000000fea00000 len=0000000000010000 attr=01
SMAP type=02 base=00000000feb80000 len=0000000000082000 attr=01
SMAP type=02 base=00000000fec10000 len=0000000000001000 attr=01
SMAP type=02 base=00000000fec30000 len=0000000000001000 attr=01
SMAP type=02 base=00000000fed00000 len=0000000000001000 attr=01
SMAP type=02 base=00000000fed40000 len=0000000000005000 attr=01
SMAP type=02 base=00000000fed80000 len=0000000000010000 attr=01
SMAP type=02 base=00000000fedc2000 len=000000000000e000 attr=01
SMAP type=02 base=00000000fedd4000 len=0000000000002000 attr=01
SMAP type=02 base=00000000fee00000 len=0000000000100000 attr=01
SMAP type=02 base=00000000ff000000 len=0000000001000000 attr=01

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D12368
2017-09-18 15:17:01 +00:00
..
amd64_tramp.S
biosacpi.c
bioscd.c loader: F_READ/F_WRITE should be checked against masked flag 2017-04-18 18:07:54 +00:00
biosdisk.c Remove useless 'static' for an enum definition. 2017-08-26 18:30:03 +00:00
biosmem.c loader: biosmem allocate heap just below 4GB 2017-09-18 15:17:01 +00:00
biospci.c
biospnp.c
biossmap.c
bootinfo32.c Implement boot-time encryption key passing (keybuf) 2017-04-01 05:05:22 +00:00
bootinfo64.c Implement boot-time encryption key passing (keybuf) 2017-04-01 05:05:22 +00:00
bootinfo.c
comconsole.c
devicename.c
elf32_freebsd.c
elf64_freebsd.c
i386_copy.c
i386_module.c
libi386.h loader: chain load relocate data declaration is bad 2017-06-29 04:33:55 +00:00
Makefile Add chain loader support for loader 2017-06-16 20:08:44 +00:00
Makefile.depend
multiboot_tramp.S
multiboot.c loader/multiboot: fix multiboot loading 2017-04-13 09:59:12 +00:00
multiboot.h
nullconsole.c
pread.c
pxe.c loader: network read rework 2017-05-06 20:32:27 +00:00
pxe.h loader: network read rework 2017-05-06 20:32:27 +00:00
pxetramp.s
relocater_tramp.S Add chain loader support for loader 2017-06-16 20:08:44 +00:00
smbios.c
smbios.h
spinconsole.c Make spinconsole platform independent and hook it up into EFI loader on 2017-08-25 17:29:48 +00:00
time.c loader: move bios getsecs into time.c 2017-03-28 21:47:12 +00:00
vidconsole.c