Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Mar 2018 15:12:35 +0000 (UTC)
From:      "Jonathan T. Looney" <jtl@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r330511 - head/sys/amd64/amd64
Message-ID:  <201803051512.w25FCZEW024347@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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++) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803051512.w25FCZEW024347>