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
Unknown Object (File)
Wed, Jul 8, 2:24 PM
Unknown Object (File)
Tue, Jul 7, 4:43 AM
Unknown Object (File)
Mon, Jul 6, 2:44 AM
Unknown Object (File)
Sat, Jul 4, 8:13 AM
Unknown Object (File)
Sun, Jun 28, 3:37 PM
Unknown Object (File)
Sat, Jun 27, 5:09 PM
Unknown Object (File)
Sat, Jun 27, 5:05 PM
Unknown Object (File)
Fri, Jun 26, 1:19 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

Event Timeline

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

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?

Address @markj 's and @mhorne 's comments:

  • add an svinval-aware pmap_invalidate_page variant
  • remove awkward atop conversion
This revision now requires review to proceed.Sun, Jul 5, 12:45 PM
This revision is now accepted and ready to land.Thu, Jul 9, 5:21 PM