opnsense-src/sys
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
..
amd64 Correct some inconsistencies in the earliest created kernel page 2019-05-27 15:21:26 +00:00
arm arm: allwinner: Remove frac mode from NM clk 2019-05-23 17:36:55 +00:00
arm64 arm64 nexus: remove incorrect warning 2019-05-26 23:04:21 +00:00
bsm Create new EINTEGRITY error with message "Integrity check failed". 2019-01-17 06:35:45 +00:00
cam Simplify math added in r310524. 2019-05-22 15:39:35 +00:00
cddl powerpc/dtrace: Fix fbt function probing for ELFv2 2019-05-27 03:18:56 +00:00
compat Do not leak sa in linux_recvmsg() call if kern_recvit() fails. 2019-05-21 18:08:19 +00:00
conf Add an AESNI-optimized version of the CCM/CBC cryptographic and authentication 2019-05-25 07:26:30 +00:00
contrib Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
crypto aesni(4): Fix trivial type typo 2019-05-27 00:47:51 +00:00
ddb Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
dev virtio_random(4): Remove unneeded reference to device 2019-05-27 00:55:46 +00:00
dts arm64: Add support for NanoPI NEO2 2019-05-02 12:56:13 +00:00
fs Remove "struct ucred*" argument from vtruncbuf 2019-05-24 20:27:50 +00:00
gdb amd64: Protect the kernel text, data, and BSS by setting the RW/NX bits 2018-03-06 14:28:37 +00:00
geom When using the destroy option to shut down a nop GEOM module, I/O 2019-05-25 00:07:49 +00:00
gnu dts: Import files from Linux 5.1 2019-05-08 19:27:30 +00:00
i386 Remove pmap_pid_dump() from the i386 pmap. 2019-05-25 23:36:20 +00:00
isa Reapply, with minor tweaks, r338025, from the original commit: 2018-09-26 17:12:14 +00:00
kern kern/CTF: link_elf_ctf_get() on big endian platforms 2019-05-27 04:20:31 +00:00
kgssapi * Handle SIGPIPE in gssd 2019-02-21 01:30:37 +00:00
libkern random(4): depessimize arc4random 2019-05-12 06:32:46 +00:00
mips Display CPU model in dmesg on mips targets 2019-05-24 01:43:35 +00:00
modules Add an AESNI-optimized version of the CCM/CBC cryptographic and authentication 2019-05-25 07:26:30 +00:00
net Fix possible NULL pointer dereference. 2019-05-27 12:41:41 +00:00
net80211 Restructure mbuf send tags to provide stronger guarantees. 2019-05-24 22:30:40 +00:00
netgraph Remove 'dir' argument in ng_ipfw_input, since ip_fw_args now has this info. 2019-03-14 22:30:05 +00:00
netinet When an ACK segment as the third message of the three way handshake is 2019-05-26 17:18:14 +00:00
netinet6 Restructure mbuf send tags to provide stronger guarantees. 2019-05-24 22:30:40 +00:00
netipsec Add deprecation warnings for IPsec algorithms deprecated in RFC 8221. 2019-05-23 22:06:57 +00:00
netpfil Remove an uneeded indentation introduced in r223637 to silence gcc warnging 2019-05-25 23:58:09 +00:00
netsmb Remove unused argument to priv_check_cred. 2018-12-11 19:32:16 +00:00
nfs Switch RIB and RADIX_NODE_HEAD lock from rwlock(9) to rmlock(9). 2018-06-16 08:26:23 +00:00
nfsclient style: Remove remaining deprecated MALLOC/FREE macros 2018-01-25 22:25:13 +00:00
nfsserver sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
nlm Use syscall_helper_register() to register syscalls and initialize though 2018-02-10 01:09:22 +00:00
ofed Include eventhandler.h in more compilation units 2019-05-21 01:18:43 +00:00
opencrypto cryptodeflate: Drop z_stream zbuf.state->dummy from SDT probe. 2019-05-24 02:44:15 +00:00
powerpc powerpc64/pmap: Reapply r334235 to OEA64 pmap, clearing HID0_RADIX 2019-05-25 04:56:06 +00:00
riscv Include ktr.h in more compilation units 2019-05-21 20:38:48 +00:00
rpc Fix malloc stats for the RPCSEC_GSS server code when DEBUG is enabled. 2019-04-04 01:23:06 +00:00
security Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
sparc64 FCP-101: Remove wb(4) 2019-05-17 15:24:34 +00:00
sys sys/bufobj.h: Avoid using C++ reserved keyword 'private' 2019-05-27 00:43:43 +00:00
teken Attempt to complete fixing programmable function keys for syscons. 2019-02-20 02:14:41 +00:00
tests Regularize the Netflix copyright 2019-02-04 21:28:25 +00:00
tools Avoid literal @generated tag in file-generating scripts 2019-05-08 13:35:51 +00:00
ufs Add function name and line number debugging information to softupdates 2019-05-27 06:22:43 +00:00
vm Fix typo from r348128: _func__ -> __func__ 2019-05-23 02:10:41 +00:00
x86 Add a constant for the LS config MSR on AMD CPUs. 2019-05-23 23:37:11 +00:00
xdr sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
xen xen: introduce a new way to setup event channel upcall 2019-01-30 11:34:52 +00:00
Makefile Move sys/boot to stand. Fix all references to new location 2017-11-14 23:02:19 +00:00