Page MenuHomeFreeBSD

Allow the creation of 3 level page tables
ClosedPublic

Authored by andrew on Aug 14 2020, 10:54 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 27 2023, 7:02 AM
Unknown Object (File)
Dec 22 2023, 11:54 PM
Unknown Object (File)
Nov 28 2023, 7:05 PM
Unknown Object (File)
Nov 22 2023, 8:42 PM
Unknown Object (File)
Nov 21 2023, 9:43 PM
Unknown Object (File)
Nov 18 2023, 8:28 AM
Unknown Object (File)
Nov 7 2023, 7:17 PM
Unknown Object (File)
Nov 4 2023, 11:06 AM
Subscribers

Details

Summary

The stage 2 arm64 page tables may need to start at a lower level. This
is because we may only be able to map a limited IPA range and trying
to use a full 4 levels will cause the CPU to fault in an unrecoverable
way.

To simplify the code we still allocate the full 4 levels, however level 0
will only ever be used to find the level 1 table used as the base. Handle
this by creating a dummy entry in the level 0 table to point to the level 1
table.

Diff Detail

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

Event Timeline

sys/arm64/arm64/pmap.c
1693 ↗(On Diff #75821)

Maybe s/we are releasing it/until pmap_release() is called/.

1961 ↗(On Diff #75821)

Please avoid adding new uses of boolean_t, bool is fine.

1974 ↗(On Diff #75821)

Aren't we leaking the L3 page?

6142 ↗(On Diff #75821)

It might be nicer to precompute this value and store it in the pmap, otherwise we are re-computing an effectively constant value on every context switch. That is, store the root paddr in a common field so that we don't need to check pm_levels.

  • Store the ttbr address so we don't need to walk the page tables
  • Free pages in pmap_release
  • Update the wording of a comment in pmap_pinit_stage
sys/arm64/arm64/pmap.c
1961 ↗(On Diff #75821)

I used boolean_t as that's the return type of pmap_unwire_l3.

Load the free list in pmap_release

This revision was not accepted when it landed; it landed in state Needs Review.Nov 4 2020, 10:21 AM
This revision was automatically updated to reflect the committed changes.