X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=mm%2Fmprotect.c;h=9eafe2582ebf33b2d324e6c3529e6068a8a11d27;hb=refs%2Fheads%2Fvserver;hp=f23231f7e794b4eb39cf47f05599caed44513c88;hpb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;p=linux-2.6.git diff --git a/mm/mprotect.c b/mm/mprotect.c index f23231f7e..9eafe2582 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -35,6 +35,7 @@ static void change_pte_range(struct mm_struct *mm, pmd_t *pmd, spinlock_t *ptl; pte = pte_offset_map_lock(mm, pmd, addr, &ptl); + arch_enter_lazy_mmu_mode(); do { oldpte = *pte; if (pte_present(oldpte)) { @@ -71,6 +72,7 @@ static void change_pte_range(struct mm_struct *mm, pmd_t *pmd, } } while (pte++, addr += PAGE_SIZE, addr != end); + arch_leave_lazy_mmu_mode(); pte_unmap_unlock(pte - 1, ptl); } @@ -192,8 +194,6 @@ success: * held in write mode. */ vma->vm_flags = newflags; - if (oldflags & VM_EXEC) - arch_remove_exec_range(current->mm, old_end); vma->vm_page_prot = protection_map[newflags & (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)]; if (vma_wants_writenotify(vma)) { @@ -202,6 +202,9 @@ success: dirty_accountable = 1; } + if (oldflags & VM_EXEC) + arch_remove_exec_range(current->mm, old_end); + if (is_vm_hugetlb_page(vma)) hugetlb_change_protection(vma, start, end, vma->vm_page_prot); else