Lines Matching refs:page
58 struct page *page = alloc_pages(GFP_KERNEL, ALLOC_ORDER); in crst_table_alloc() local
60 if (!page) in crst_table_alloc()
62 page->index = 0; in crst_table_alloc()
64 struct page *shadow = alloc_pages(GFP_KERNEL, ALLOC_ORDER); in crst_table_alloc()
66 __free_pages(page, ALLOC_ORDER); in crst_table_alloc()
69 page->index = page_to_phys(shadow); in crst_table_alloc()
72 list_add(&page->lru, &mm->context.crst_list); in crst_table_alloc()
74 return (unsigned long *) page_to_phys(page); in crst_table_alloc()
80 struct page *page = virt_to_page(table); in crst_table_free() local
83 list_del(&page->lru); in crst_table_free()
170 struct page *page; in page_table_alloc() local
176 page = NULL; in page_table_alloc()
178 page = list_first_entry(&mm->context.pgtable_list, in page_table_alloc()
179 struct page, lru); in page_table_alloc()
180 if ((page->flags & FRAG_MASK) == ((1UL << TABLES_PER_PAGE) - 1)) in page_table_alloc()
181 page = NULL; in page_table_alloc()
183 if (!page) { in page_table_alloc()
185 page = alloc_page(GFP_KERNEL|__GFP_REPEAT); in page_table_alloc()
186 if (!page) in page_table_alloc()
188 pgtable_page_ctor(page); in page_table_alloc()
189 page->flags &= ~FRAG_MASK; in page_table_alloc()
190 table = (unsigned long *) page_to_phys(page); in page_table_alloc()
196 list_add(&page->lru, &mm->context.pgtable_list); in page_table_alloc()
198 table = (unsigned long *) page_to_phys(page); in page_table_alloc()
199 while (page->flags & bits) { in page_table_alloc()
203 page->flags |= bits; in page_table_alloc()
204 if ((page->flags & FRAG_MASK) == ((1UL << TABLES_PER_PAGE) - 1)) in page_table_alloc()
205 list_move_tail(&page->lru, &mm->context.pgtable_list); in page_table_alloc()
212 struct page *page; in page_table_free() local
217 page = pfn_to_page(__pa(table) >> PAGE_SHIFT); in page_table_free()
219 page->flags ^= bits; in page_table_free()
220 if (page->flags & FRAG_MASK) { in page_table_free()
222 list_move(&page->lru, &mm->context.pgtable_list); in page_table_free()
223 page = NULL; in page_table_free()
226 list_del(&page->lru); in page_table_free()
228 if (page) { in page_table_free()
229 pgtable_page_dtor(page); in page_table_free()
230 __free_page(page); in page_table_free()
236 struct page *page; in disable_noexec() local
240 list_for_each_entry(page, &mm->context.crst_list, lru) in disable_noexec()
241 if (page->index) { in disable_noexec()
242 free_pages((unsigned long) page->index, ALLOC_ORDER); in disable_noexec()
243 page->index = 0; in disable_noexec()
246 list_for_each_entry(page, &mm->context.pgtable_list, lru) in disable_noexec()
247 page->flags &= ~SECOND_HALVES; in disable_noexec()