lkml.org 
[lkml]   [2021]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v4 16/26] mm/hugetlb: Introduce huge pte version of uffd-wp helpers
    Date
    They will be used in the follow up patches to either check/set/clear uffd-wp
    bit of a huge pte.

    So far it reuses all the small pte helpers. Archs can overwrite these versions
    when necessary (with __HAVE_ARCH_HUGE_PTE_UFFD_WP* macros) in the future.

    Signed-off-by: Peter Xu <peterx@redhat.com>
    ---
    include/asm-generic/hugetlb.h | 15 +++++++++++++++
    1 file changed, 15 insertions(+)

    diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h
    index 8e1e6244a89d..c45b9deb41ff 100644
    --- a/include/asm-generic/hugetlb.h
    +++ b/include/asm-generic/hugetlb.h
    @@ -32,6 +32,21 @@ static inline pte_t huge_pte_modify(pte_t pte, pgprot_t newprot)
    return pte_modify(pte, newprot);
    }

    +static inline pte_t huge_pte_mkuffd_wp(pte_t pte)
    +{
    + return pte_mkuffd_wp(pte);
    +}
    +
    +static inline pte_t huge_pte_clear_uffd_wp(pte_t pte)
    +{
    + return pte_clear_uffd_wp(pte);
    +}
    +
    +static inline int huge_pte_uffd_wp(pte_t pte)
    +{
    + return pte_uffd_wp(pte);
    +}
    +
    #ifndef __HAVE_ARCH_HUGE_PTE_CLEAR
    static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
    pte_t *ptep, unsigned long sz)
    --
    2.31.1
    \
     
     \ /
      Last update: 2021-07-15 00:25    [W:4.166 / U:0.240 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site