HomeFreeBSD

RISC-V: Check that the DTB doesn't overlap with kernel

Description

RISC-V: Check that the DTB doesn't overlap with kernel

This can happen with very large kernels (e.g. ones embedding a root
filesystem). The DTB written by OpenSBI/BBL is quite small so this is
unlikely to hit important data, but if it does this can result in very
confusing and hard-to-debug crashes. Add a KASSERT() and a verbose print
to catch this problem with debug kernels.

While this will not print any output by default if it fails (that would
depend on EARLY_PRINTF), at least the kernel now halts reliably instead
of randomly crashing.

Reviewed By: mhorne
Differential Revision: https://reviews.freebsd.org/D25153

Details

Provenance
arichardsonAuthored on
Reviewer
mhorne
Differential Revision
D25153: RISC-V: Check that the DTB doesn't overlap with kernel
Parents
rS361904: sys/riscv: Remove debug printfs
Branches
Unknown
Tags
Unknown