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)
Fri, Apr 19, 7:44 AM
Unknown Object (File)
Mon, Mar 25, 10:07 PM
Unknown Object (File)
Dec 22 2023, 10:27 PM
Unknown Object (File)
Dec 15 2023, 9:47 PM
Unknown Object (File)
Sep 10 2023, 8:41 PM
Unknown Object (File)
Aug 13 2023, 5:10 PM
Unknown Object (File)
Jun 19 2023, 6:30 PM
Unknown Object (File)
Jan 17 2023, 1:27 AM
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.