HomeFreeBSD

riscv: T-HEAD early locore workaround

Description

riscv: T-HEAD early locore workaround

The T-HEAD custom PTE bits are defined in such a way that the
default/normal memory type is non-zero value. This _unthoughtful_ choice
means that, unlike the Svpbmt and non-Svpbmt cases, this field cannot be
left bare in our bootstrap PTEs, or the hardware will fail to proceed
far enough in boot (cache strangeness). On the other hand, we cannot
unconditionally apply the PTE_THEAD_MA_NONE attributes, as this is not
compatible with spec-compliant RISC-V hardware, and will result in a
fatal exception.

Therefore, in order to handle this errata, we are forced to perform a
check of the CPU type at the first moment possible. Do so, and fix up
the PTEs with the correct memory attribute bits in the T-HEAD case.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47458

Details

Provenance
mhorneAuthored on Nov 21 2024, 6:12 PM
Differential Revision
D47458: riscv: T-HEAD early locore workaround
Parents
rGc7fa232e9b70: locore.S: stash boot arguments in saved registers
Branches
Unknown
Tags
Unknown