Page MenuHomeFreeBSD

amd64 pmap: More unification for psind = 1 vs 2 in pmap_enter_largepage().
ClosedPublic

Authored by kib on Sep 21 2020, 4:14 PM.
Tags
None
Referenced Files
F81898129: D26513.id77319.diff
Mon, Apr 22, 8:41 PM
F81898127: D26513.id77368.diff
Mon, Apr 22, 8:41 PM
Unknown Object (File)
Jan 5 2024, 4:43 AM
Unknown Object (File)
Jan 3 2024, 9:43 PM
Unknown Object (File)
Dec 31 2023, 7:47 AM
Unknown Object (File)
Dec 31 2023, 5:43 AM
Unknown Object (File)
Dec 20 2023, 6:43 AM
Unknown Object (File)
Dec 10 2023, 5:51 PM
Subscribers

Details

Summary

Move

  • pkru check
  • wait for page alloc
  • wire accounting update
  • asserting allowed updates for valid mappings

out of psind conditions.

Also add assert that psind references supported page size.

[The diff was generated before r365951]

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 33701

Event Timeline

kib requested review of this revision.Sep 21 2020, 4:14 PM
sys/amd64/amd64/pmap.c
6547

PG_FRAME -> PG_PS_FRAME

(This is sufficient to exclude the PAT bit from the comparison. There is no reason to handle 1 GB pages specifically.)

6568–6569

I don't understand this sentence. We often modify the paging structure, which I interpret to mean page table, with only a read lock on the vm map.

kib marked 2 inline comments as done.Sep 21 2020, 8:04 PM
kib added inline comments.
sys/amd64/amd64/pmap.c
6568–6569

Yes, it is (no longer) valid. Initial version of the largepage change instantiated mappings on mmap(2). My reasoning was that it does not make much sense to wait for access to the mmaped region where the pages are essentially wired.

After discussion with Mark I moved the instantiation to fault handler but the comment was not properly adjusted.

I deleted it now.

kib marked an inline comment as done.

Remove no longer valid comment.
Compare only phys addresses when asserting allowed change in large mapping.

This revision is now accepted and ready to land.Sep 22 2020, 12:16 PM
sys/amd64/amd64/pmap.c
6510

Why rewalk the page table from the root? Use mp in the same way as below (lines 6531-6532) to more cheaply calculate the pdpe.

6515

In this case, there is no need to rewalk the page table from the root, i.e., repeat the pmap_pml4e(). pmap_pml4e_to_pdpe() can be used.

kib marked 2 inline comments as done.

Avoid page table rewalking, as suggested by alc.

This revision now requires review to proceed.Sep 22 2020, 6:58 PM

Is it documented anywhere what can versus can't be done to a non-transparent mapping?

sys/amd64/amd64/pmap.c
6548

pde -> origpte

This revision is now accepted and ready to land.Sep 22 2020, 10:50 PM
kib marked an inline comment as done.Sep 22 2020, 11:08 PM
In D26513#590433, @alc wrote:

Is it documented anywhere what can versus can't be done to a non-transparent mapping?

No, there is no such documentation. Effectively we only allow permissions changes and emulate fake wiring status.

Even userspace API docs are not yet written. Arguably it is still premature.