Page MenuHomeFreeBSD

riscv/pmap.c: Add an Svinval-aware variant of pmap_invalidate_range
AcceptedPublic

Authored by bnovkov on Wed, Jun 17, 9:23 PM.
Tags
None
Referenced Files
F160597476: D57624.diff
Fri, Jun 26, 1:19 AM
F160597247: D57624.diff
Fri, Jun 26, 1:16 AM
Unknown Object (File)
Wed, Jun 24, 4:12 PM
Unknown Object (File)
Wed, Jun 24, 6:08 AM
Unknown Object (File)
Tue, Jun 23, 8:47 PM
Unknown Object (File)
Sat, Jun 20, 8:13 PM
Unknown Object (File)
Sat, Jun 20, 6:41 PM
Unknown Object (File)
Fri, Jun 19, 11:16 AM
Subscribers

Details

Reviewers
markj
mhorne
Group Reviewers
riscv
Summary

This change introduces a variant of pmap_invalidate_range that uses
the fine-grained TLB invalidation instructions introduced by the
Svinval extension. These instructions allow for more efficient TLB
flushing on certain implementations. Under this new scheme,
pmap_invalidate_range was converted to an ifunc that selects the
appropriate variant during boot.

Event: BSDCan 2026

Diff Detail

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

Event Timeline

mhorne added a subscriber: mhorne.
mhorne added inline comments.
sys/riscv/riscv/pmap.c
1121–1122
This revision is now accepted and ready to land.Wed, Jun 24, 2:03 PM
sys/riscv/riscv/pmap.c
1108

The relationship between this check and the definition above was a momentary confusion for me.

You might do away with the atop() and PAGE_SIZE division altogether.

Why not use this for pmap_invalidate_page() as well?