Changeset View
Changeset View
Standalone View
Standalone View
head/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) { | ||||
/* | |||||
* PTI: Make all user-space mappings in the | |||||
* kernel-mode page table no-execute so that | |||||
* we detect any programming errors that leave | |||||
* the kernel-mode page table active on return | |||||
* to user space. | |||||
*/ | |||||
*pml4 |= pg_nx; | |||||
pml4u = &pmap->pm_pml4u[pml4index]; | pml4u = &pmap->pm_pml4u[pml4index]; | ||||
*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; | ||||
▲ Show 20 Lines • Show All 5,300 Lines • Show Last 20 Lines |