]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix the undersupported option KERNLOAD, part 2: fix crashes in locore
authorbde <bde@FreeBSD.org>
Mon, 18 Dec 2017 11:57:05 +0000 (11:57 +0000)
committerbde <bde@FreeBSD.org>
Mon, 18 Dec 2017 11:57:05 +0000 (11:57 +0000)
commit6031fc59358a71f19717ee8ccd0df1de4d4b20d3
tree3ff9ce529b135e8b9b9cec727402ffda3bfd2e0f
parent83ea734edb7b620f36bfdca3f656db9353b4e824
Fix the undersupported option KERNLOAD, part 2: fix crashes in locore
when KERNLOAD is smaller than NBPDR (not the default) and PG_G is
enabled (the default if the CPU supports it).  This case has relatively
minor problems with coherency of the permanent double mapping, but the
fix in r167869 to improve coherency creates page tables with 3 different
errors so never worked.

The permanent double mapping is fundamentally broken and will be removed
soon.  It fundamentally breaks trapping for null pointers and requires
complications to avoid cache coherency bugs.  It is currently used for
only a single instruction in ACPI resume,

Many fixes VM86 and/or ACPI and/or the double map were attempted near
r1200000.  r167869 attempted to fix cache coherency bugs in an unusual
case, but the bugs were unreachable because older errors in page tables
caused a crash first.

This commit just makes r167869 work as intended.  Part 1 of these fixes
fixed the other errors, but also stopped mapping the PDE for KERNBASE
as a large page, so double mapping of this PDE only causes the same
problems as when KERNLOAD is the default.  Except for the problem of
trapping null pointers, r167869 could be used to fix these problems,
but it is inactive in usual cases.  The only known other problem is
that incoherent permissions for page 0 cause spurious traps in VM86
BIOS calls.

Reviewed by: kib
sys/i386/i386/locore.s