Lines Matching +full:protect +full:- +full:exec
1 // SPDX-License-Identifier: GPL-2.0-or-later
7 * Copyright (C) 1995-1996 Gary Thomas ([email protected])
29 #include <asm/pte-walk.h>
41 return current->thread.regs && TRAP(current->thread.regs) == 0x400; in is_exec_fault()
76 /* Server-style MMU handles coherency when hashing if HW exec permission
77 * is supposed per page (currently 64-bit only). If not, then, we always
78 * flush the cache for valid PTEs in set_pte. Embedded CPU without HW exec
90 if (!test_bit(PG_dcache_clean, &folio->flags)) { in set_pte_filter_hash()
92 set_bit(PG_dcache_clean, &folio->flags); in set_pte_filter_hash()
104 /* Embedded type MMU with HW exec support. This is a bit more complicated
106 * instead we "filter out" the exec permission for non clean pages.
108 * This is also called once for the folio. So only work with folio->flags here.
120 /* No exec permission in the first place, move on */ in set_pte_filter()
130 if (test_bit(PG_dcache_clean, &folio->flags)) in set_pte_filter()
133 /* If it's an exec fault, we flush the cache and make it clean */ in set_pte_filter()
136 set_bit(PG_dcache_clean, &folio->flags); in set_pte_filter()
155 /* So here, we only care about exec faults, as we use them in set_access_flags_filter()
164 /* So this is an exec fault, _PAGE_EXEC is not set. If it was in set_access_flags_filter()
168 if (WARN_ON(!(vma->vm_flags & VM_EXEC))) in set_access_flags_filter()
178 if (test_bit(PG_dcache_clean, &folio->flags)) in set_access_flags_filter()
183 set_bit(PG_dcache_clean, &folio->flags); in set_access_flags_filter()
196 /* Note: mm->context.id might not yet have been assigned as in set_ptes()
219 if (--nr == 0) in set_ptes()
250 assert_pte_locked(vma->vm_mm, address); in ptep_set_access_flags()
282 assert_spin_locked(huge_pte_lockptr(h, vma->vm_mm, ptep)); in huge_ptep_set_access_flags()
302 /* We need the same lock to protect the PMD table and the two PTE tables. */
386 pgd = mm->pgd + pgd_index(addr); in assert_pte_locked()
426 * when we have MSR[EE] = 0 but the paca->irq_soft_mask = IRQS_ENABLED