Set PG_G global mapping bit on the trampoline ptes.

Trampoline mappings are better treated as global since they are valid
in all address spaces, even for PTI.  pmap_invalidate_range() must work
on global mappings for pti since kernel_pmap invalidations are really
same as for non-PTI.

Reviewed by:	alc, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
Differential revision:	https://reviews.freebsd.org/D15052
This commit is contained in:
Konstantin Belousov 2018-04-14 17:33:16 +00:00
parent 6ec30ab86a
commit 23084818ff

View File

@ -8000,7 +8000,7 @@ pmap_pti_add_kva_locked(vm_offset_t sva, vm_offset_t eva, bool exec)
for (; sva < eva; sva += PAGE_SIZE) {
pte = pmap_pti_pte(sva, &unwire_pde);
pa = pmap_kextract(sva);
ptev = pa | X86_PG_RW | X86_PG_V | X86_PG_A |
ptev = pa | X86_PG_RW | X86_PG_V | X86_PG_A | X86_PG_G |
(exec ? 0 : pg_nx) | pmap_cache_bits(kernel_pmap,
VM_MEMATTR_DEFAULT, FALSE);
if (*pte == 0) {