HomeFreeBSD

Account for dmap limit when selecting the pages for the bootstrap

Description

Account for dmap limit when selecting the pages for the bootstrap
pagetables.

physmap[] can be inconsistent with the physical memory limit due to
buggy bios, or to the hw.physmem tunable. Since bootstrap pagetables
are initialized by accesses through the DMAP, we must ensure that DMAP
really cover the selected pages. This is only relevant when machine
has less than 4G RAM and buggy BIOS, which is the combination on Acer
Chromebook 720.

The call to mp_bootaddress() is moved later to have Maxmem initialized.

An alternative could be to always cover 4G for DMAP, but this change
seems to be simpler.

Reported and tested by: grembo
Reviewed by: royger
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D15675

Details