Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Dec 2017 14:29:48 +0000 (UTC)
From:      Bruce Evans <bde@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326933 - head/sys/i386/i386
Message-ID:  <201712181429.vBIETm3R035652@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bde
Date: Mon Dec 18 14:29:48 2017
New Revision: 326933
URL: https://svnweb.freebsd.org/changeset/base/326933

Log:
  Also forgotten in the previous that removed the permanent double mapping
  of low physical memory:
  
  Update the comment about leaving the permanent mapping in place.  This
  also improves the wording of the comment.  PTD 0 is still left alone
  because it is fairly important that it was unmapped earlier, and the
  comment now describes the unmapping of the other low PTDs that the code
  actually does.
  
  Reviewed by:	kib

Modified:
  head/sys/i386/i386/pmap.c

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Mon Dec 18 13:53:22 2017	(r326932)
+++ head/sys/i386/i386/pmap.c	Mon Dec 18 14:29:48 2017	(r326933)
@@ -493,9 +493,13 @@ pmap_bootstrap(vm_paddr_t firstaddr)
 	virtual_avail = va;
 
 	/*
-	 * Leave in place an identity mapping (virt == phys) for the low 1 MB
-	 * physical memory region that is used by the ACPI wakeup code.  This
-	 * mapping must not have PG_G set. 
+	 * Finish removing the identity mapping (virt == phys) of low memory.
+	 * It was only used for 2 instructions in locore.  locore then
+	 * unmapped the first PTD to get some null pointer checks.  ACPI
+	 * wakeup will map the first PTD transiently to use it for 1
+	 * instruction.  The double mapping for low memory is not usable in
+	 * normal operation since it breaks trapping of null pointers and
+	 * causes inconsistencies in page tables when combined with PG_G.
 	 */
 	for (i = 1; i < NKPT; i++)
 		PTD[i] = 0;



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