]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mm: rename p4d_page_vaddr to p4d_pgtable and make it return pud_t *
authorAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Thu, 8 Jul 2021 01:09:56 +0000 (18:09 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 8 Jul 2021 18:48:22 +0000 (11:48 -0700)
No functional change in this patch.

[aneesh.kumar@linux.ibm.com: m68k build error reported by kernel robot]
Link: https://lkml.kernel.org/r/87tulxnb2v.fsf@linux.ibm.com
Link: https://lkml.kernel.org/r/20210615110859.320299-2-aneesh.kumar@linux.ibm.com
Link: https://lore.kernel.org/linuxppc-dev/CAHk-=wi+J+iodze9FtjM3Zi4j4OeS+qqbKxME9QN4roxPEXH9Q@mail.gmail.com/
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Hugh Dickins <hughd@google.com>
Cc: Joel Fernandes <joel@joelfernandes.org>
Cc: Kalesh Singh <kaleshsingh@google.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 files changed:
arch/arm64/include/asm/pgtable.h
arch/ia64/include/asm/pgtable.h
arch/mips/include/asm/pgtable-64.h
arch/powerpc/include/asm/book3s/64/pgtable.h
arch/powerpc/include/asm/nohash/64/pgtable-4k.h
arch/powerpc/mm/book3s64/radix_pgtable.c
arch/powerpc/mm/pgtable_64.c
arch/sparc/include/asm/pgtable_64.h
arch/x86/include/asm/pgtable.h
arch/x86/mm/init_64.c
include/asm-generic/pgtable-nop4d.h
include/asm-generic/pgtable-nopud.h
include/linux/pgtable.h

index d6b8e74f3018653703d9b33375f9afa08067b4a5..f09bf5c028919558021d944ee1c431d5b45148c9 100644 (file)
@@ -710,9 +710,9 @@ static inline phys_addr_t p4d_page_paddr(p4d_t p4d)
        return __p4d_to_phys(p4d);
 }
 
-static inline unsigned long p4d_page_vaddr(p4d_t p4d)
+static inline pud_t *p4d_pgtable(p4d_t p4d)
 {
-       return (unsigned long)__va(p4d_page_paddr(p4d));
+       return (pud_t *)__va(p4d_page_paddr(p4d));
 }
 
 /* Find an entry in the frst-level page table. */
index 7599d04ae19228a4aff1f42880aa90ce3cad21bc..9584b2c5f394a7a00039efb1db6a979b639d605e 100644 (file)
@@ -281,7 +281,7 @@ ia64_phys_addr_valid (unsigned long addr)
 #define p4d_bad(p4d)                   (!ia64_phys_addr_valid(p4d_val(p4d)))
 #define p4d_present(p4d)               (p4d_val(p4d) != 0UL)
 #define p4d_clear(p4dp)                        (p4d_val(*(p4dp)) = 0UL)
-#define p4d_page_vaddr(p4d)            ((unsigned long) __va(p4d_val(p4d) & _PFN_MASK))
+#define p4d_pgtable(p4d)               ((pud_t *) __va(p4d_val(p4d) & _PFN_MASK))
 #define p4d_page(p4d)                  virt_to_page((p4d_val(p4d) + PAGE_OFFSET))
 #endif
 
index 1136b6f3e41e6422aa239df8201f97460ea42ce0..41921acdc9d86b8726d649c32c43170badd50c88 100644 (file)
@@ -209,9 +209,9 @@ static inline void p4d_clear(p4d_t *p4dp)
        p4d_val(*p4dp) = (unsigned long)invalid_pud_table;
 }
 
-static inline unsigned long p4d_page_vaddr(p4d_t p4d)
+static inline pud_t *p4d_pgtable(p4d_t p4d)
 {
-       return p4d_val(p4d);
+       return (pud_t *)p4d_val(p4d);
 }
 
 #define p4d_phys(p4d)          virt_to_phys((void *)p4d_val(p4d))
index 536037017c3ea2d12a68837170303952634790eb..5d34a8646f081f25f476ad3ae2ab65d4a05944ee 100644 (file)
@@ -1051,7 +1051,10 @@ extern struct page *p4d_page(p4d_t p4d);
 /* Pointers in the page table tree are physical addresses */
 #define __pgtable_ptr_val(ptr) __pa(ptr)
 
-#define p4d_page_vaddr(p4d)    __va(p4d_val(p4d) & ~P4D_MASKED_BITS)
+static inline pud_t *p4d_pgtable(p4d_t p4d)
+{
+       return (pud_t *)__va(p4d_val(p4d) & ~P4D_MASKED_BITS);
+}
 
 static inline pmd_t *pud_pgtable(pud_t pud)
 {
index fe2f4c9acd9ed693b8134680f234fa8bd595d69c..10f5cf444d72a8e0ad6c304fc3dd9e68b8aa80aa 100644 (file)
 #define p4d_none(p4d)          (!p4d_val(p4d))
 #define p4d_bad(p4d)           (p4d_val(p4d) == 0)
 #define p4d_present(p4d)       (p4d_val(p4d) != 0)
-#define p4d_page_vaddr(p4d)    (p4d_val(p4d) & ~P4D_MASKED_BITS)
 
 #ifndef __ASSEMBLY__
 
+static inline pud_t *p4d_pgtable(p4d_t p4d)
+{
+       return (pud_t *) (p4d_val(p4d) & ~P4D_MASKED_BITS);
+}
+
 static inline void p4d_clear(p4d_t *p4dp)
 {
        *p4dp = __p4d(0);
index 54f135b1ee60e2361fa6d9c75941b136f1b54a0f..e50ddf129c15c51dd24f0d6f9c52b76cbb0122b9 100644 (file)
@@ -854,7 +854,7 @@ static void __meminit remove_pagetable(unsigned long start, unsigned long end)
                        continue;
                }
 
-               pud_base = (pud_t *)p4d_page_vaddr(*p4d);
+               pud_base = p4d_pgtable(*p4d);
                remove_pud_table(pud_base, addr, next);
                free_pud_table(pud_base, p4d);
        }
index 4ba311808bdbc805b0265358f797e81cbf0edee1..78c8cf01db5f902bc2727f65ac6aaa0c92f8d9f6 100644 (file)
@@ -105,7 +105,7 @@ struct page *p4d_page(p4d_t p4d)
                VM_WARN_ON(!p4d_huge(p4d));
                return pte_page(p4d_pte(p4d));
        }
-       return virt_to_page(p4d_page_vaddr(p4d));
+       return virt_to_page(p4d_pgtable(p4d));
 }
 #endif
 
index 23da25d4765c890658c9ac9a35ccd7a485490d05..4679e45c8348344a323a00ea5f42dd988cd64d25 100644 (file)
@@ -856,8 +856,8 @@ static inline pmd_t *pud_pgtable(pud_t pud)
 #define pmd_clear(pmdp)                        (pmd_val(*(pmdp)) = 0UL)
 #define pud_present(pud)               (pud_val(pud) != 0U)
 #define pud_clear(pudp)                        (pud_val(*(pudp)) = 0UL)
-#define p4d_page_vaddr(p4d)            \
-       ((unsigned long) __va(p4d_val(p4d)))
+#define p4d_pgtable(p4d)               \
+       ((pud_t *) __va(p4d_val(p4d)))
 #define p4d_present(p4d)               (p4d_val(p4d) != 0U)
 #define p4d_clear(p4dp)                        (p4d_val(*(p4dp)) = 0UL)
 
index e064c5fef0f3b5aca9bc7d294855dedec15d83a7..448cd01eb3ecb59ba3c56ca7419f4913c04e8c7f 100644 (file)
@@ -877,9 +877,9 @@ static inline int p4d_present(p4d_t p4d)
        return p4d_flags(p4d) & _PAGE_PRESENT;
 }
 
-static inline unsigned long p4d_page_vaddr(p4d_t p4d)
+static inline pud_t *p4d_pgtable(p4d_t p4d)
 {
-       return (unsigned long)__va(p4d_val(p4d) & p4d_pfn_mask(p4d));
+       return (pud_t *)__va(p4d_val(p4d) & p4d_pfn_mask(p4d));
 }
 
 /*
index 65ea585271769423c19ecb37f0a37b360df4cfe1..ddeaba947eb3d2a5c093c370dde55be0dd1884ff 100644 (file)
@@ -194,8 +194,8 @@ static void sync_global_pgds_l4(unsigned long start, unsigned long end)
                        spin_lock(pgt_lock);
 
                        if (!p4d_none(*p4d_ref) && !p4d_none(*p4d))
-                               BUG_ON(p4d_page_vaddr(*p4d)
-                                      != p4d_page_vaddr(*p4d_ref));
+                               BUG_ON(p4d_pgtable(*p4d)
+                                      != p4d_pgtable(*p4d_ref));
 
                        if (p4d_none(*p4d))
                                set_p4d(p4d, *p4d_ref);
index 2f6b1befb1292d32b0b82d7244be5c0a9860bed5..03b7dae47dd43013ca78c0fd080d5fad50640bda 100644 (file)
@@ -41,7 +41,7 @@ static inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long address)
 #define __p4d(x)                               ((p4d_t) { __pgd(x) })
 
 #define pgd_page(pgd)                          (p4d_page((p4d_t){ pgd }))
-#define pgd_page_vaddr(pgd)                    (p4d_page_vaddr((p4d_t){ pgd }))
+#define pgd_page_vaddr(pgd)                    ((unsigned long)(p4d_pgtable((p4d_t){ pgd })))
 
 /*
  * allocating and freeing a p4d is trivial: the 1-entry p4d is
index 7cbd15f70bf55d6477967fdbf375c9abbc33c3b7..eb70c6d7ceff2eb9eb935d49dcf626d4d6110ec9 100644 (file)
@@ -49,7 +49,7 @@ static inline pud_t *pud_offset(p4d_t *p4d, unsigned long address)
 #define __pud(x)                               ((pud_t) { __p4d(x) })
 
 #define p4d_page(p4d)                          (pud_page((pud_t){ p4d }))
-#define p4d_page_vaddr(p4d)                    (pud_pgtable((pud_t){ p4d }))
+#define p4d_pgtable(p4d)                       ((pud_t *)(pud_pgtable((pud_t){ p4d })))
 
 /*
  * allocating and freeing a pud is trivial: the 1-entry pud is
index c7c992ada1fe34c1faef9866279b189c60628b2f..d147480cdefc7ff88fe4396a2a5d25dcba4223e4 100644 (file)
@@ -114,7 +114,7 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
 #ifndef pud_offset
 static inline pud_t *pud_offset(p4d_t *p4d, unsigned long address)
 {
-       return (pud_t *)p4d_page_vaddr(*p4d) + pud_index(address);
+       return p4d_pgtable(*p4d) + pud_index(address);
 }
 #define pud_offset pud_offset
 #endif