Skip to content

Commit e72c7c2

Browse files
xzpeterakpm00
authored andcommitted
mm/treewide: drop pXd_large()
They're not used anymore, drop all of them. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Peter Xu <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Reviewed-by: Mike Rapoport (IBM) <[email protected]> Cc: Alexander Potapenko <[email protected]> Cc: Andrey Konovalov <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: "Aneesh Kumar K.V" <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Christophe Leroy <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Muchun Song <[email protected]> Cc: "Naveen N. Rao" <[email protected]> Cc: Nicholas Piggin <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vincenzo Frascino <[email protected]> Cc: Yang Shi <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 0a845e0 commit e72c7c2

File tree

9 files changed

+18
-31
lines changed

9 files changed

+18
-31
lines changed

arch/arm/include/asm/pgtable-2level.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
213213

214214
#define pmd_pfn(pmd) (__phys_to_pfn(pmd_val(pmd) & PHYS_MASK))
215215

216-
#define pmd_large(pmd) (pmd_val(pmd) & 2)
217216
#define pmd_leaf(pmd) (pmd_val(pmd) & 2)
218217
#define pmd_bad(pmd) (pmd_val(pmd) & 2)
219218
#define pmd_present(pmd) (pmd_val(pmd))

arch/arm/include/asm/pgtable-3level.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@
118118
PMD_TYPE_TABLE)
119119
#define pmd_sect(pmd) ((pmd_val(pmd) & PMD_TYPE_MASK) == \
120120
PMD_TYPE_SECT)
121-
#define pmd_large(pmd) pmd_sect(pmd)
122121
#define pmd_leaf(pmd) pmd_sect(pmd)
123122

124123
#define pud_clear(pudp) \

arch/loongarch/kvm/mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ static int host_pfn_mapping_level(struct kvm *kvm, gfn_t gfn,
723723
/*
724724
* Read each entry once. As above, a non-leaf entry can be promoted to
725725
* a huge page _during_ this walk. Re-reading the entry could send the
726-
* walk into the weeks, e.g. p*d_large() returns false (sees the old
726+
* walk into the weeks, e.g. p*d_leaf() returns false (sees the old
727727
* value) and then p*d_offset() walks into the target huge page instead
728728
* of the old page table (sees the new value).
729729
*/

arch/powerpc/include/asm/book3s/64/pgtable.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,17 +1437,15 @@ static inline bool is_pte_rw_upgrade(unsigned long old_val, unsigned long new_va
14371437
}
14381438

14391439
/*
1440-
* Like pmd_huge() and pmd_large(), but works regardless of config options
1440+
* Like pmd_huge(), but works regardless of config options
14411441
*/
14421442
#define pmd_leaf pmd_leaf
1443-
#define pmd_large pmd_leaf
14441443
static inline bool pmd_leaf(pmd_t pmd)
14451444
{
14461445
return !!(pmd_raw(pmd) & cpu_to_be64(_PAGE_PTE));
14471446
}
14481447

14491448
#define pud_leaf pud_leaf
1450-
#define pud_large pud_leaf
14511449
static inline bool pud_leaf(pud_t pud)
14521450
{
14531451
return !!(pud_raw(pud) & cpu_to_be64(_PAGE_PTE));

arch/powerpc/include/asm/pgtable.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ void poking_init(void);
101101
extern unsigned long ioremap_bot;
102102
extern const pgprot_t protection_map[16];
103103

104-
#ifndef pmd_large
105-
#define pmd_large(pmd) 0
106-
#endif
107-
108104
/* can we use this in kvm */
109105
unsigned long vmalloc_to_phys(void *vmalloc_addr);
110106

arch/s390/include/asm/pgtable.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -705,16 +705,16 @@ static inline int pud_none(pud_t pud)
705705
return pud_val(pud) == _REGION3_ENTRY_EMPTY;
706706
}
707707

708-
#define pud_leaf pud_large
709-
static inline int pud_large(pud_t pud)
708+
#define pud_leaf pud_leaf
709+
static inline int pud_leaf(pud_t pud)
710710
{
711711
if ((pud_val(pud) & _REGION_ENTRY_TYPE_MASK) != _REGION_ENTRY_TYPE_R3)
712712
return 0;
713713
return !!(pud_val(pud) & _REGION3_ENTRY_LARGE);
714714
}
715715

716-
#define pmd_leaf pmd_large
717-
static inline int pmd_large(pmd_t pmd)
716+
#define pmd_leaf pmd_leaf
717+
static inline int pmd_leaf(pmd_t pmd)
718718
{
719719
return (pmd_val(pmd) & _SEGMENT_ENTRY_LARGE) != 0;
720720
}

arch/sparc/include/asm/pgtable_64.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,8 @@ static inline unsigned long pte_special(pte_t pte)
680680
return pte_val(pte) & _PAGE_SPECIAL;
681681
}
682682

683-
#define pmd_leaf pmd_large
684-
static inline unsigned long pmd_large(pmd_t pmd)
683+
#define pmd_leaf pmd_leaf
684+
static inline unsigned long pmd_leaf(pmd_t pmd)
685685
{
686686
pte_t pte = __pte(pmd_val(pmd));
687687

@@ -867,8 +867,8 @@ static inline pmd_t *pud_pgtable(pud_t pud)
867867
/* only used by the stubbed out hugetlb gup code, should never be called */
868868
#define p4d_page(p4d) NULL
869869

870-
#define pud_leaf pud_large
871-
static inline unsigned long pud_large(pud_t pud)
870+
#define pud_leaf pud_leaf
871+
static inline unsigned long pud_leaf(pud_t pud)
872872
{
873873
pte_t pte = __pte(pud_val(pud));
874874

arch/x86/include/asm/pgtable.h

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -251,23 +251,23 @@ static inline unsigned long pgd_pfn(pgd_t pgd)
251251
return (pgd_val(pgd) & PTE_PFN_MASK) >> PAGE_SHIFT;
252252
}
253253

254-
#define p4d_leaf p4d_large
255-
static inline int p4d_large(p4d_t p4d)
254+
#define p4d_leaf p4d_leaf
255+
static inline int p4d_leaf(p4d_t p4d)
256256
{
257257
/* No 512 GiB pages yet */
258258
return 0;
259259
}
260260

261261
#define pte_page(pte) pfn_to_page(pte_pfn(pte))
262262

263-
#define pmd_leaf pmd_large
264-
static inline int pmd_large(pmd_t pte)
263+
#define pmd_leaf pmd_leaf
264+
static inline int pmd_leaf(pmd_t pte)
265265
{
266266
return pmd_flags(pte) & _PAGE_PSE;
267267
}
268268

269269
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
270-
/* NOTE: when predicate huge page, consider also pmd_devmap, or use pmd_large */
270+
/* NOTE: when predicate huge page, consider also pmd_devmap, or use pmd_leaf */
271271
static inline int pmd_trans_huge(pmd_t pmd)
272272
{
273273
return (pmd_val(pmd) & (_PAGE_PSE|_PAGE_DEVMAP)) == _PAGE_PSE;
@@ -1085,8 +1085,8 @@ static inline pmd_t *pud_pgtable(pud_t pud)
10851085
*/
10861086
#define pud_page(pud) pfn_to_page(pud_pfn(pud))
10871087

1088-
#define pud_leaf pud_large
1089-
static inline int pud_large(pud_t pud)
1088+
#define pud_leaf pud_leaf
1089+
static inline int pud_leaf(pud_t pud)
10901090
{
10911091
return (pud_val(pud) & (_PAGE_PSE | _PAGE_PRESENT)) ==
10921092
(_PAGE_PSE | _PAGE_PRESENT);
@@ -1096,11 +1096,6 @@ static inline int pud_bad(pud_t pud)
10961096
{
10971097
return (pud_flags(pud) & ~(_KERNPG_TABLE | _PAGE_USER)) != 0;
10981098
}
1099-
#else
1100-
static inline int pud_large(pud_t pud)
1101-
{
1102-
return 0;
1103-
}
11041099
#endif /* CONFIG_PGTABLE_LEVELS > 2 */
11051100

11061101
#if CONFIG_PGTABLE_LEVELS > 3

arch/x86/kvm/mmu/mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3110,7 +3110,7 @@ static int host_pfn_mapping_level(struct kvm *kvm, gfn_t gfn,
31103110
/*
31113111
* Read each entry once. As above, a non-leaf entry can be promoted to
31123112
* a huge page _during_ this walk. Re-reading the entry could send the
3113-
* walk into the weeks, e.g. p*d_large() returns false (sees the old
3113+
* walk into the weeks, e.g. p*d_leaf() returns false (sees the old
31143114
* value) and then p*d_offset() walks into the target huge page instead
31153115
* of the old page table (sees the new value).
31163116
*/

0 commit comments

Comments
 (0)