freebsd-dev/sys/x86/acpica
Bruce Evans 2ba6fe0009 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
..
acpi_apm.c sys/x86: further adoption of SPDX licensing ID tags. 2017-11-27 15:11:47 +00:00
acpi_wakeup.c Remove the permanent double mapping of low physical memory and replace 2017-12-18 13:53:22 +00:00
madt.c sys/x86: further adoption of SPDX licensing ID tags. 2017-11-27 15:11:47 +00:00
OsdEnvironment.c sys/x86: further adoption of SPDX licensing ID tags. 2017-11-27 15:11:47 +00:00
srat.c sys/x86: further adoption of SPDX licensing ID tags. 2017-11-27 15:11:47 +00:00