Page MenuHomeFreeBSD

D25187.id73656.diff
No OneTemporary

D25187.id73656.diff

Index: sys/amd64/amd64/pmap.c
===================================================================
--- sys/amd64/amd64/pmap.c
+++ sys/amd64/amd64/pmap.c
@@ -3807,6 +3807,23 @@
* one or two pages may be held during the wait, only to be released
* afterwards. This conservative approach is easily argued to avoid
* race conditions.
+ *
+ * The page index of the page containing PTE at address va is defined
+ * as follows:
+ * - for page table (last level),
+ * ptepindex = pmap_pde_pindex(va) = va >> PDRSHIFT,
+ * in other words, it is just the index of the PDE.
+ * - for page directory page,
+ * ptepindex = NUPDE (number of userland PD entries) +
+ * (pmap_pde_index(va) >> NPDEPGSHIFT)
+ * i.e. index of PDPE is put after the last index of PDE,
+ * - for 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.
+ * In other words, it is sequential number of the corresponding paging entry
+ * in the order where all entries of the same height are put together, then
+ * heights are put from deepest to root.
*/
static vm_page_t
_pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp)

File Metadata

Mime Type
text/plain
Expires
Mon, Jun 15, 2:08 AM (18 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33962506
Default Alt Text
D25187.id73656.diff (1 KB)

Event Timeline