freebsd-src/sys/riscv
Mitchell Horne de09dcebd7 riscv: rework page table bootstrap
The overall goal of the change is to reduce the amount of work done in
locore assembly, and defer as much as possible until pmap_bootstrap().
Currently, half the setup is done in assembly, and then we pass the l1pt
address to pmap_bootstrap() where it is amended with other mappings.

Inspiration and understanding has been taken from amd64's
create_pagetables() routine, and I try to present the page table
construction in the same way: a linear procedure with commentary
explaining what we are doing and why. Thus the core of the new
implementation is contained in pmap_create_pagetables().

Once pmap_create_pagetables() has finished, we switch to the new
pagetable root and leave the bootstrap ones created by locore behind,
resulting in a minimal 8kB of wasted space.

Having the whole procedure in one place, in C code, allows it to be more
easily understood, while also making it more amenable to future changes
which depend on CPU feature/errata detection.

Note that with this change the size of the early devmap is bumped up
from one to four L2 pages (8MB).

Reviewed by:	markj
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45327
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: rework page table bootstrap 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