Lines 3332-3339
Link Here
|
3332 |
pmap_protect_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t sva, vm_prot_t prot) |
3332 |
pmap_protect_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t sva, vm_prot_t prot) |
3333 |
{ |
3333 |
{ |
3334 |
pd_entry_t newpde, oldpde; |
3334 |
pd_entry_t newpde, oldpde; |
3335 |
vm_offset_t eva, va; |
3335 |
vm_page_t m, mt; |
3336 |
vm_page_t m; |
|
|
3337 |
boolean_t anychanged; |
3336 |
boolean_t anychanged; |
3338 |
|
3337 |
|
3339 |
PMAP_LOCK_ASSERT(pmap, MA_OWNED); |
3338 |
PMAP_LOCK_ASSERT(pmap, MA_OWNED); |
Lines 3342-3356
Link Here
|
3342 |
anychanged = FALSE; |
3341 |
anychanged = FALSE; |
3343 |
retry: |
3342 |
retry: |
3344 |
oldpde = newpde = *pde; |
3343 |
oldpde = newpde = *pde; |
3345 |
if ((oldpde & (PG_MANAGED | PG_M | PG_RW)) == |
3344 |
if ((prot & VM_PROT_WRITE) == 0) { |
3346 |
(PG_MANAGED | PG_M | PG_RW)) { |
3345 |
if ((oldpde & (PG_MANAGED | PG_M | PG_RW)) == |
3347 |
eva = sva + NBPDR; |
3346 |
(PG_MANAGED | PG_M | PG_RW)) { |
3348 |
for (va = sva, m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME); |
3347 |
m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME); |
3349 |
va < eva; va += PAGE_SIZE, m++) |
3348 |
for (mt = m; mt < &m[NBPDR / PAGE_SIZE]; mt++) |
3350 |
vm_page_dirty(m); |
3349 |
vm_page_dirty(mt); |
|
|
3350 |
} |
3351 |
newpde &= ~(PG_RW | PG_M); |
3351 |
} |
3352 |
} |
3352 |
if ((prot & VM_PROT_WRITE) == 0) |
|
|
3353 |
newpde &= ~(PG_RW | PG_M); |
3354 |
#if defined(PAE) || defined(PAE_TABLES) |
3353 |
#if defined(PAE) || defined(PAE_TABLES) |
3355 |
if ((prot & VM_PROT_EXECUTE) == 0) |
3354 |
if ((prot & VM_PROT_EXECUTE) == 0) |
3356 |
newpde |= pg_nx; |
3355 |
newpde |= pg_nx; |