Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/amd64/pmap.c
Context not available. | |||||
* one or two pages may be held during the wait, only to be released | * one or two pages may be held during the wait, only to be released | ||||
* afterwards. This conservative approach is easily argued to avoid | * afterwards. This conservative approach is easily argued to avoid | ||||
* race conditions. | * race conditions. | ||||
* | |||||
* The ptepindexes, i.e. page indices of the page table pages encountered | |||||
markj: There should be a comma after "page indices", otherwise it is not really clear what "i.e."… | |||||
* while translating virtual address va are defined as follows: | |||||
Done Inline ActionsWhat follows will be clearer if this sentence explicitly defines ptepindex as the page index of a page table page. alc: What follows will be clearer if this sentence explicitly defines ptepindex as the page index of… | |||||
* - for the page table page (last level), | |||||
* ptepindex = pmap_pde_pindex(va) = va >> PDRSHIFT, | |||||
* in other words, it is just the index of the PDE that maps the page | |||||
Done Inline Actions"... the PDE that maps the page table page." alc: "... the PDE that maps the page table page." | |||||
* table page. | |||||
* - for the page directory page, | |||||
* ptepindex = NUPDE (number of userland PD entries) + | |||||
* (pmap_pde_index(va) >> NPDEPGSHIFT) | |||||
Done Inline ActionsMaybe clarify also that the PML4 page always has pindex 0? markj: Maybe clarify also that the PML4 page always has pindex 0? | |||||
Done Inline ActionsPML4 page does not have index for the purpose of _pmap_allocpte() which uses this numbering. The PML4 page is statically allocated at the pinit() time. In fact, the pteindex 0 is assigned to the pte which maps at zero. kib: PML4 page does not have index for the purpose of _pmap_allocpte() which uses this numbering. | |||||
Done Inline ActionsIndeed, I just thought it would be useful to clarify this fact for completeness. markj: Indeed, I just thought it would be useful to clarify this fact for completeness. | |||||
* i.e. index of PDPE is put after the last index of PDE, | |||||
* - for the page directory pointer page, | |||||
* ptepindex = NUPDE + NUPDPE + (pmap_pde_index(va) >> (NPDEPGSHIFT + | |||||
* NPML4EPGSHIFT), | |||||
* i.e. index of pml4e is put after the last index of PDPE. | |||||
* | |||||
* Define an order on the paging entries, where all entries of the | |||||
* same height are put together, then heights are put from deepest to | |||||
* root. Then ptexpindex is the sequential number of the | |||||
* corresponding paging entry in this order. | |||||
Done Inline ActionsI think that this sentence is hard to understand. alc: I think that this sentence is hard to understand. | |||||
* | |||||
* The root page at PML4 does not participate in this indexing scheme, since | |||||
* it is statically allocated by pmap_pinit() and not by _pmap_allocpte(). | |||||
*/ | */ | ||||
static vm_page_t | static vm_page_t | ||||
_pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp) | _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp) | ||||
Context not available. |
There should be a comma after "page indices", otherwise it is not really clear what "i.e." refers to.