Page MenuHomeFreeBSD

riscv: Add support for the Svinval extension
ClosedPublic

Authored by bnovkov on Jun 17 2026, 9:21 PM.
Tags
None
Referenced Files
F167782116: D57623.diff
Mon, Aug 24, 12:20 PM
Unknown Object (File)
Sat, Aug 15, 1:41 AM
Unknown Object (File)
Sat, Aug 15, 1:41 AM
Unknown Object (File)
Thu, Aug 13, 3:10 AM
Unknown Object (File)
Thu, Aug 13, 12:09 AM
Unknown Object (File)
Mon, Aug 10, 1:50 PM
Unknown Object (File)
Mon, Aug 10, 11:40 AM
Unknown Object (File)
Sat, Aug 8, 11:41 PM
Subscribers

Details

Summary

This change adds wrappers for the new fine-grained TLB invalidation
instructions and extends the capability detection logic to include
the Svinval extension, which is mandatory in the RVA23S64 profile.

Event: BSDCan 2026

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 73948
Build 70831: arc lint + arc unit

Event Timeline

mhorne added a subscriber: mhorne.

Is this implemented on the Spacemit K1 ?

sys/riscv/include/cpufunc.h
151

I don't think you are using this yet. But I would suggest this signature instead.

This revision is now accepted and ready to land.Jun 24 2026, 1:50 PM
sys/conf/kern.mk
169

Are there compilers which will reject this?

sys/riscv/include/cpufunc.h
151

+1

sys/conf/kern.mk
169

Looking at the gcc docs it seems that the syntax is the same.

sys/riscv/include/cpufunc.h
151

thank you for the suggestion, I'll work it into the patch before committing.

jrtc27 added inline comments.
sys/conf/kern.mk
169

Don't know what version it was added in for GCC, but for LLVM it was LLVM 16 https://github.com/llvm/llvm-project/commit/7d7940fd7761e21b68f915e948389b87835d1304

Probably safe to not gate this on such a version check; even CHERI LLVM is LLVM 17

Is this implemented on the Spacemit K1 ?

Sorry, I managed to miss your question. Yes, this extension is implemented on the K1 and I've tested the patches on a banana PI F3.

This revision was automatically updated to reflect the committed changes.