Skip to content

Commit 1361da3

Browse files
committed
mm: always define pxx_pgprot()
jira LE-3557 Rebuild_History Non-Buildable kernel-5.14.0-570.26.1.el9_6 commit-author Peter Xu <[email protected]> commit 0515e02 There're: - 8 archs (arc, arm64, include, mips, powerpc, s390, sh, x86) that support pte_pgprot(). - 2 archs (x86, sparc) that support pmd_pgprot(). - 1 arch (x86) that support pud_pgprot(). Always define them to be used in generic code, and then we don't need to fiddle with "#ifdef"s when doing so. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Peter Xu <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Cc: Alexander Gordeev <[email protected]> Cc: Alex Williamson <[email protected]> Cc: Aneesh Kumar K.V <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Dave Hansen <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Gavin Shan <[email protected]> Cc: Gerald Schaefer <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Niklas Schnelle <[email protected]> Cc: Paolo Bonzini <[email protected]> Cc: Ryan Roberts <[email protected]> Cc: Sean Christopherson <[email protected]> Cc: Sven Schnelle <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Will Deacon <[email protected]> Cc: Zi Yan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> (cherry picked from commit 0515e02) Signed-off-by: Jonathan Maple <[email protected]>
1 parent bfd3c70 commit 1361da3

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed

arch/arm64/include/asm/pgtable.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ static inline void __sync_cache_and_tags(pte_t pte, unsigned int nr_pages)
354354
/*
355355
* Select all bits except the pfn
356356
*/
357+
#define pte_pgprot pte_pgprot
357358
static inline pgprot_t pte_pgprot(pte_t pte)
358359
{
359360
unsigned long pfn = pte_pfn(pte);

arch/powerpc/include/asm/pgtable.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ static inline unsigned long pte_pfn(pte_t pte)
4444
/*
4545
* Select all bits except the pfn
4646
*/
47+
#define pte_pgprot pte_pgprot
4748
static inline pgprot_t pte_pgprot(pte_t pte)
4849
{
4950
unsigned long pte_flags;

arch/s390/include/asm/pgtable.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,7 @@ static inline int pte_unused(pte_t pte)
941941
* young/old accounting is not supported, i.e _PAGE_PROTECT and _PAGE_INVALID
942942
* must not be set.
943943
*/
944+
#define pte_pgprot pte_pgprot
944945
static inline pgprot_t pte_pgprot(pte_t pte)
945946
{
946947
unsigned long pte_flags = pte_val(pte) & _PAGE_CHG_MASK;

arch/sparc/include/asm/pgtable_64.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,7 @@ static inline pmd_t pmd_mkwrite_novma(pmd_t pmd)
782782
return __pmd(pte_val(pte));
783783
}
784784

785+
#define pmd_pgprot pmd_pgprot
785786
static inline pgprot_t pmd_pgprot(pmd_t entry)
786787
{
787788
unsigned long val = pmd_val(entry);

include/linux/pgtable.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,6 +1685,18 @@ typedef unsigned int pgtbl_mod_mask;
16851685
#define MAX_PTRS_PER_P4D PTRS_PER_P4D
16861686
#endif
16871687

1688+
#ifndef pte_pgprot
1689+
#define pte_pgprot(x) ((pgprot_t) {0})
1690+
#endif
1691+
1692+
#ifndef pmd_pgprot
1693+
#define pmd_pgprot(x) ((pgprot_t) {0})
1694+
#endif
1695+
1696+
#ifndef pud_pgprot
1697+
#define pud_pgprot(x) ((pgprot_t) {0})
1698+
#endif
1699+
16881700
/* description of effects of mapping type and prot in current implementation.
16891701
* this is due to the limited x86 page protection hardware. The expected
16901702
* behavior is in parens:

0 commit comments

Comments
 (0)