Page MenuHomeFreeBSD

riscv: Add support for enabling SV48 mode
ClosedPublic

Authored by markj on Feb 14 2022, 10:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 21, 4:26 PM
Unknown Object (File)
Wed, Oct 16, 3:45 PM
Unknown Object (File)
Sep 24 2024, 8:27 PM
Unknown Object (File)
Sep 24 2024, 6:26 PM
Unknown Object (File)
Sep 17 2024, 4:03 PM
Unknown Object (File)
Sep 16 2024, 6:00 PM
Unknown Object (File)
Sep 16 2024, 5:35 AM
Unknown Object (File)
Sep 16 2024, 5:35 AM
Subscribers

Details

Summary

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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb added a subscriber: jhb.
jhb added inline comments.
sys/riscv/include/riscvreg.h
153

These changes seem like an unrelated cleanup that could be earlier? Also, does this constant need UL? Perhaps it is auto-promoted as it is already bigger than MAX_INT?

sys/riscv/include/vmparam.h
212

Hmm, I guess I can see from this why you added _SV39 when you did. I would maybe still say to add PS_STRINGS_SV39 in the earlier commit?

This revision is now accepted and ready to land.Feb 15 2022, 12:23 AM
sys/riscv/include/riscvreg.h
153

Yeah, this is here just because this commit adds the first use of SATP_MODE_M. I don't think there's another suitable commit to squash this into. I suppose I could have a separate commit for this part.

I'll add the UL suffix here too just for consistency, but yeah I believe it's correct as is.

Add the UL suffix to SATP_PPN_M for consistency.

This revision now requires review to proceed.Feb 15 2022, 2:59 PM
This revision is now accepted and ready to land.Feb 15 2022, 5:39 PM
This revision was automatically updated to reflect the committed changes.