Page MenuHomeFreeBSD

Rename pmap_is_write() to pmap_l3_writable().
ClosedPublic

Authored by markj on Dec 6 2018, 10:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 11, 11:39 AM
Unknown Object (File)
Tue, Feb 25, 5:31 AM
Unknown Object (File)
Feb 1 2025, 1:10 AM
Unknown Object (File)
Jan 22 2025, 1:28 PM
Unknown Object (File)
Dec 10 2024, 8:02 PM
Unknown Object (File)
Nov 28 2024, 8:19 AM
Unknown Object (File)
Nov 24 2024, 10:33 PM
Unknown Object (File)
Nov 22 2024, 10:40 PM
Subscribers

Details

Summary

This is consistent with pmap_l3_valid(), for instance. Fix style bugs
along the way. No functional change intended.

Test Plan

Booted under QEMU and spike.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj added reviewers: br, jhb.
sys/riscv/riscv/pmap.c
360 ↗(On Diff #51686)

If we support superpages eventually then we might not want l3 in this name? That might be true for pmap_l3_valid as well? (Or will we only use this function on leaf PTEs?)

markj added inline comments.
sys/riscv/riscv/pmap.c
360 ↗(On Diff #51686)

I was wondering about that too, as I'm starting to work on superpage support. We'll probably eventually have a use for an is_writable predicate for superpage mappings (ditto for the other predicates below). One wrinkle, though, is that we use distinct types (pd_entry_t vs. pt_entry_t). I'm not sure if that indicates that we should instead use a macro or just test bits inline. I lean somewhat towards the latter, since the flag names are pretty clear.

sys/riscv/riscv/pmap.c
360 ↗(On Diff #51686)

I think it is also probably readable to just test bits inline. What does amd64 do? That's probably the best pmap to be copying from.

markj added inline comments.
sys/riscv/riscv/pmap.c
360 ↗(On Diff #51686)

amd64 is hamstrung by the fact that the bit definitions vary depending on the pmap type, so it's more or less forced to look up the definition once and then use inline tests.

I'll think about it a bit more, but I'm inclined to just get rid of these predicates and inline everything. I'll upload the diff here once that's done.

  • Get rid of the (inconsistently used) predicates and just use inline tests.
This revision is now accepted and ready to land.Dec 7 2018, 11:47 PM
This revision was automatically updated to reflect the committed changes.