Lines Matching refs:ptdesc
46 struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL, CRST_ALLOC_ORDER);
48 if (!ptdesc)
50 arch_set_page_dat(ptdesc_page(ptdesc), CRST_ALLOC_ORDER);
51 return (unsigned long *) ptdesc_to_virt(ptdesc);
143 struct ptdesc *ptdesc;
146 ptdesc = pagetable_alloc(GFP_KERNEL, 0);
147 if (ptdesc) {
148 table = (u64 *)ptdesc_to_virt(ptdesc);
153 return ptdesc_page(ptdesc);
246 struct ptdesc *ptdesc;
254 ptdesc = list_first_entry(&mm->context.pgtable_list,
255 struct ptdesc, pt_list);
256 mask = atomic_read(&ptdesc->_refcount) >> 24;
268 table = (unsigned long *) ptdesc_to_virt(ptdesc);
272 atomic_xor_bits(&ptdesc->_refcount,
274 list_del_init(&ptdesc->pt_list);
282 ptdesc = pagetable_alloc(GFP_KERNEL, 0);
283 if (!ptdesc)
285 if (!pagetable_pte_ctor(ptdesc)) {
286 pagetable_free(ptdesc);
289 arch_set_page_dat(ptdesc_page(ptdesc), 0);
291 table = (unsigned long *) ptdesc_to_virt(ptdesc);
294 INIT_LIST_HEAD(&ptdesc->pt_list);
295 atomic_xor_bits(&ptdesc->_refcount, 0x03U << 24);
300 atomic_xor_bits(&ptdesc->_refcount, 0x01U << 24);
303 list_add(&ptdesc->pt_list, &mm->context.pgtable_list);
326 struct ptdesc *ptdesc;
328 ptdesc = container_of(head, struct ptdesc, pt_rcu_head);
329 pagetable_pte_dtor(ptdesc);
330 pagetable_free(ptdesc);
336 struct ptdesc *ptdesc = virt_to_ptdesc(table);
347 mask = atomic_xor_bits(&ptdesc->_refcount, 0x11U << (bit + 24));
349 if ((mask & 0x03U) && !folio_test_active(ptdesc_folio(ptdesc))) {
355 list_add(&ptdesc->pt_list, &mm->context.pgtable_list);
358 list_del_init(&ptdesc->pt_list);
361 mask = atomic_xor_bits(&ptdesc->_refcount, 0x10U << (bit + 24));
368 mask = atomic_xor_bits(&ptdesc->_refcount, 0x03U << 24);
372 page_table_release_check(ptdesc_page(ptdesc), table, half, mask);
373 if (folio_test_clear_active(ptdesc_folio(ptdesc)))
374 call_rcu(&ptdesc->pt_rcu_head, pte_free_now);
376 pte_free_now(&ptdesc->pt_rcu_head);
384 struct ptdesc *ptdesc = virt_to_ptdesc(table);
400 mask = atomic_xor_bits(&ptdesc->_refcount, 0x11U << (bit + 24));
402 if ((mask & 0x03U) && !folio_test_active(ptdesc_folio(ptdesc))) {
409 list_add_tail(&ptdesc->pt_list, &mm->context.pgtable_list);
412 list_del_init(&ptdesc->pt_list);
423 struct ptdesc *ptdesc = virt_to_ptdesc(table);
427 pagetable_free(ptdesc);
431 mask = atomic_xor_bits(&ptdesc->_refcount, mask << (4 + 24));
437 mask = atomic_xor_bits(&ptdesc->_refcount, 0x03U << 24);
442 page_table_release_check(ptdesc_page(ptdesc), table, half, mask);
443 if (folio_test_clear_active(ptdesc_folio(ptdesc)))
444 call_rcu(&ptdesc->pt_rcu_head, pte_free_now);
446 pte_free_now(&ptdesc->pt_rcu_head);
490 struct ptdesc *ptdesc;
492 ptdesc = pagetable_alloc(GFP_KERNEL & ~__GFP_HIGHMEM, CRST_ALLOC_ORDER);
493 if (!ptdesc)
495 table = ptdesc_address(ptdesc);