freebsd-dev/sys/amd64
Konstantin Belousov fcd0c06eee Correct some inconsistencies in the earliest created kernel page
tables which affect demotion.

The last last-level page table under 2M mappings below KERNend was
only partially initialized.  When that page was used as the hardware
page table for demotion of the 2M mapping, the result was not
consistent.  Since pmap_demote_pde() is switched to use PG_PROMOTED as
the test for the validity of the saved last level page table page, we
can keep page table pages zero-initialized instead.  Demotion would
fill them as needed.

Only map the created page tables beyond KERNend, there is no need to
pre-promote PTmap after KERNend, because the extra mapping is not used.

Only round up *firstaddr to 2M boundary when it is below rounded
KERNend.  Sometimes the allocpages() calls advance *firstaddr past the
end of the last 2MB page mapping. In that case, this conditional
avoids wasting an average of 1MB of physical memory.

Update comments to explain action in more clean and direct language.

Reported and tested by:	pho
In collaboration with:	alc
Sponsored by:	The FreeBSD Foundation (kib)
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D20380
2019-05-27 15:21:26 +00:00
..
acpica Merge ACPICA 20190329. 2019-03-29 20:21:28 +00:00
amd64 Correct some inconsistencies in the earliest created kernel page 2019-05-27 15:21:26 +00:00
cloudabi32 Remove sv_pagesize, originally introduced with r100384. 2019-03-01 16:16:38 +00:00
cloudabi64 Remove sv_pagesize, originally introduced with r100384. 2019-03-01 16:16:38 +00:00
conf FCP-101: Remove wb(4) 2019-05-17 15:24:34 +00:00
ia32 Remove iBCS2, part2: general kernel 2018-12-19 21:57:58 +00:00
include Add PG_PS_PDP_FRAME symbol. 2019-05-24 23:26:17 +00:00
linux Make linux_ptrace() use linux_msg() instead of printf(). 2019-05-21 08:23:24 +00:00
linux32 Remove resolver_qual from DEFINE_IFUNC/DEFINE_UIFUNC macros. 2019-05-16 22:20:54 +00:00
pci pci_cfgreg.c: Use io port config access for early boot time. 2019-04-09 18:07:17 +00:00
sgx Prevent loading SGX with incorrect EPC data 2019-03-19 02:33:58 +00:00
vmm Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
Makefile Bring the tags and links entries for amd64 up to date. 2015-10-27 22:59:24 +00:00