Page MenuHomeFreeBSD

riscv: Add support for the Svinval extension
ClosedPublic

Authored by bnovkov on Jun 17 2026, 9:21 PM.
Tags
None
Referenced Files
F170849572: D57623.id183782.diff
Mon, Sep 7, 12:55 AM
Unknown Object (File)
Sun, Sep 6, 4:12 AM
Unknown Object (File)
Sun, Sep 6, 3:27 AM
Unknown Object (File)
Sat, Sep 5, 6:48 PM
Unknown Object (File)
Sat, Sep 5, 4:15 PM
Unknown Object (File)
Fri, Sep 4, 10:20 PM
Unknown Object (File)
Fri, Sep 4, 10:19 PM
Unknown Object (File)
Tue, Sep 1, 6:49 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 Not Applicable
Unit
Tests Not Applicable

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.