Lines Matching refs:pte
49 static inline int pte_looks_normal(pte_t pte) in pte_looks_normal() argument
52 if (pte_present(pte) && !pte_special(pte)) { in pte_looks_normal()
53 if (pte_ci(pte)) in pte_looks_normal()
55 if (pte_user(pte)) in pte_looks_normal()
61 static struct page *maybe_pte_to_page(pte_t pte) in maybe_pte_to_page() argument
63 unsigned long pfn = pte_pfn(pte); in maybe_pte_to_page()
82 static pte_t set_pte_filter_hash(pte_t pte) in set_pte_filter_hash() argument
85 return pte; in set_pte_filter_hash()
87 pte = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS); in set_pte_filter_hash()
88 if (pte_looks_normal(pte) && !(cpu_has_feature(CPU_FTR_COHERENT_ICACHE) || in set_pte_filter_hash()
90 struct page *pg = maybe_pte_to_page(pte); in set_pte_filter_hash()
92 return pte; in set_pte_filter_hash()
98 return pte; in set_pte_filter_hash()
103 static pte_t set_pte_filter_hash(pte_t pte) { return pte; } in set_pte_filter_hash() argument
111 static inline pte_t set_pte_filter(pte_t pte) in set_pte_filter() argument
116 return set_pte_filter_hash(pte); in set_pte_filter()
119 if (!pte_exec(pte) || !pte_looks_normal(pte)) in set_pte_filter()
120 return pte; in set_pte_filter()
123 pg = maybe_pte_to_page(pte); in set_pte_filter()
125 return pte; in set_pte_filter()
129 return pte; in set_pte_filter()
135 return pte; in set_pte_filter()
139 return pte_exprotect(pte); in set_pte_filter()
142 static pte_t set_access_flags_filter(pte_t pte, struct vm_area_struct *vma, in set_access_flags_filter() argument
148 return pte; in set_access_flags_filter()
155 if (dirty || pte_exec(pte) || !is_exec_fault()) in set_access_flags_filter()
156 return pte; in set_access_flags_filter()
164 return pte; in set_access_flags_filter()
168 pg = maybe_pte_to_page(pte); in set_access_flags_filter()
181 return pte_mkexec(pte); in set_access_flags_filter()
188 pte_t pte) in set_pte_at() argument
200 pte = set_pte_filter(pte); in set_pte_at()
203 __set_pte_at(mm, addr, ptep, pte, 0); in set_pte_at()
230 pte_t pte, int dirty) in huge_ptep_set_access_flags() argument
238 ptep_set_access_flags(vma, addr, ptep, pte, dirty); in huge_ptep_set_access_flags()
243 pte = set_access_flags_filter(pte, vma, dirty); in huge_ptep_set_access_flags()
244 changed = !pte_same(*(ptep), pte); in huge_ptep_set_access_flags()
263 __ptep_set_access_flags(vma, ptep, pte, addr, psize); in huge_ptep_set_access_flags()
270 void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte) in set_huge_pte_at() argument
283 pte = set_pte_filter(pte); in set_huge_pte_at()
285 val = pte_val(pte); in set_huge_pte_at()