Page MenuHomeFreeBSD

riscv: T-HEAD PBMT support
ClosedPublic

Authored by mhorne on Jun 3 2024, 6:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 4:37 PM
Unknown Object (File)
Mon, Dec 9, 3:25 AM
Unknown Object (File)
Thu, Dec 5, 9:01 AM
Unknown Object (File)
Nov 25 2024, 10:19 PM
Unknown Object (File)
Nov 7 2024, 12:38 PM
Unknown Object (File)
Nov 6 2024, 3:46 PM
Unknown Object (File)
Oct 25 2024, 12:44 AM
Unknown Object (File)
Oct 19 2024, 10:51 AM
Subscribers

Details

Summary

T-HEAD CPUs provide a spec-violating implementation of page-based memory
types, using PTE bits [63:59]. Add basic support for this "errata",
referred to in some places as an "extension".

Note that this change is not enough on its own, but a workaround is
needed for the bootstrap (locore) page tables as well.

Diff Detail

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

Event Timeline

mhorne requested review of this revision.Jun 3 2024, 6:51 PM
sys/riscv/include/pte.h
111–114

Is there no attribute for cacheable RAM, or should one of the labels here (PMA) use cacheable in the description?

sys/riscv/riscv/pmap.c
4878

If you pull memattr_mask down into the prior commit, I think you can just use it directly in this function instead of the local mask temporary?

Update according to C910 specification.

Tested on hardware (Allwinner D1), with workarounds applied, which boots until
late device probing.

sys/riscv/include/pte.h
126–129

For some reason I was getting strange (incorrect) bitmasks with the previous version. This is not final but it works...

sys/riscv/riscv/pmap.c
4878

Eventually, this function might be expanded to support changing the page protection bits as well, see pmap_change_props_locked() on amd64. In this case mask and bits will apply to more than the memory attributes. Therefore I think it is fine to leave it as is.

This revision is now accepted and ready to land.Jul 30 2024, 4:44 PM

Regenerate now that the series is more complete.

This revision now requires review to proceed.Nov 5 2024, 8:43 PM
mhorne retitled this revision from [DRAFT/RFC] riscv: T-HEAD PBMT support to riscv: T-HEAD PBMT support.Nov 5 2024, 8:43 PM
mhorne edited the summary of this revision. (Show Details)
mhorne marked an inline comment as done.
mhorne added inline comments.
sys/riscv/include/pte.h
111–114

I think this was a typo. Fixed now.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 25 2024, 9:09 PM
This revision was automatically updated to reflect the committed changes.
mhorne marked an inline comment as done.