Page MenuHomeFreeBSD

MI VM: Make it possible to set size of superpage at boot instead of compile time.
ClosedPublic

Authored by kib on Jan 16 2019, 6:26 AM.

Details

Summary

In order to allow single kernel to use PAE pagetables on i386 if hardware supports it, and fall back to classic two-level paging structures if not, superpage code should be able to adopt to either 2M or 4M superpages size. There I make MI VM structures large enough to track the biggest possible superpage, by allowing architecture to define VM_NFREEORDER_MAX and VM_LEVEL_0_ORDER_MAX constants. Corresponding VM_NFREEORDER and VM_LEVEL_0_ORDER symbols can be defined as runtime values and must be less than the _MAX constants. If architecture does not define _MAXs, it is assumed that _MAX == normal constants.

Tested by: pho (as part of the large patch)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Do you plan to use PAE page tables even if there is less than 4GB of physical memory available?

sys/vm/vm_reserv.c
80 ↗(On Diff #52883)

Style nit: there should be no tab after #ifndef.

This revision is now accepted and ready to land.Jan 16 2019, 5:14 PM

Do you plan to use PAE page tables even if there is less than 4GB of physical memory available?

Yes, the main motivation for the change is nx bit. It may be worth to not use PAE if there is no nx support and the memory is < 4G, because page tables are smaller and there is no need to use cmpxchg8b for updates. I will look at it.

This revision was automatically updated to reflect the committed changes.