freebsd-skq/sys/i386
bde 994bacdf8f Remove the permanent double mapping of low physical memory and replace
it by a transient double mapping for the one instruction in ACPI wakeup
where it is needed (and for many surrounding instructions in ACPI resume).
Invalidate the TLB as soon as convenient after undoing the transient
mapping.  ACPI resume already has the strict ordering needed for this.

This fixes the non-trapping of null pointers and other garbage pointers
below NBPDR (except transiently).  NBPDR is quite large (4MB, or 2MB for
PAE).

This fixes spurious traps at the first instruction in VM86 bioscalls.
The traps are for transiently missing read permission in the first
VM86 page (physical page 0) which was just written to at KERNBASE in
the kernel.  The mechanism is unknown (it is not simply PG_G).

locore uses a similar but larger transient double mapping and needs
it for 2 instructions instead of 1.  Unmap the first PDE in it after
the 2 instructions to detect most garbage pointers while bootstrapping.
pmap_bootstrap() finishes the unmapping.

Remove the avoidance of the double mapping for a recently fixed special
case.  ACPI resume could use this avoidance (made non-special) to avoid
any problems with the transient double mapping, but no such problems
are known.

Update comments in locore.  Many were for old versions of FreeBSD which
tried to map low memory r/o except for special cases, or might have
allowed access to low memory via physical offsets.  Now all kernel
maps are r/w, and removal of of the double map disallows use of physical
offsets again.
2017-12-18 13:53:22 +00:00
..
acpica Minor cleanups found while fixing a bug involving double mapping of low 2017-12-15 03:05:14 +00:00
bios sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
cloudabi32 Use TO_PTR() to convert integers to pointers. 2017-11-26 14:45:56 +00:00
conf i386: Bump KSTACK_PAGES default to match amd64 2017-12-11 04:32:37 +00:00
i386 Remove the permanent double mapping of low physical memory and replace 2017-12-18 13:53:22 +00:00
ibcs2 Disable vim syntax highlighting. 2017-11-28 18:23:17 +00:00
include i386: Bump KSTACK_PAGES default to match amd64 2017-12-11 04:32:37 +00:00
isa sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
linux Disable vim syntax highlighting. 2017-11-28 18:23:17 +00:00
pci sys/i386: further adoption of SPDX licensing ID tags. 2017-11-27 15:08:52 +00:00
Makefile