From 5c5c139b6ab7917b47454868b40267db1fb3cb66 Mon Sep 17 00:00:00 2001 From: bde Date: Mon, 18 Dec 2017 14:29:48 +0000 Subject: [PATCH] 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 --- sys/i386/i386/pmap.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index a2a5b0d12ca0..38cc84c19f00 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -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;