Lines Matching refs:pte
347 #define __rpte_to_pte(r) ((r).pte)
361 #define pte_pagesize_index(mm, addr, pte) MMU_PAGE_4K argument
419 static inline int __pte_write(pte_t pte) in __pte_write() argument
421 return !!(pte_raw(pte) & cpu_to_be64(_PAGE_WRITE)); in __pte_write()
426 static inline bool pte_savedwrite(pte_t pte) in pte_savedwrite() argument
435 return !(pte_raw(pte) & cpu_to_be64(_PAGE_RWX | _PAGE_PRIVILEGED)); in pte_savedwrite()
439 static inline bool pte_savedwrite(pte_t pte) in pte_savedwrite() argument
445 static inline int pte_write(pte_t pte) in pte_write() argument
447 return __pte_write(pte) || pte_savedwrite(pte); in pte_write()
450 static inline int pte_read(pte_t pte) in pte_read() argument
452 return !!(pte_raw(pte) & cpu_to_be64(_PAGE_READ)); in pte_read()
509 static inline int pte_dirty(pte_t pte) in pte_dirty() argument
511 return !!(pte_raw(pte) & cpu_to_be64(_PAGE_DIRTY)); in pte_dirty()
514 static inline int pte_young(pte_t pte) in pte_young() argument
516 return !!(pte_raw(pte) & cpu_to_be64(_PAGE_ACCESSED)); in pte_young()
519 static inline int pte_special(pte_t pte) in pte_special() argument
521 return !!(pte_raw(pte) & cpu_to_be64(_PAGE_SPECIAL)); in pte_special()
524 static inline bool pte_exec(pte_t pte) in pte_exec() argument
526 return !!(pte_raw(pte) & cpu_to_be64(_PAGE_EXEC)); in pte_exec()
531 static inline bool pte_soft_dirty(pte_t pte) in pte_soft_dirty() argument
533 return !!(pte_raw(pte) & cpu_to_be64(_PAGE_SOFT_DIRTY)); in pte_soft_dirty()
536 static inline pte_t pte_mksoft_dirty(pte_t pte) in pte_mksoft_dirty() argument
538 return __pte_raw(pte_raw(pte) | cpu_to_be64(_PAGE_SOFT_DIRTY)); in pte_mksoft_dirty()
541 static inline pte_t pte_clear_soft_dirty(pte_t pte) in pte_clear_soft_dirty() argument
543 return __pte_raw(pte_raw(pte) & cpu_to_be64(~_PAGE_SOFT_DIRTY)); in pte_clear_soft_dirty()
548 static inline int pte_protnone(pte_t pte) in pte_protnone() argument
550 return (pte_raw(pte) & cpu_to_be64(_PAGE_PRESENT | _PAGE_PTE | _PAGE_RWX)) == in pte_protnone()
555 static inline pte_t pte_mk_savedwrite(pte_t pte) in pte_mk_savedwrite() argument
562 VM_BUG_ON((pte_raw(pte) & cpu_to_be64(_PAGE_PRESENT | _PAGE_RWX | _PAGE_PRIVILEGED)) != in pte_mk_savedwrite()
564 return __pte_raw(pte_raw(pte) & cpu_to_be64(~_PAGE_PRIVILEGED)); in pte_mk_savedwrite()
568 static inline pte_t pte_clear_savedwrite(pte_t pte) in pte_clear_savedwrite() argument
573 VM_BUG_ON(!pte_protnone(pte)); in pte_clear_savedwrite()
574 return __pte_raw(pte_raw(pte) | cpu_to_be64(_PAGE_PRIVILEGED)); in pte_clear_savedwrite()
578 static inline pte_t pte_clear_savedwrite(pte_t pte) in pte_clear_savedwrite() argument
581 return __pte_raw(pte_raw(pte) & cpu_to_be64(~_PAGE_WRITE)); in pte_clear_savedwrite()
585 static inline bool pte_hw_valid(pte_t pte) in pte_hw_valid() argument
587 return (pte_raw(pte) & cpu_to_be64(_PAGE_PRESENT | _PAGE_PTE)) == in pte_hw_valid()
591 static inline int pte_present(pte_t pte) in pte_present() argument
600 if (pte_hw_valid(pte)) in pte_present()
602 return (pte_raw(pte) & cpu_to_be64(_PAGE_INVALID | _PAGE_PTE)) == in pte_present()
607 extern bool arch_pte_access_permitted(u64 pte, bool write, bool execute);
609 static inline bool arch_pte_access_permitted(u64 pte, bool write, bool execute) in arch_pte_access_permitted() argument
615 static inline bool pte_user(pte_t pte) in pte_user() argument
617 return !(pte_raw(pte) & cpu_to_be64(_PAGE_PRIVILEGED)); in pte_user()
621 static inline bool pte_access_permitted(pte_t pte, bool write) in pte_access_permitted() argument
627 if (!pte_present(pte) || !pte_user(pte) || !pte_read(pte)) in pte_access_permitted()
630 if (write && !pte_write(pte)) in pte_access_permitted()
633 return arch_pte_access_permitted(pte_val(pte), write, 0); in pte_access_permitted()
651 static inline unsigned long pte_pfn(pte_t pte) in pte_pfn() argument
653 return (pte_val(pte) & PTE_RPN_MASK) >> PAGE_SHIFT; in pte_pfn()
657 static inline pte_t pte_wrprotect(pte_t pte) in pte_wrprotect() argument
659 if (unlikely(pte_savedwrite(pte))) in pte_wrprotect()
660 return pte_clear_savedwrite(pte); in pte_wrprotect()
661 return __pte_raw(pte_raw(pte) & cpu_to_be64(~_PAGE_WRITE)); in pte_wrprotect()
664 static inline pte_t pte_exprotect(pte_t pte) in pte_exprotect() argument
666 return __pte_raw(pte_raw(pte) & cpu_to_be64(~_PAGE_EXEC)); in pte_exprotect()
669 static inline pte_t pte_mkclean(pte_t pte) in pte_mkclean() argument
671 return __pte_raw(pte_raw(pte) & cpu_to_be64(~_PAGE_DIRTY)); in pte_mkclean()
674 static inline pte_t pte_mkold(pte_t pte) in pte_mkold() argument
676 return __pte_raw(pte_raw(pte) & cpu_to_be64(~_PAGE_ACCESSED)); in pte_mkold()
679 static inline pte_t pte_mkexec(pte_t pte) in pte_mkexec() argument
681 return __pte_raw(pte_raw(pte) | cpu_to_be64(_PAGE_EXEC)); in pte_mkexec()
684 static inline pte_t pte_mkwrite(pte_t pte) in pte_mkwrite() argument
689 return __pte_raw(pte_raw(pte) | cpu_to_be64(_PAGE_RW)); in pte_mkwrite()
692 static inline pte_t pte_mkdirty(pte_t pte) in pte_mkdirty() argument
694 return __pte_raw(pte_raw(pte) | cpu_to_be64(_PAGE_DIRTY | _PAGE_SOFT_DIRTY)); in pte_mkdirty()
697 static inline pte_t pte_mkyoung(pte_t pte) in pte_mkyoung() argument
699 return __pte_raw(pte_raw(pte) | cpu_to_be64(_PAGE_ACCESSED)); in pte_mkyoung()
702 static inline pte_t pte_mkspecial(pte_t pte) in pte_mkspecial() argument
704 return __pte_raw(pte_raw(pte) | cpu_to_be64(_PAGE_SPECIAL)); in pte_mkspecial()
707 static inline pte_t pte_mkhuge(pte_t pte) in pte_mkhuge() argument
709 return pte; in pte_mkhuge()
712 static inline pte_t pte_mkdevmap(pte_t pte) in pte_mkdevmap() argument
714 return __pte_raw(pte_raw(pte) | cpu_to_be64(_PAGE_SPECIAL | _PAGE_DEVMAP)); in pte_mkdevmap()
717 static inline pte_t pte_mkprivileged(pte_t pte) in pte_mkprivileged() argument
719 return __pte_raw(pte_raw(pte) | cpu_to_be64(_PAGE_PRIVILEGED)); in pte_mkprivileged()
722 static inline pte_t pte_mkuser(pte_t pte) in pte_mkuser() argument
724 return __pte_raw(pte_raw(pte) & cpu_to_be64(~_PAGE_PRIVILEGED)); in pte_mkuser()
733 static inline int pte_devmap(pte_t pte) in pte_devmap() argument
737 return (pte_raw(pte) & mask) == mask; in pte_devmap()
740 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) in pte_modify() argument
743 return __pte_raw((pte_raw(pte) & cpu_to_be64(_PAGE_CHG_MASK)) | in pte_modify()
771 #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val((pte)) & ~_PAGE_PTE }) argument
783 static inline pte_t pte_swp_mksoft_dirty(pte_t pte) in pte_swp_mksoft_dirty() argument
785 return __pte_raw(pte_raw(pte) | cpu_to_be64(_PAGE_SWP_SOFT_DIRTY)); in pte_swp_mksoft_dirty()
788 static inline bool pte_swp_soft_dirty(pte_t pte) in pte_swp_soft_dirty() argument
790 return !!(pte_raw(pte) & cpu_to_be64(_PAGE_SWP_SOFT_DIRTY)); in pte_swp_soft_dirty()
793 static inline pte_t pte_swp_clear_soft_dirty(pte_t pte) in pte_swp_clear_soft_dirty() argument
795 return __pte_raw(pte_raw(pte) & cpu_to_be64(~_PAGE_SWP_SOFT_DIRTY)); in pte_swp_clear_soft_dirty()
837 static inline int pte_none(pte_t pte) in pte_none() argument
840 return radix__pte_none(pte); in pte_none()
841 return hash__pte_none(pte); in pte_none()
845 pte_t *ptep, pte_t pte, int percpu) in __set_pte_at() argument
848 VM_WARN_ON(!(pte_raw(pte) & cpu_to_be64(_PAGE_PTE))); in __set_pte_at()
853 pte = __pte_raw(pte_raw(pte) | cpu_to_be64(_PAGE_PTE)); in __set_pte_at()
856 return radix__set_pte_at(mm, addr, ptep, pte, percpu); in __set_pte_at()
857 return hash__set_pte_at(mm, addr, ptep, pte, percpu); in __set_pte_at()
890 static inline bool pte_ci(pte_t pte) in pte_ci() argument
892 __be64 pte_v = pte_raw(pte); in pte_ci()
984 static inline pud_t pte_pud(pte_t pte) in pte_pud() argument
986 return __pud_raw(pte_raw(pte)); in pte_pud()
1031 static inline p4d_t pte_p4d(pte_t pte) in pte_p4d() argument
1033 return __p4d_raw(pte_raw(pte)); in pte_p4d()
1119 static inline pmd_t pte_pmd(pte_t pte) in pte_pmd() argument
1121 return __pmd_raw(pte_raw(pte)); in pte_pmd()