opnsense-src/sys/powerpc/aim
Brandon Bergren f10baa4049 [PowerPC] Fix translation-related crashes during startup
After spending a lot of time trying to track down what was going on, I have
isolated the "black screen" failures when using boot1 to boot a G4 machine.

It turns out we were replacing the traps before installing the temporary
BAT entry for the bottom of physical memory. That meant that until the MMU
was bootstrapped, the cached translations were the only thing keeping us
from losing.

Throwing boot1 into the mix was affecting execution flow enough to cause us
to hit an uncached page and crash.

Fix this by properly setting up the initial BAT entry at the same time we
are replacing the OpenFirmware traps, so we can continue executing in
segment 0 until the rest of the DMAP has been set up.

A second thing discovered while researching this is that we were entering a
BAT region for segment 16. It turns out this range was a) considered part
of KVA, and b) has firmware mappings with varying attributes.

If we ever accessed an unmapped page in segment 16, it would cause a BAT
entry to be installed for the whole segment, which would bypass the
existing mappings until it was flushed out again.

Instead, translate the OFW memory attributes into VM memory attributes and
install the ranges into the kernel address space properly.

Reviewed by:	adalava
MFC after:	3 weeks
Sponsored by:	Tag1 Consulting, Inc.
Differential Revision:	https://reviews.freebsd.org/D25547
2020-08-21 03:31:01 +00:00
..
aim_machdep.c [PowerPC] Fix translation-related crashes during startup 2020-08-21 03:31:01 +00:00
locore.S Add a kdb show command to print arbitrary SPRs on PowerPC 2016-08-13 18:46:49 +00:00
locore32.S powerpc64: Add a trap stack area 2019-02-04 16:02:03 +00:00
locore64.S [PowerPC] kernel ifunc support for powerpc*, fix ppc64 relocation oddities. 2020-05-07 19:32:49 +00:00
mmu_oea.c [PowerPC] Fix translation-related crashes during startup 2020-08-21 03:31:01 +00:00
mmu_oea64.c Revert r240317 to prevent leaking pmap entries 2020-07-16 23:29:26 +00:00
mmu_oea64.h powerpc/mmu: Convert PowerPC pmap drivers to ifunc from kobj 2020-05-27 01:24:12 +00:00
mmu_radix.c Fix clang 11 inline asm constraint error when building powerpc GENERIC64 2020-08-07 19:32:54 +00:00
moea64_native.c powerpc/mmu: Convert PowerPC pmap drivers to ifunc from kobj 2020-05-27 01:24:12 +00:00
mp_cpudep.c powerpc: Initialize the Hardware Interrupt Offset Register (HIOR) earlier for ppc970 2019-05-10 19:36:14 +00:00
slb.c powerpc: unconditionally mark SLB zones UMA_ZONE_CONTIG 2020-02-19 04:46:41 +00:00
trap_subr32.S [PowerPC] Fix invalid asm in trap code 2020-05-27 00:17:05 +00:00
trap_subr64.S powerpc: Add a (CPU/runtime features) flags set to pcpu struct 2020-06-06 02:40:52 +00:00