Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/amd64/pmap.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 7,141 Lines • ▼ Show 20 Lines | pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t newpde, u_int flags, | ||||
/* | /* | ||||
* If pkru is not same for the whole pde range, return failure | * If pkru is not same for the whole pde range, return failure | ||||
* and let vm_fault() cope. Check after pde allocation, since | * and let vm_fault() cope. Check after pde allocation, since | ||||
* it could sleep. | * it could sleep. | ||||
*/ | */ | ||||
if (!pmap_pkru_same(pmap, va, va + NBPDR)) { | if (!pmap_pkru_same(pmap, va, va + NBPDR)) { | ||||
pmap_abort_ptp(pmap, va, pdpg); | pmap_abort_ptp(pmap, va, pdpg); | ||||
return (KERN_FAILURE); | return (KERN_PROTECTION_FAILURE); | ||||
kib: This is fine and makes things consistent with pmap_enter_largepage(), but now I see that there… | |||||
} | } | ||||
if (va < VM_MAXUSER_ADDRESS && pmap->pm_type == PT_X86) { | if (va < VM_MAXUSER_ADDRESS && pmap->pm_type == PT_X86) { | ||||
newpde &= ~X86_PG_PKU_MASK; | newpde &= ~X86_PG_PKU_MASK; | ||||
newpde |= pmap_pkru_get(pmap, va); | newpde |= pmap_pkru_get(pmap, va); | ||||
} | } | ||||
/* | /* | ||||
* If there are existing mappings, either abort or remove them. | * If there are existing mappings, either abort or remove them. | ||||
▲ Show 20 Lines • Show All 4,475 Lines • Show Last 20 Lines |
This is fine and makes things consistent with pmap_enter_largepage(), but now I see that there are some issues with KERN_PROTECTION_FAILURE.
Since they are mine and pre-existing, I propose D29442.