Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/amd64/pmap.c
Show First 20 Lines • Show All 2,569 Lines • ▼ Show 20 Lines | if (ptepindex >= (NUPDE + NUPDPE)) { | ||||
pml4_entry_t *pml4, *pml4u; | pml4_entry_t *pml4, *pml4u; | ||||
vm_pindex_t pml4index; | vm_pindex_t pml4index; | ||||
/* Wire up a new PDPE page */ | /* Wire up a new PDPE page */ | ||||
pml4index = ptepindex - (NUPDE + NUPDPE); | pml4index = ptepindex - (NUPDE + NUPDPE); | ||||
pml4 = &pmap->pm_pml4[pml4index]; | pml4 = &pmap->pm_pml4[pml4index]; | ||||
*pml4 = VM_PAGE_TO_PHYS(m) | PG_U | PG_RW | PG_V | PG_A | PG_M; | *pml4 = VM_PAGE_TO_PHYS(m) | PG_U | PG_RW | PG_V | PG_A | PG_M; | ||||
if (pmap->pm_pml4u != NULL && pml4index < NUPML4E) { | if (pmap->pm_pml4u != NULL && pml4index < NUPML4E) { | ||||
*pml4 |= pg_nx; | |||||
markj: This probably deserves a comment. Maybe, "Safety belt: ensure that we trap if kernel mode… | |||||
pml4u = &pmap->pm_pml4u[pml4index]; | pml4u = &pmap->pm_pml4u[pml4index]; | ||||
Not Done Inline ActionsIt seems a bit odd to mix "usermode" and "user mode." Maybe s/usermode/userland/, since it's not user mode itself that traps. markj: It seems a bit odd to mix "usermode" and "user mode." Maybe s/usermode/userland/, since it's… | |||||
*pml4u = VM_PAGE_TO_PHYS(m) | PG_U | PG_RW | PG_V | | *pml4u = VM_PAGE_TO_PHYS(m) | PG_U | PG_RW | PG_V | | ||||
PG_A | PG_M; | PG_A | PG_M; | ||||
} | } | ||||
} else if (ptepindex >= NUPDE) { | } else if (ptepindex >= NUPDE) { | ||||
vm_pindex_t pml4index; | vm_pindex_t pml4index; | ||||
vm_pindex_t pdpindex; | vm_pindex_t pdpindex; | ||||
pml4_entry_t *pml4; | pml4_entry_t *pml4; | ||||
▲ Show 20 Lines • Show All 5,299 Lines • Show Last 20 Lines |
This probably deserves a comment. Maybe, "Safety belt: ensure that we trap if kernel mode mappings leak into user mode"?