We shouldn't need to execute code in the recursive page table mappings;

therefore, it should be safe to set the NX bit on the PML4E for the
recursive page table mappings.  According to the Intel docs, the effect
of the NX bit should propogate to any page reached through a PML4E which
has the NX bit set.

Reviewed by:	kib, markj
MFC after:	2 weeks
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D14333
This commit is contained in:
jtl 2018-03-05 15:12:35 +00:00
parent 886958fbdb
commit 5a8fb2b9d6

View File

@ -983,7 +983,7 @@ create_pagetables(vm_paddr_t *firstaddr)
/* And recursively map PML4 to itself in order to get PTmap */
p4_p = (pml4_entry_t *)KPML4phys;
p4_p[PML4PML4I] = KPML4phys;
p4_p[PML4PML4I] |= X86_PG_RW | X86_PG_V | PG_U;
p4_p[PML4PML4I] |= X86_PG_RW | X86_PG_V | PG_U | pg_nx;
/* Connect the Direct Map slot(s) up to the PML4. */
for (i = 0; i < ndmpdpphys; i++) {