Skip to contentSkip to conversation

mm-treewide-replace-pud_large-with-pud_leaf.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Mar 6, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/treewide: replace pud_large() with pud_leaf()
has been removed from the -mm tree. Its filename was
mm-treewide-replace-pud_large-with-pud_leaf.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Peter Xu <[email protected]>
Subject: mm/treewide: replace pud_large() with pud_leaf()
Date: Tue, 5 Mar 2024 12:37:48 +0800

pud_large() is always defined as pud_leaf(). Merge their usages. Chose pud_leaf() because pud_leaf() is a global API, while pud_large() is not.

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]>

---

 arch/powerpc/mm/book3s64/pgtable.c |    2 +-
 arch/s390/boot/vmem.c              |    2 +-
 arch/s390/include/asm/pgtable.h    |    4 ++--
 arch/s390/mm/gmap.c                |    2 +-
 arch/s390/mm/hugetlbpage.c         |    4 ++--
 arch/s390/mm/pageattr.c            |    2 +-
 arch/s390/mm/pgtable.c             |    2 +-
 arch/s390/mm/vmem.c                |    6 +++---
 arch/sparc/mm/init_64.c            |    2 +-
 arch/x86/kvm/mmu/mmu.c             |    2 +-
 arch/x86/mm/fault.c                |    4 ++--
 arch/x86/mm/ident_map.c            |    2 +-
 arch/x86/mm/init_64.c              |    4 ++--
 arch/x86/mm/kasan_init_64.c        |    2 +-
 arch/x86/mm/mem_encrypt_identity.c |    2 +-
 arch/x86/mm/pat/set_memory.c       |    6 +++---
 arch/x86/mm/pgtable.c              |    2 +-
 arch/x86/mm/pti.c                  |    2 +-
 arch/x86/power/hibernate.c         |    2 +-
 arch/x86/xen/mmu_pv.c              |    4 ++--
 20 files changed, 29 insertions(+), 29 deletions(-)
arch/powerpc/mm/book3s64/pgtable.c renamed from arch/powerpc/mm/book3s64/pgtable.c~mm-treewide-replace-pud_large-with-pud_leaf +1 -1
@@ -130,7 +130,7 @@ void set_pud_at(struct mm_struct *mm, un
 
 	WARN_ON(pte_hw_valid(pud_pte(*pudp)));
 	assert_spin_locked(pud_lockptr(mm, pudp));
-	WARN_ON(!(pud_large(pud)));
+	WARN_ON(!(pud_leaf(pud)));
 #endif
 	trace_hugepage_set_pud(addr, pud_val(pud));
 	return set_pte_at(mm, addr, pudp_ptep(pudp), pud_pte(pud));
arch/s390/boot/vmem.c renamed from arch/s390/boot/vmem.c~mm-treewide-replace-pud_large-with-pud_leaf +1 -1
@@ -366,7 +366,7 @@ static void pgtable_pud_populate(p4d_t *
 			}
 			pmd = boot_crst_alloc(_SEGMENT_ENTRY_EMPTY);
 			pud_populate(&init_mm, pud, pmd);
-		} else if (pud_large(*pud)) {
+		} else if (pud_leaf(*pud)) {
 			continue;
 		}
 		pgtable_pmd_populate(pud, addr, next, mode);
arch/s390/include/asm/pgtable.h renamed from arch/s390/include/asm/pgtable.h~mm-treewide-replace-pud_large-with-pud_leaf +2 -2
@@ -730,7 +730,7 @@ static inline int pud_bad(pud_t pud)
 {
 	unsigned long type = pud_val(pud) & _REGION_ENTRY_TYPE_MASK;
 
-	if (type > _REGION_ENTRY_TYPE_R3 || pud_large(pud))
+	if (type > _REGION_ENTRY_TYPE_R3 || pud_leaf(pud))
 		return 1;
 	if (type < _REGION_ENTRY_TYPE_R3)
 		return 0;
@@ -1400,7 +1400,7 @@ static inline unsigned long pud_deref(pu
 	unsigned long origin_mask;
 
 	origin_mask = _REGION_ENTRY_ORIGIN;
-	if (pud_large(pud))
+	if (pud_leaf(pud))
 		origin_mask = _REGION3_ENTRY_ORIGIN_LARGE;
 	return (unsigned long)__va(pud_val(pud) & origin_mask);
 }
arch/s390/mm/gmap.c renamed from arch/s390/mm/gmap.c~mm-treewide-replace-pud_large-with-pud_leaf +1 -1
@@ -598,7 +598,7 @@ int __gmap_link(struct gmap *gmap, unsig
 	pud = pud_offset(p4d, vmaddr);
 	VM_BUG_ON(pud_none(*pud));
 	/* large puds cannot yet be handled */
-	if (pud_large(*pud))
+	if (pud_leaf(*pud))
 		return -EFAULT;
 	pmd = pmd_offset(pud, vmaddr);
 	VM_BUG_ON(pmd_none(*pmd));
arch/s390/mm/hugetlbpage.c renamed from arch/s390/mm/hugetlbpage.c~mm-treewide-replace-pud_large-with-pud_leaf +2 -2
@@ -224,7 +224,7 @@ pte_t *huge_pte_offset(struct mm_struct
 		if (p4d_present(*p4dp)) {
 			pudp = pud_offset(p4dp, addr);
 			if (pud_present(*pudp)) {
-				if (pud_large(*pudp))
+				if (pud_leaf(*pudp))
 					return (pte_t *) pudp;
 				pmdp = pmd_offset(pudp, addr);
 			}
@@ -240,7 +240,7 @@ int pmd_huge(pmd_t pmd)
 
 int pud_huge(pud_t pud)
 {
-	return pud_large(pud);
+	return pud_leaf(pud);
 }
 
 bool __init arch_hugetlb_valid_size(unsigned long size)
arch/s390/mm/pageattr.c renamed from arch/s390/mm/pageattr.c~mm-treewide-replace-pud_large-with-pud_leaf +1 -1
@@ -274,7 +274,7 @@ static int walk_pud_level(p4d_t *p4d, un
 		if (pud_none(*pudp))
 			return -EINVAL;
 		next = pud_addr_end(addr, end);
-		if (pud_large(*pudp)) {
+		if (pud_leaf(*pudp)) {
 			need_split  = !!(flags & SET_MEMORY_4K);
 			need_split |= !!(addr & ~PUD_MASK);
 			need_split |= !!(addr + PUD_SIZE > next);
arch/s390/mm/pgtable.c renamed from arch/s390/mm/pgtable.c~mm-treewide-replace-pud_large-with-pud_leaf +1 -1
@@ -470,7 +470,7 @@ static int pmd_lookup(struct mm_struct *
 		return -ENOENT;
 
 	/* Large PUDs are not supported yet. */
-	if (pud_large(*pud))
+	if (pud_leaf(*pud))
 		return -EFAULT;
 
 	*pmdp = pmd_offset(pud, addr);
arch/s390/mm/vmem.c renamed from arch/s390/mm/vmem.c~mm-treewide-replace-pud_large-with-pud_leaf +3 -3
@@ -329,7 +329,7 @@ static int modify_pud_table(p4d_t *p4d,
 		if (!add) {
 			if (pud_none(*pud))
 				continue;
-			if (pud_large(*pud)) {
+			if (pud_leaf(*pud)) {
 				if (IS_ALIGNED(addr, PUD_SIZE) &&
 				    IS_ALIGNED(next, PUD_SIZE)) {
 					pud_clear(pud);
@@ -350,7 +350,7 @@ static int modify_pud_table(p4d_t *p4d,
 			if (!pmd)
 				goto out;
 			pud_populate(&init_mm, pud, pmd);
-		} else if (pud_large(*pud)) {
+		} else if (pud_leaf(*pud)) {
 			continue;
 		}
 		ret = modify_pmd_table(pud, addr, next, add, direct, altmap);
@@ -599,7 +599,7 @@ pte_t *vmem_get_alloc_pte(unsigned long
 		if (!pmd)
 			goto out;
 		pud_populate(&init_mm, pud, pmd);
-	} else if (WARN_ON_ONCE(pud_large(*pud))) {
+	} else if (WARN_ON_ONCE(pud_leaf(*pud))) {
 		goto out;
 	}
 	pmd = pmd_offset(pud, addr);
arch/sparc/mm/init_64.c renamed from arch/sparc/mm/init_64.c~mm-treewide-replace-pud_large-with-pud_leaf +1 -1
@@ -1665,7 +1665,7 @@ bool kern_addr_valid(unsigned long addr)
 	if (pud_none(*pud))
 		return false;
 
-	if (pud_large(*pud))
+	if (pud_leaf(*pud))
 		return pfn_valid(pud_pfn(*pud));
 
 	pmd = pmd_offset(pud, addr);
arch/x86/kvm/mmu/mmu.c renamed from arch/x86/kvm/mmu/mmu.c~mm-treewide-replace-pud_large-with-pud_leaf +1 -1
@@ -3126,7 +3126,7 @@ static int host_pfn_mapping_level(struct
 	if (pud_none(pud) || !pud_present(pud))
 		goto out;
 
-	if (pud_large(pud)) {
+	if (pud_leaf(pud)) {
 		level = PG_LEVEL_1G;
 		goto out;
 	}
arch/x86/mm/fault.c renamed from arch/x86/mm/fault.c~mm-treewide-replace-pud_large-with-pud_leaf +2 -2
@@ -376,7 +376,7 @@ static void dump_pagetable(unsigned long
 		goto bad;
 
 	pr_cont("PUD %lx ", pud_val(*pud));
-	if (!pud_present(*pud) || pud_large(*pud))
+	if (!pud_present(*pud) || pud_leaf(*pud))
 		goto out;
 
 	pmd = pmd_offset(pud, address);
@@ -1046,7 +1046,7 @@ spurious_kernel_fault(unsigned long erro
 	if (!pud_present(*pud))
 		return 0;
 
-	if (pud_large(*pud))
+	if (pud_leaf(*pud))
 		return spurious_kernel_fault_check(error_code, (pte_t *) pud);
 
 	pmd = pmd_offset(pud, address);
arch/x86/mm/ident_map.c renamed from arch/x86/mm/ident_map.c~mm-treewide-replace-pud_large-with-pud_leaf +1 -1
@@ -33,7 +33,7 @@ static int ident_pud_init(struct x86_map
 			next = end;
 
 		/* if this is already a gbpage, this portion is already mapped */
-		if (pud_large(*pud))
+		if (pud_leaf(*pud))
 			continue;
 
 		/* Is using a gbpage allowed? */
arch/x86/mm/init_64.c renamed from arch/x86/mm/init_64.c~mm-treewide-replace-pud_large-with-pud_leaf +2 -2
@@ -617,7 +617,7 @@ phys_pud_init(pud_t *pud_page, unsigned
 		}
 
 		if (!pud_none(*pud)) {
-			if (!pud_large(*pud)) {
+			if (!pud_leaf(*pud)) {
 				pmd = pmd_offset(pud, 0);
 				paddr_last = phys_pmd_init(pmd, paddr,
 							   paddr_end,
@@ -1163,7 +1163,7 @@ remove_pud_table(pud_t *pud_start, unsig
 		if (!pud_present(*pud))
 			continue;
 
-		if (pud_large(*pud) &&
+		if (pud_leaf(*pud) &&
 		    IS_ALIGNED(addr, PUD_SIZE) &&
 		    IS_ALIGNED(next, PUD_SIZE)) {
 			spin_lock(&init_mm.page_table_lock);
arch/x86/mm/kasan_init_64.c renamed from arch/x86/mm/kasan_init_64.c~mm-treewide-replace-pud_large-with-pud_leaf +1 -1
@@ -115,7 +115,7 @@ static void __init kasan_populate_p4d(p4
 	pud = pud_offset(p4d, addr);
 	do {
 		next = pud_addr_end(addr, end);
-		if (!pud_large(*pud))
+		if (!pud_leaf(*pud))
 			kasan_populate_pud(pud, addr, next, nid);
 	} while (pud++, addr = next, addr != end);
 }
arch/x86/mm/mem_encrypt_identity.c renamed from arch/x86/mm/mem_encrypt_identity.c~mm-treewide-replace-pud_large-with-pud_leaf +1 -1
@@ -145,7 +145,7 @@ static pud_t __init *sme_prepare_pgd(str
 		set_pud(pud, __pud(PUD_FLAGS | __pa(pmd)));
 	}
 
-	if (pud_large(*pud))
+	if (pud_leaf(*pud))
 		return NULL;
 
 	return pud;
arch/x86/mm/pat/set_memory.c renamed from arch/x86/mm/pat/set_memory.c~mm-treewide-replace-pud_large-with-pud_leaf +3 -3
@@ -684,7 +684,7 @@ pte_t *lookup_address_in_pgd(pgd_t *pgd,
 		return NULL;
 
 	*level = PG_LEVEL_1G;
-	if (pud_large(*pud) || !pud_present(*pud))
+	if (pud_leaf(*pud) || !pud_present(*pud))
 		return (pte_t *)pud;
 
 	pmd = pmd_offset(pud, address);
@@ -743,7 +743,7 @@ pmd_t *lookup_pmd_address(unsigned long
 		return NULL;
 
 	pud = pud_offset(p4d, address);
-	if (pud_none(*pud) || pud_large(*pud) || !pud_present(*pud))
+	if (pud_none(*pud) || pud_leaf(*pud) || !pud_present(*pud))
 		return NULL;
 
 	return pmd_offset(pud, address);
@@ -1274,7 +1274,7 @@ static void unmap_pud_range(p4d_t *p4d,
 	 */
 	while (end - start >= PUD_SIZE) {
 
-		if (pud_large(*pud))
+		if (pud_leaf(*pud))
 			pud_clear(pud);
 		else
 			unmap_pmd_range(pud, start, start + PUD_SIZE);
arch/x86/mm/pgtable.c renamed from arch/x86/mm/pgtable.c~mm-treewide-replace-pud_large-with-pud_leaf +1 -1
@@ -777,7 +777,7 @@ int pmd_set_huge(pmd_t *pmd, phys_addr_t
  */
 int pud_clear_huge(pud_t *pud)
 {
-	if (pud_large(*pud)) {
+	if (pud_leaf(*pud)) {
 		pud_clear(pud);
 		return 1;
 	}
arch/x86/mm/pti.c renamed from arch/x86/mm/pti.c~mm-treewide-replace-pud_large-with-pud_leaf +1 -1
@@ -217,7 +217,7 @@ static pmd_t *pti_user_pagetable_walk_pm
 
 	pud = pud_offset(p4d, address);
 	/* The user page tables do not use large mappings: */
-	if (pud_large(*pud)) {
+	if (pud_leaf(*pud)) {
 		WARN_ON(1);
 		return NULL;
 	}
arch/x86/power/hibernate.c renamed from arch/x86/power/hibernate.c~mm-treewide-replace-pud_large-with-pud_leaf +1 -1
@@ -170,7 +170,7 @@ int relocate_restore_code(void)
 		goto out;
 	}
 	pud = pud_offset(p4d, relocated_restore_code);
-	if (pud_large(*pud)) {
+	if (pud_leaf(*pud)) {
 		set_pud(pud, __pud(pud_val(*pud) & ~_PAGE_NX));
 		goto out;
 	}
arch/x86/xen/mmu_pv.c renamed from arch/x86/xen/mmu_pv.c~mm-treewide-replace-pud_large-with-pud_leaf +2 -2
@@ -1082,7 +1082,7 @@ static void __init xen_cleanmfnmap_pud(p
 	pmd_t *pmd_tbl;
 	int i;
 
-	if (pud_large(*pud)) {
+	if (pud_leaf(*pud)) {
 		pa = pud_val(*pud) & PHYSICAL_PAGE_MASK;
 		xen_free_ro_pages(pa, PUD_SIZE);
 		return;
@@ -1863,7 +1863,7 @@ static phys_addr_t __init xen_early_virt
 	if (!pud_present(pud))
 		return 0;
 	pa = pud_val(pud) & PTE_PFN_MASK;
-	if (pud_large(pud))
+	if (pud_leaf(pud))
 		return pa + (vaddr & ~PUD_MASK);
 
 	pmd = native_make_pmd(xen_read_phys_ulong(pa + pmd_index(vaddr) *

_

Patches currently in -mm which might be from [email protected] are