]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
riscv: Add support for enabling SV48 mode
authorMark Johnston <markj@FreeBSD.org>
Tue, 1 Mar 2022 14:07:14 +0000 (09:07 -0500)
committerMark Johnston <markj@FreeBSD.org>
Tue, 1 Mar 2022 14:39:44 +0000 (09:39 -0500)
commit31218f3209acf0f8f0dc54e436342c8fa604d279
tree2cfd2b6b455f65a896756204749c436738c1b4ae
parent6ce716f7c31a0a1b5ca8224cbb627632f44e4e6c
riscv: Add support for enabling SV48 mode

This increases the size of the user map from 256GB to 128TB.  The kernel
map is left unchanged for now.

For now SV48 mode is left disabled by default, but can be enabled with a
tunable.  Note that extant hardware does not implement SV48, but QEMU
does.

- In pmap_bootstrap(), allocate a L0 page and attempt to enable SV48
  mode.  If the write to SATP doesn't take, the kernel continues to run
  in SV39 mode.
- Define VM_MAX_USER_ADDRESS to refer to the SV48 limit.  In SV39 mode,
  the region [VM_MAX_USER_ADDRESS_SV39, VM_MAX_USER_ADDRESS_SV48] is not
  mappable.

Reviewed by: jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34280
sys/riscv/include/riscvreg.h
sys/riscv/include/vmparam.h
sys/riscv/riscv/pmap.c