Page MenuHomeFreeBSD

riscv: mark kernel page table entries as global
Needs ReviewPublic

Authored by mhorne on Thu, Aug 20, 3:01 PM.
Tags
None
Referenced Files
F170653351: D59049.diff
Sat, Sep 5, 8:12 PM
F170527408: D59049.id.diff
Sat, Sep 5, 6:14 AM
F170478006: D59049.id184556.diff
Sat, Sep 5, 12:31 AM
F170475884: D59049.id185584.diff
Sat, Sep 5, 12:18 AM
Unknown Object (File)
Fri, Sep 4, 11:06 PM
Unknown Object (File)
Fri, Sep 4, 9:03 PM
Unknown Object (File)
Fri, Sep 4, 7:20 PM
Unknown Object (File)
Fri, Sep 4, 3:29 AM
Subscribers

Details

Reviewers
markj
bnovkov
jrtc27
br
Group Reviewers
riscv
Summary

The G bit in a RISC-V PTE designates a "global" mapping; i.e. a virtual
address mapping that is valid across all contexts. Applying this bit to
kernel mappings offers a small performance benefit as it allows these
translations to be preserved during a normal TLB flush, for example
during a context switch.

This bit is applied to all L1 kernel PTEs, and only these. The spec
declares that the global bit can be set at any level, and is inherited
by all children. Applying it at this level yields the smallest and
simplest diff.

Use of the feature is toggleable via hw.pmap.global_bit_enable tunable.

Diff Detail

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

Event Timeline

sys/riscv/riscv/pmap.c
1949

Should this also be marked with pte_g if pmap == kernel_pmap ?

sys/riscv/riscv/pmap.c
1949

Yes, it looks like it! kmem_alloc_contig() and others can reach here.

Thanks, will update.

mhorne marked an inline comment as done.

Apply pte_g in _pmap_alloc_l3() as well.