Page MenuHomeFreeBSD

riscv: T-HEAD PBMT support
Needs ReviewPublic

Authored by mhorne on Jun 3 2024, 6:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 7, 12:38 PM
Unknown Object (File)
Wed, Nov 6, 3:46 PM
Unknown Object (File)
Fri, Oct 25, 12:44 AM
Unknown Object (File)
Oct 19 2024, 10:51 AM
Unknown Object (File)
Oct 12 2024, 9:53 PM
Unknown Object (File)
Sep 27 2024, 3:12 PM
Unknown Object (File)
Sep 21 2024, 7:39 AM
Unknown Object (File)
Sep 21 2024, 12:00 AM
Subscribers

Details

Reviewers
markj
br
jrtc27
jhb
Group Reviewers
riscv
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 60411
Build 57295: arc lint + arc unit

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.Tue, Nov 5, 8:43 PM
mhorne retitled this revision from [DRAFT/RFC] riscv: T-HEAD PBMT support to riscv: T-HEAD PBMT support.Tue, Nov 5, 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.