freebsd-src/sys/riscv
Ruslan Bukin 03b330e191 riscv: add stage 2 translation to pmap.
Add basic stage 2 translation support (guest-physical to host-physical).

RISC-V hypervisor spec[1] introduces new translation schemes: Sv32x4,
Sv39x4, Sv48x4 and Sv57x4.
In each case, the size of the incoming address is widened by 2 bits (e.g.
Sv39 becomes 41-bit system).
To accommodate the 2 extra bits, the root page table (only) is expanded
by a factor of four to be 16 KiB instead of the usual 4 KiB. The rest of
page table system (including PTE format) is similar.
This gives us 4x of memory space in each scheme, but it does not make sense
to support all that memory for now.
Allocate required amount of pages for the top directory in case of stage 2,
but leave it unused.

1. https://github.com/riscv/riscv-isa-manual/blob/main/src/hypervisor.adoc

Reviewed by:	mhorne
Sponsored by:	UKRI
Differential Revision:	https://reviews.freebsd.org/D45481
2024-06-05 14:36:57 +01:00
..
allwinner sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
conf jh7110: enable MMC driver 2024-05-07 13:02:57 -03:00
include riscv: add stage 2 translation to pmap. 2024-06-05 14:36:57 +01:00
riscv riscv: add stage 2 translation to pmap. 2024-06-05 14:36:57 +01: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