• Peter Xu's avatar
    mm/x86: add missing pud helpers · 473f2490
    Peter Xu authored
    Some new helpers will be needed for pud entry updates soon.  Introduce
    these helpers by referencing the pmd ones.  Namely:
    
      - pudp_invalidate(): this helper invalidates a huge pud before a
        split happens, so that the invalidated pud entry will make sure no
        race will happen (either with software, like a concurrent zap, or
        hardware, like a/d bit lost).
    
      - pud_modify(): this helper applies a new pgprot to an existing huge
        pud mapping.
    
    For more information on why we need these two helpers, please refer to the
    corresponding pmd helpers in the mprotect() code path.
    
    When at it, simplify the pud_modify()/pmd_modify() comments on shadow
    stack pgtable entries to reference pte_modify() to avoid duplicating the
    whole paragraph three times.
    
    Link: https://lkml.kernel.org/r/20240812181225.1360970-7-peterx@redhat.com
    
    Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
    Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: Dave Jiang <dave.jiang@intel.com>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: David Rientjes <rientjes@google.com>
    Cc: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Kirill A. Shutemov <kirill@shutemov.name>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Michael Ellerman <mpe@ellerman.id.au>
    Cc: Nicholas Piggin <npiggin@gmail.com>
    Cc: Oscar Salvador <osalvador@suse.de>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Rik van Riel <riel@surriel.com>
    Cc: Sean Christopherson <seanjc@google.com>
    Cc: Vlastimil Babka <vbabka@suse.cz>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    473f2490
pgtable.c 22.5 KB