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
This commit is contained in:
bde 2017-12-18 14:29:48 +00:00
parent 994bacdf8f
commit 5c5c139b6a

View File

@ -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;