freebsd-src/sys/riscv
Mitchell Horne 762a3224cd riscv: smarter DMAP construction
Currently we create the DMAP by mapping the entire range between the
smallest and largest physical memory addresses with L1 superpages. This
is obviously overkill, and we may end up mapping all kinds of ranges that
are not real memory.

In the case of the HiFive Unmatched (obsolete hardware), there is an
errata resulting in faults when a TLB mapping spans PMP (firmware)
protection regions. So, when our DMAP mapping spans into the memory
reserved by OpenSBI, we get a fatal fault. This highlights the need to
be smarter here.

Therefore, let's attempt to build the DMAP a little more correctly by
walking the physmap array and mapping each range individually. It is not
perfect in that we still only respect the range to a 2MB granularity,
but this could be improved in the future.

Reviewed by:	markj
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45328
2024-06-20 15:33:19 -03:00
..
allwinner sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
conf riscv: include ahci device to GENERIC. 2024-06-12 13:40:50 +01:00
include riscv: rework page table bootstrap 2024-06-20 15:33:19 -03:00
riscv riscv: smarter DMAP construction 2024-06-20 15:33:19 -03:00
sifive fu740_pci_dw: Fix PERST delay and keep asserted for rest of reset sequence 2024-06-02 21:42:18 +01:00
starfive jh7110: Add StarFive JH7110 clock/reset generator drivers 2024-05-07 13:07:36 -03:00