HomeFreeBSD

riscv: Add support for enabling SV48 mode

Description

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

Details

Provenance
markjAuthored on Mar 1 2022, 2:07 PM
Reviewer
jhb
Differential Revision
D34280: riscv: Add support for enabling SV48 mode
Parents
rG6ce716f7c31a: riscv: Add support for dynamically allocating L1 page table pages
Branches
Unknown
Tags
Unknown