freebsd-skq/sys/amd64
kib b4ed659030 Fix a corner case in demotion of kernel mappings.
It is possible for the kernel mapping to be created with superpage by
directly installing pde using pmap_enter_2mpage() without filling the
corresponding page table page.  This can happen e.g. if the range is
already backed by reservation and vm_fault_soft_fast() conditions are
satisfied, which was observed on the pipe_map.

In this case, demotion must fill the page obtained from the pmap
radix, same as if the page is newly allocated.  Use PG_PROMOTED bit as
an indicator that the page is valid, instead of the wire count of the
page table page.

Since the PG_PROMOTED bit is set on pde when we leave TLB entries for
4k pages around, which in particular means that the ptes were filled,
it provides more correct indicator.  Note that pmap_protect_pde()
clears PG_PROMOTED, which handles the case when protection was changed
on the superpage without adjusting ptes.

Reported by:	pho
In collaboration with:	alc
Tested by:	alc, pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D20380
2019-05-24 17:19:06 +00:00
..
acpica Merge ACPICA 20190329. 2019-03-29 20:21:28 +00:00
amd64 Fix a corner case in demotion of kernel mappings. 2019-05-24 17:19:06 +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 amd64 pmap: rework delayed invalidation, removing global mutex. 2019-05-16 13:28:48 +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