freebsd-dev/sys
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 Add MMCCAM-enabled kernel config for IMX6, reduce debug noice in MMCCAM kernels 2017-09-13 10:56:02 +00:00
arm Allwinner usb phy: Rework resource allocation 2017-09-16 15:58:20 +00:00
arm64 Add the ARMv8.3 ID register fields. These were found in the A-Profile 2017-09-15 12:57:34 +00:00
boot loader: biosmem allocate heap just below 4GB 2017-09-18 15:17:01 +00:00
bsm
cam Allow multiple TRIMs to be done for nda 2017-09-15 20:16:06 +00:00
cddl dounmount: do not release the mount point's reference on the covered vnode 2017-09-14 08:47:06 +00:00
compat The LinuxKPI atomics do not have acquire nor release semantics unless 2017-09-18 13:37:14 +00:00
conf Miscellaneous fixes and improvements to MMCCAM stack 2017-09-15 19:47:44 +00:00
contrib octeon sdk: initialize variable to quiet Clang warning 2017-09-14 16:41:22 +00:00
crypto aesni: quiet -Wcast-qual 2017-08-16 22:54:35 +00:00
ddb Rename mkdumpheader() and group EKCD functions in kern_shutdown.c. 2017-08-18 04:04:09 +00:00
dev Give icee(4) a detach() method so it can be used as a module. Add a 2017-09-17 22:58:13 +00:00
fs Fix bogus FREAD with NFSV4OPEN_ACCESSREAD. No functional change. 2017-09-17 22:18:01 +00:00
gdb
geom gmirror: treat ENXIO as disk disconnect, not media error 2017-09-15 13:57:08 +00:00
gnu
i386 Revert r323087 2017-09-01 17:03:48 +00:00
isa Use better hard-coded defaults for the cursor shape, and remove nearby 2017-08-19 19:33:16 +00:00
kern Modify blst_leaf_alloc to take only the cursor argument. 2017-09-16 18:12:15 +00:00
kgssapi
libkern x86/crc32_sse42.c: quiet unused function warning 2017-08-11 17:05:31 +00:00
mips Add MIPS32/64 Rev2 CP0 intctl register definitions. 2017-09-15 19:56:21 +00:00
modules Give icee(4) a detach() method so it can be used as a module. Add a 2017-09-17 22:58:13 +00:00
net Revert r323516 (iflib rollup) 2017-09-16 02:41:38 +00:00
net80211 net80211: fix a typo (premable -> preamble). 2017-08-27 22:13:03 +00:00
netgraph
netinet Fix an accounting bug and use sctp_timer_start to start a timer. 2017-09-17 09:27:27 +00:00
netinet6 Fix a locking issue found by Coverity scanning the usrsctp library. 2017-09-09 20:51:54 +00:00
netipsec Fix possible double releasing for SA reference. 2017-09-01 11:51:07 +00:00
netpfil pf_get_sport(): Prevent possible endless loop when searching for an unused nat port 2017-08-08 21:09:26 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed Remove unsafe access to the LinuxKPI file structure from ibcore. 2017-09-09 06:34:20 +00:00
opencrypto
powerpc Don't use a non-zero argument for __builtin_frame_address 2017-09-17 20:07:20 +00:00
riscv Add AT_HWCAP and AT_EHDRFLAGS on all platforms. 2017-09-14 14:26:55 +00:00
rpc
security Sprinkle __read_frequently on few obvious places. 2017-09-06 20:33:33 +00:00
sparc64 Add AT_HWCAP and AT_EHDRFLAGS on all platforms. 2017-09-14 14:26:55 +00:00
sys Bump the __FreeBSD_version after recent LinuxKPI changes. 2017-09-18 13:39:51 +00:00
teken Fix syscons escape sequence for setting the local cursor type. This sequence 2017-08-18 15:40:40 +00:00
tests
tools
ufs The new fsck recovery information to enable it to find backup 2017-09-04 20:19:36 +00:00
vm Batch freeing of the pages in vm_object_page_remove() under the same 2017-09-15 16:07:09 +00:00
x86 MCA: Expand AMD Thresholding support to cover all banks 2017-09-17 22:58:13 +00:00
xdr
xen
Makefile