svn commit: r330511 - head/sys/amd64/amd64
Jonathan T. Looney
jtl at FreeBSD.org
Mon Mar 5 15:12:36 UTC 2018
Author: jtl
Date: Mon Mar 5 15:12:35 2018
New Revision: 330511
URL: https://svnweb.freebsd.org/changeset/base/330511
Log:
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
Modified:
head/sys/amd64/amd64/pmap.c
Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c Mon Mar 5 15:10:17 2018 (r330510)
+++ head/sys/amd64/amd64/pmap.c Mon Mar 5 15:12:35 2018 (r330511)
@@ -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++) {
More information about the svn-src-all
mailing list