Lines Matching full:pte

68 #define set_pte(ptep, pte)		native_set_pte(ptep, pte)  argument
70 #define set_pte_atomic(ptep, pte) \ argument
71 native_set_pte_atomic(ptep, pte)
155 static inline bool pte_dirty(pte_t pte) in pte_dirty() argument
157 return pte_flags(pte) & _PAGE_DIRTY_BITS; in pte_dirty()
160 static inline bool pte_shstk(pte_t pte) in pte_shstk() argument
163 (pte_flags(pte) & (_PAGE_RW | _PAGE_DIRTY)) == _PAGE_DIRTY; in pte_shstk()
166 static inline int pte_young(pte_t pte) in pte_young() argument
168 return pte_flags(pte) & _PAGE_ACCESSED; in pte_young()
171 static inline bool pte_decrypted(pte_t pte) in pte_decrypted() argument
173 return cc_mkdec(pte_val(pte)) == pte_val(pte); in pte_decrypted()
212 static inline int pte_write(pte_t pte) in pte_write() argument
218 return (pte_flags(pte) & _PAGE_RW) || pte_shstk(pte); in pte_write()
237 static inline int pte_huge(pte_t pte) in pte_huge() argument
239 return pte_flags(pte) & _PAGE_PSE; in pte_huge()
242 static inline int pte_global(pte_t pte) in pte_global() argument
244 return pte_flags(pte) & _PAGE_GLOBAL; in pte_global()
247 static inline int pte_exec(pte_t pte) in pte_exec() argument
249 return !(pte_flags(pte) & _PAGE_NX); in pte_exec()
252 static inline int pte_special(pte_t pte) in pte_special() argument
254 return pte_flags(pte) & _PAGE_SPECIAL; in pte_special()
263 static inline unsigned long pte_pfn(pte_t pte) in pte_pfn() argument
265 phys_addr_t pfn = pte_val(pte); in pte_pfn()
302 #define pte_page(pte) pfn_to_page(pte_pfn(pte)) argument
305 static inline bool pmd_leaf(pmd_t pte) in pmd_leaf() argument
307 return pmd_flags(pte) & _PAGE_PSE; in pmd_leaf()
379 static inline pte_t pte_set_flags(pte_t pte, pteval_t set) in pte_set_flags() argument
381 pteval_t v = native_pte_val(pte); in pte_set_flags()
386 static inline pte_t pte_clear_flags(pte_t pte, pteval_t clear) in pte_clear_flags() argument
388 pteval_t v = native_pte_val(pte); in pte_clear_flags()
397 * _PAGE_BIT_SAVED_DIRTY. The following functions take a PTE and transition the
401 * Dirty->SavedDirty, the condition is if the PTE is Write=0. In the case of
424 static inline pte_t pte_mksaveddirty(pte_t pte) in pte_mksaveddirty() argument
426 pteval_t v = native_pte_val(pte); in pte_mksaveddirty()
432 static inline pte_t pte_clear_saveddirty(pte_t pte) in pte_clear_saveddirty() argument
434 pteval_t v = native_pte_val(pte); in pte_clear_saveddirty()
440 static inline pte_t pte_wrprotect(pte_t pte) in pte_wrprotect() argument
442 pte = pte_clear_flags(pte, _PAGE_RW); in pte_wrprotect()
446 * a shadow stack PTE (Write=0,Dirty=1). Move the hardware in pte_wrprotect()
449 return pte_mksaveddirty(pte); in pte_wrprotect()
453 static inline int pte_uffd_wp(pte_t pte) in pte_uffd_wp() argument
455 return pte_flags(pte) & _PAGE_UFFD_WP; in pte_uffd_wp()
458 static inline pte_t pte_mkuffd_wp(pte_t pte) in pte_mkuffd_wp() argument
460 return pte_wrprotect(pte_set_flags(pte, _PAGE_UFFD_WP)); in pte_mkuffd_wp()
463 static inline pte_t pte_clear_uffd_wp(pte_t pte) in pte_clear_uffd_wp() argument
465 return pte_clear_flags(pte, _PAGE_UFFD_WP); in pte_clear_uffd_wp()
469 static inline pte_t pte_mkclean(pte_t pte) in pte_mkclean() argument
471 return pte_clear_flags(pte, _PAGE_DIRTY_BITS); in pte_mkclean()
474 static inline pte_t pte_mkold(pte_t pte) in pte_mkold() argument
476 return pte_clear_flags(pte, _PAGE_ACCESSED); in pte_mkold()
479 static inline pte_t pte_mkexec(pte_t pte) in pte_mkexec() argument
481 return pte_clear_flags(pte, _PAGE_NX); in pte_mkexec()
484 static inline pte_t pte_mkdirty(pte_t pte) in pte_mkdirty() argument
486 pte = pte_set_flags(pte, _PAGE_DIRTY | _PAGE_SOFT_DIRTY); in pte_mkdirty()
488 return pte_mksaveddirty(pte); in pte_mkdirty()
491 static inline pte_t pte_mkwrite_shstk(pte_t pte) in pte_mkwrite_shstk() argument
493 pte = pte_clear_flags(pte, _PAGE_RW); in pte_mkwrite_shstk()
495 return pte_set_flags(pte, _PAGE_DIRTY); in pte_mkwrite_shstk()
498 static inline pte_t pte_mkyoung(pte_t pte) in pte_mkyoung() argument
500 return pte_set_flags(pte, _PAGE_ACCESSED); in pte_mkyoung()
503 static inline pte_t pte_mkwrite_novma(pte_t pte) in pte_mkwrite_novma() argument
505 return pte_set_flags(pte, _PAGE_RW); in pte_mkwrite_novma()
509 pte_t pte_mkwrite(pte_t pte, struct vm_area_struct *vma);
512 static inline pte_t pte_mkhuge(pte_t pte) in pte_mkhuge() argument
514 return pte_set_flags(pte, _PAGE_PSE); in pte_mkhuge()
517 static inline pte_t pte_clrhuge(pte_t pte) in pte_clrhuge() argument
519 return pte_clear_flags(pte, _PAGE_PSE); in pte_clrhuge()
522 static inline pte_t pte_mkglobal(pte_t pte) in pte_mkglobal() argument
524 return pte_set_flags(pte, _PAGE_GLOBAL); in pte_mkglobal()
527 static inline pte_t pte_clrglobal(pte_t pte) in pte_clrglobal() argument
529 return pte_clear_flags(pte, _PAGE_GLOBAL); in pte_clrglobal()
532 static inline pte_t pte_mkspecial(pte_t pte) in pte_mkspecial() argument
534 return pte_set_flags(pte, _PAGE_SPECIAL); in pte_mkspecial()
537 static inline pte_t pte_mkdevmap(pte_t pte) in pte_mkdevmap() argument
539 return pte_set_flags(pte, _PAGE_SPECIAL|_PAGE_DEVMAP); in pte_mkdevmap()
706 static inline int pte_soft_dirty(pte_t pte) in pte_soft_dirty() argument
708 return pte_flags(pte) & _PAGE_SOFT_DIRTY; in pte_soft_dirty()
721 static inline pte_t pte_mksoft_dirty(pte_t pte) in pte_mksoft_dirty() argument
723 return pte_set_flags(pte, _PAGE_SOFT_DIRTY); in pte_mksoft_dirty()
736 static inline pte_t pte_clear_soft_dirty(pte_t pte) in pte_clear_soft_dirty() argument
738 return pte_clear_flags(pte, _PAGE_SOFT_DIRTY); in pte_clear_soft_dirty()
822 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) in pte_modify() argument
824 pteval_t val = pte_val(pte), oldval = val; in pte_modify()
991 static inline int pte_none(pte_t pte) in pte_none() argument
993 return !(pte.pte & ~(_PAGE_KNL_ERRATUM_MASK)); in pte_none()
999 return a.pte == b.pte; in pte_same()
1002 static inline pte_t pte_advance_pfn(pte_t pte, unsigned long nr) in pte_advance_pfn() argument
1004 if (__pte_needs_invert(pte_val(pte))) in pte_advance_pfn()
1005 return __pte(pte_val(pte) - (nr << PFN_PTE_SHIFT)); in pte_advance_pfn()
1006 return __pte(pte_val(pte) + (nr << PFN_PTE_SHIFT)); in pte_advance_pfn()
1051 static inline int pte_protnone(pte_t pte) in pte_protnone() argument
1053 return (pte_flags(pte) & (_PAGE_PROTNONE | _PAGE_PRESENT)) in pte_protnone()
1254 /* local pte updates need not use xchg for locking */
1320 pte_t pte = native_ptep_get_and_clear(ptep); in ptep_get_and_clear() local
1321 page_table_check_pte_clear(mm, pte); in ptep_get_and_clear()
1322 return pte; in ptep_get_and_clear()
1330 pte_t pte; in ptep_get_and_clear_full() local
1336 pte = native_local_ptep_get_and_clear(ptep); in ptep_get_and_clear_full()
1337 page_table_check_pte_clear(mm, pte); in ptep_get_and_clear_full()
1339 pte = ptep_get_and_clear(mm, addr, ptep); in ptep_get_and_clear_full()
1341 return pte; in ptep_get_and_clear_full()
1358 } while (!try_cmpxchg((long *)&ptep->pte, (long *)&old_pte, *(long *)&new_pte)); in ptep_set_wrprotect()
1584 static inline pte_t pte_swp_mkexclusive(pte_t pte) in pte_swp_mkexclusive() argument
1586 return pte_set_flags(pte, _PAGE_SWP_EXCLUSIVE); in pte_swp_mkexclusive()
1589 static inline int pte_swp_exclusive(pte_t pte) in pte_swp_exclusive() argument
1591 return pte_flags(pte) & _PAGE_SWP_EXCLUSIVE; in pte_swp_exclusive()
1594 static inline pte_t pte_swp_clear_exclusive(pte_t pte) in pte_swp_clear_exclusive() argument
1596 return pte_clear_flags(pte, _PAGE_SWP_EXCLUSIVE); in pte_swp_clear_exclusive()
1600 static inline pte_t pte_swp_mksoft_dirty(pte_t pte) in pte_swp_mksoft_dirty() argument
1602 return pte_set_flags(pte, _PAGE_SWP_SOFT_DIRTY); in pte_swp_mksoft_dirty()
1605 static inline int pte_swp_soft_dirty(pte_t pte) in pte_swp_soft_dirty() argument
1607 return pte_flags(pte) & _PAGE_SWP_SOFT_DIRTY; in pte_swp_soft_dirty()
1610 static inline pte_t pte_swp_clear_soft_dirty(pte_t pte) in pte_swp_clear_soft_dirty() argument
1612 return pte_clear_flags(pte, _PAGE_SWP_SOFT_DIRTY); in pte_swp_clear_soft_dirty()
1634 static inline pte_t pte_swp_mkuffd_wp(pte_t pte) in pte_swp_mkuffd_wp() argument
1636 return pte_set_flags(pte, _PAGE_SWP_UFFD_WP); in pte_swp_mkuffd_wp()
1639 static inline int pte_swp_uffd_wp(pte_t pte) in pte_swp_uffd_wp() argument
1641 return pte_flags(pte) & _PAGE_SWP_UFFD_WP; in pte_swp_uffd_wp()
1644 static inline pte_t pte_swp_clear_uffd_wp(pte_t pte) in pte_swp_clear_uffd_wp() argument
1646 return pte_clear_flags(pte, _PAGE_SWP_UFFD_WP); in pte_swp_clear_uffd_wp()
1688 * 'pteval' can come from a PTE, PMD or PUD. We only check
1711 static inline bool pte_access_permitted(pte_t pte, bool write) in pte_access_permitted() argument
1713 return __pte_access_permitted(pte_val(pte), write); in pte_access_permitted()
1737 void arch_check_zapped_pte(struct vm_area_struct *vma, pte_t pte);
1754 static inline bool pte_user_accessible_page(pte_t pte) in pte_user_accessible_page() argument
1756 return (pte_val(pte) & _PAGE_PRESENT) && (pte_val(pte) & _PAGE_USER); in pte_user_accessible_page()
1786 #define set_pte_safe(ptep, pte) \ argument
1788 WARN_ON_ONCE(pte_present(*ptep) && !pte_same(*ptep, pte)); \
1789 set_pte(ptep, pte); \